Go to the documentation of this file.
46 #ifndef _IR_OPENLASIR_HPP
47 #define _IR_OPENLASIR_HPP
84 #define OPENLASIR_ADDRESS_BITS 16 // 8 bit address + 8 bit inverted address
85 #define OPENLASIR_COMMAND_BITS 16 // 16 bit command, no error check
86 #define OPENLASIR_BITS (OPENLASIR_ADDRESS_BITS + OPENLASIR_COMMAND_BITS) // 32 bits total
91 #define OPENLASIR_MODE_LASER_TAG_FIRE 0 // Laser tag shot. Data = color.
92 #define OPENLASIR_MODE_USER_PRESENCE_ANNOUNCEMENT 1 // User device saying "I'm here." No response expected.
93 #define OPENLASIR_MODE_BASE_STATION_PRESENCE_ANNOUNCEMENT 2 // Fixed base station saying "I'm here."
94 #define OPENLASIR_MODE_USER_TO_USER_HANDSHAKE_INITIATION 3 // User badge initiates handshake with another user badge.
95 #define OPENLASIR_MODE_USER_TO_USER_HANDSHAKE_RESPONSE 4 // Response to a user-to-user handshake initiation.
96 #define OPENLASIR_MODE_USER_TO_BASE_STATION_HANDSHAKE_INITIATION 5 // User badge initiates handshake with a base station.
97 #define OPENLASIR_MODE_USER_TO_BASE_STATION_HANDSHAKE_RESPONSE 6 // Base station responds to a user-initiated handshake.
98 #define OPENLASIR_MODE_BASE_STATION_TO_USER_HANDSHAKE_INITIATION 7 // Base station initiates handshake with a user badge.
99 #define OPENLASIR_MODE_BASE_STATION_TO_USER_HANDSHAKE_RESPONSE 8 // User badge responds to a base-station-initiated handshake.
100 #define OPENLASIR_MODE_COLOR_SET_TEMPORARY 9 // Tell a badge to display a color temporarily.
101 #define OPENLASIR_MODE_COLOR_SET_PERMANENT 10 // Tell a badge to display a color and "remember" it according to some device-specific logic.
102 #define OPENLASIR_MODE_GENERAL_INTERACT 11 // Tell a device to execute a general "interact" action. The specific behavior is defined by the receiver.
108 #define OPENLASIR_COLOR_CYAN 0 // (0, 255, 255)
109 #define OPENLASIR_COLOR_MAGENTA 1 // (255, 0, 255)
110 #define OPENLASIR_COLOR_YELLOW 2 // (255, 255, 0)
111 #define OPENLASIR_COLOR_GREEN 3 // (0, 255, 0)
112 #define OPENLASIR_COLOR_RED 4 // (255, 0, 0)
113 #define OPENLASIR_COLOR_BLUE 5 // (0, 0, 255)
114 #define OPENLASIR_COLOR_ORANGE 6 // (255, 165, 0)
115 #define OPENLASIR_COLOR_WHITE 7 // (255, 255, 255)
158 return tRawData.
ULong;
174 tRawCommand.
UByte.
HighByte = (aMode & 0x1F) | ((aData & 0x07) << 5);
176 return tRawCommand.
UWord;
202 void IRsend::sendOpenLASIR(uint8_t aAddress, uint8_t aDeviceID, uint8_t aMode, uint8_t aData, int_fast8_t aNumberOfRepeats) {
293 DEBUG_PRINTLN(F(
"OpenLASIR: Command has valid inverse - looks like standard NEC, skipping"));
312 #endif // _IR_OPENLASIR_HPP
uint16_t address
Decoded address, Distance protocol (tMarkTicksLong (if tMarkTicksLong == 0, then tMarkTicksShort) << ...
#define MICROS_PER_TICK
microseconds per clock interrupt tick
Union to specify parts / manifestations of a 32 bit Long without casts and shifts.
decode_type_t lastDecodedProtocol
uint16_t numberOfBits
Number of bits received for data (address + command + parity) - to determine protocol length if diffe...
void int_fast8_t aNumberOfRepeats
Union to specify parts / manifestations of a 16 bit Word without casts and shifts.
void decodePulseDistanceWidthData_P(PulseDistanceWidthProtocolConstants const *aProtocolConstantsPGM, uint_fast8_t aNumberOfBits, IRRawlenType aStartOffset=3)
struct WordUnion::@2 UByte
struct LongUnion::@4 UByte
#define IRDATA_FLAGS_IS_REPEAT
The gap between the preceding frame is as smaller than the maximum gap expected for a repeat....
void sendOpenLASIRRaw(uint32_t aRawData, int_fast8_t aNumberOfRepeats=NO_REPEATS)
Send raw 32-bit OpenLASIR data.
uint32_t computeOpenLASIRRawDataAndChecksum(uint8_t aAddress, uint16_t aCommand)
Compute the raw 32-bit data for an OpenLASIR frame from 8-bit address and 16-bit command.
void checkForRepeatSpaceTicksAndSetFlag(uint16_t aMaximumRepeatSpaceTicks)
bool matchSpace(uint16_t aMeasuredTicks, uint16_t aMatchValueMicros)
Compensate for spaces shortened by demodulator hardware.
uint16_t computeOpenLASIRRawCommand(uint8_t aDeviceID, uint8_t aMode, uint8_t aData)
Compute the raw 32-bit data for an OpenLASIR frame from 8-bit address, 8-bit DeviceID,...
void sendPulseDistanceWidth_P(PulseDistanceWidthProtocolConstants const *aProtocolConstantsPGM, IRDecodedRawDataType aData, uint_fast8_t aNumberOfBits, int_fast8_t aNumberOfRepeats)
uint8_t flags
IRDATA_FLAGS_IS_REPEAT, IRDATA_FLAGS_WAS_OVERFLOW etc. See IRDATA_FLAGS_* definitions above.
uint16_t command
Decoded command, Distance protocol (tMarkTicksShort << 8) | tSpaceTicksShort.
void sendOpenLASIRRepeat()
Send special OpenLASIR repeat frame (same as NEC repeat frame).
IRDecodedRawDataType decodedRawData
Up to 32/64 bit decoded raw data, to be used for send<protocol>Raw functions.
bool matchMark(uint16_t aMeasuredTicks, uint16_t aMatchValueMicros)
Compensate for marks exceeded by demodulator hardware.
IRRawbufType rawbuf[RAW_BUFFER_LENGTH]
raw data / tick counts per mark/space. With 8 bit we can only store up to 12.7 ms....
uint16_t lastDecodedCommand
#define DEBUG_PRINTLN(...)
#define IRDATA_FLAGS_IS_LSB_FIRST
#define NEC_REPEAT_HEADER_SPACE
void sendOpenLASIRSpecialRepeat()
Static function variant of IRsend::sendOpenLASIRRepeat For use in ProtocolConstants.
IRRawlenType rawlen
Counter of entries in rawbuf of last received frame.
bool decodeOpenLASIR()
Decode an OpenLASIR frame.
void sendNECRepeat()
Send special NEC repeat frame Repeat commands should be sent in a 110 ms raster.
struct LongUnion::@6 UWord
decode_type_t protocol
UNKNOWN, NEC, SONY, RC5, PULSE_DISTANCE, ...
void sendOpenLASIR(uint8_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats)
Send an OpenLASIR frame with special NEC-style repeats.
uint16_t lastDecodedAddress
void sendNECSpecialRepeat()
Static function variant of IRsend::sendNECRepeat For use in ProtocolConstants.
#define NEC_MAXIMUM_REPEAT_DISTANCE