Portable C library for decoding and encoding Infra-Red NEC protocol messages.
The library only works with timing data of the IR signal, for both decoding and encoding. There are no functions to read IR sensors or drive output LEDs. Therefore, the library is perfectly portable, but it is necessary to add the transmit and receive functionality for your platform.
This is a standard C library.
For the optional library tests, the cpputest is required.
The library can be built using the following commands:
git clone https://github.com/privara/nec-protocol
mkdir build
cd build
cmake ../
Captured IR signals usually deviate slightly from the timing specified by the protocol. This is caused by the real-world inaccuracies and quality of IR sensors.
The library by default tolerates up to 20% deviances of the basic NEC pulse duration, which is 562 usec. You can adjust the NEC_PULSE_TOLERANCE
and NEC_SPACE_TOLERANCE
defines, if the defaults do not work for you.