IRremote
IRProtocol.h File Reference

Common declarations for receiving and sending. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  DistanceWidthTimingInfoStruct
 
struct  IRData
 Data structure for the user application, available as decodedIRData. More...
 
struct  PulseDistanceWidthProtocolConstants
 

Macros

#define SIRCS_12_PROTOCOL   12
 
#define SIRCS_15_PROTOCOL   15
 
#define SIRCS_20_PROTOCOL   20
 
#define IRDATA_FLAGS_EMPTY   0x00
 
#define IRDATA_FLAGS_IS_REPEAT   0x01
 The gap between the preceding frame is as smaller than the maximum gap expected for a repeat. !!!We do not check for changed command or address, because it is almost not possible to press 2 different buttons on the remote within around 100 ms!!! More...
 
#define IRDATA_FLAGS_IS_AUTO_REPEAT   0x02
 The current repeat frame is a repeat, that is always sent after a regular frame and cannot be avoided. Only specified for protocols DENON, and LEGO. More...
 
#define IRDATA_FLAGS_PARITY_FAILED   0x04
 The current (autorepeat) frame violated parity check. More...
 
#define IRDATA_FLAGS_TOGGLE_BIT   0x08
 Is set if RC5 or RC6 toggle bit is set. More...
 
#define IRDATA_TOGGLE_BIT_MASK   0x08
 deprecated -is set if RC5 or RC6 toggle bit is set. More...
 
#define IRDATA_FLAGS_EXTRA_INFO   0x10
 There is extra info not contained in address and data (e.g. Kaseikyo unknown vendor ID, or in decodedRawDataArray). More...
 
#define IRDATA_FLAGS_IS_PROTOCOL_WITH_DIFFERENT_REPEAT   0x20
 Here we have a repeat of type NEC2 or SamsungLG. More...
 
#define IRDATA_FLAGS_WAS_OVERFLOW   0x40
 irparams.rawlen is set to 0 in this case to avoid endless OverflowFlag. More...
 
#define IRDATA_FLAGS_IS_MSB_FIRST   0x80
 Value is mainly determined by the (known) protocol. More...
 
#define IRDATA_FLAGS_IS_LSB_FIRST   0x00
 
#define RAW_DATA_ARRAY_SIZE   ((((RAW_BUFFER_LENGTH - 2) - 1) / (2 * BITS_IN_RAW_DATA_TYPE)) + 1)
 
#define SUPPRESS_STOP_BIT_FOR_THIS_DATA   0x20
 
#define PROTOCOL_IS_MSB_FIRST   IRDATA_FLAGS_IS_MSB_FIRST
 
#define PROTOCOL_IS_LSB_FIRST   IRDATA_FLAGS_IS_LSB_FIRST
 
#define SEND_STOP_BIT   true
 
#define SEND_NO_STOP_BIT   false
 
#define BEO_KHZ   455
 
#define SONY_KHZ   40
 
#define BOSEWAVE_KHZ   38
 
#define DENON_KHZ   38
 
#define JVC_KHZ   38
 
#define LG_KHZ   38
 
#define NEC_KHZ   38
 
#define SAMSUNG_KHZ   38
 
#define KASEIKYO_KHZ   37
 
#define RC5_RC6_KHZ   36
 

Enumerations

enum  decode_type_t {
  UNKNOWN = 0, PULSE_WIDTH, PULSE_DISTANCE, APPLE,
  DENON, JVC, LG, LG2,
  NEC, NEC2, ONKYO, PANASONIC,
  KASEIKYO, KASEIKYO_DENON, KASEIKYO_SHARP, KASEIKYO_JVC,
  KASEIKYO_MITSUBISHI, RC5, RC6, SAMSUNG,
  SAMSUNGLG, SAMSUNG48, SHARP, SONY,
  BANG_OLUFSEN, BOSEWAVE, LEGO_PF, MAGIQUEST,
  WHYNTER, FAST
}
 An enum consisting of all supported formats. More...
 

Functions

const char * getProtocolString (decode_type_t aProtocol)
 
void printIRResultShort (Print *aSerial, IRData *aIRDataPtr, bool aPrintGap)
 Function to print decoded result and flags in one line. More...
 
uint8_t bitreverseOneByte (uint8_t aValue)
 
uint32_t bitreverse32Bit (uint32_t aInput)
 

Detailed Description

Common declarations for receiving and sending.

This file is part of Arduino-IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.

MIT License

Copyright (c) 2020-2023 Armin Joachimsmeyer

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Definition in file IRProtocol.h.

Macro Definition Documentation

◆ BEO_KHZ

#define BEO_KHZ   455

Definition at line 156 of file IRProtocol.h.

◆ BOSEWAVE_KHZ

#define BOSEWAVE_KHZ   38

Definition at line 159 of file IRProtocol.h.

◆ DENON_KHZ

#define DENON_KHZ   38

Definition at line 160 of file IRProtocol.h.

◆ IRDATA_FLAGS_EMPTY

#define IRDATA_FLAGS_EMPTY   0x00

Definition at line 91 of file IRProtocol.h.

◆ IRDATA_FLAGS_EXTRA_INFO

#define IRDATA_FLAGS_EXTRA_INFO   0x10

There is extra info not contained in address and data (e.g. Kaseikyo unknown vendor ID, or in decodedRawDataArray).

Definition at line 97 of file IRProtocol.h.

◆ IRDATA_FLAGS_IS_AUTO_REPEAT

#define IRDATA_FLAGS_IS_AUTO_REPEAT   0x02

The current repeat frame is a repeat, that is always sent after a regular frame and cannot be avoided. Only specified for protocols DENON, and LEGO.

Definition at line 93 of file IRProtocol.h.

◆ IRDATA_FLAGS_IS_LSB_FIRST

#define IRDATA_FLAGS_IS_LSB_FIRST   0x00

Definition at line 101 of file IRProtocol.h.

◆ IRDATA_FLAGS_IS_MSB_FIRST

#define IRDATA_FLAGS_IS_MSB_FIRST   0x80

Value is mainly determined by the (known) protocol.

Definition at line 100 of file IRProtocol.h.

◆ IRDATA_FLAGS_IS_PROTOCOL_WITH_DIFFERENT_REPEAT

#define IRDATA_FLAGS_IS_PROTOCOL_WITH_DIFFERENT_REPEAT   0x20

Here we have a repeat of type NEC2 or SamsungLG.

Definition at line 98 of file IRProtocol.h.

◆ IRDATA_FLAGS_IS_REPEAT

#define IRDATA_FLAGS_IS_REPEAT   0x01

The gap between the preceding frame is as smaller than the maximum gap expected for a repeat. !!!We do not check for changed command or address, because it is almost not possible to press 2 different buttons on the remote within around 100 ms!!!

Definition at line 92 of file IRProtocol.h.

◆ IRDATA_FLAGS_PARITY_FAILED

#define IRDATA_FLAGS_PARITY_FAILED   0x04

The current (autorepeat) frame violated parity check.

Definition at line 94 of file IRProtocol.h.

◆ IRDATA_FLAGS_TOGGLE_BIT

#define IRDATA_FLAGS_TOGGLE_BIT   0x08

Is set if RC5 or RC6 toggle bit is set.

Definition at line 95 of file IRProtocol.h.

◆ IRDATA_FLAGS_WAS_OVERFLOW

#define IRDATA_FLAGS_WAS_OVERFLOW   0x40

irparams.rawlen is set to 0 in this case to avoid endless OverflowFlag.

Definition at line 99 of file IRProtocol.h.

◆ IRDATA_TOGGLE_BIT_MASK

#define IRDATA_TOGGLE_BIT_MASK   0x08

deprecated -is set if RC5 or RC6 toggle bit is set.

Definition at line 96 of file IRProtocol.h.

◆ JVC_KHZ

#define JVC_KHZ   38

Definition at line 161 of file IRProtocol.h.

◆ KASEIKYO_KHZ

#define KASEIKYO_KHZ   37

Definition at line 165 of file IRProtocol.h.

◆ LG_KHZ

#define LG_KHZ   38

Definition at line 162 of file IRProtocol.h.

◆ NEC_KHZ

#define NEC_KHZ   38

Definition at line 163 of file IRProtocol.h.

◆ PROTOCOL_IS_LSB_FIRST

#define PROTOCOL_IS_LSB_FIRST   IRDATA_FLAGS_IS_LSB_FIRST

Definition at line 147 of file IRProtocol.h.

◆ PROTOCOL_IS_MSB_FIRST

#define PROTOCOL_IS_MSB_FIRST   IRDATA_FLAGS_IS_MSB_FIRST

Definition at line 146 of file IRProtocol.h.

◆ RAW_DATA_ARRAY_SIZE

#define RAW_DATA_ARRAY_SIZE   ((((RAW_BUFFER_LENGTH - 2) - 1) / (2 * BITS_IN_RAW_DATA_TYPE)) + 1)

Definition at line 103 of file IRProtocol.h.

◆ RC5_RC6_KHZ

#define RC5_RC6_KHZ   36

Definition at line 166 of file IRProtocol.h.

◆ SAMSUNG_KHZ

#define SAMSUNG_KHZ   38

Definition at line 164 of file IRProtocol.h.

◆ SEND_NO_STOP_BIT

#define SEND_NO_STOP_BIT   false

Definition at line 150 of file IRProtocol.h.

◆ SEND_STOP_BIT

#define SEND_STOP_BIT   true

Definition at line 149 of file IRProtocol.h.

◆ SIRCS_12_PROTOCOL

#define SIRCS_12_PROTOCOL   12

Definition at line 75 of file IRProtocol.h.

◆ SIRCS_15_PROTOCOL

#define SIRCS_15_PROTOCOL   15

Definition at line 76 of file IRProtocol.h.

◆ SIRCS_20_PROTOCOL

#define SIRCS_20_PROTOCOL   20

Definition at line 77 of file IRProtocol.h.

◆ SONY_KHZ

#define SONY_KHZ   40

Definition at line 158 of file IRProtocol.h.

◆ SUPPRESS_STOP_BIT_FOR_THIS_DATA

#define SUPPRESS_STOP_BIT_FOR_THIS_DATA   0x20

Definition at line 145 of file IRProtocol.h.

Enumeration Type Documentation

◆ decode_type_t

An enum consisting of all supported formats.

You do NOT need to remove entries from this list when disabling protocols! !!!Must be the same order as ProtocolNames in IRReceive.hpp!!!

Enumerator
UNKNOWN 
PULSE_WIDTH 
PULSE_DISTANCE 
APPLE 
DENON 
JVC 
LG 
LG2 
NEC 
NEC2 
ONKYO 
PANASONIC 
KASEIKYO 
KASEIKYO_DENON 
KASEIKYO_SHARP 
KASEIKYO_JVC 
KASEIKYO_MITSUBISHI 
RC5 
RC6 
SAMSUNG 
SAMSUNGLG 
SAMSUNG48 
SHARP 
SONY 
BANG_OLUFSEN 
BOSEWAVE 
LEGO_PF 
MAGIQUEST 
WHYNTER 
FAST 

Definition at line 40 of file IRProtocol.h.