| 1 | /* IRLib_P05_Panasonic_Old.h |
|---|
| 2 | * Part of IRLib Library for Arduino receiving, decoding, and sending |
|---|
| 3 | * infrared signals. See COPYRIGHT.txt and LICENSE.txt for more information. |
|---|
| 4 | */ |
|---|
| 5 | /* |
|---|
| 6 | * This protocol #5 named "Panasonic_Old" is a 57 kHz protocol with 22 bits |
|---|
| 7 | * of data. The second 11 bits are the bitwise logical complement of the first 11 bits. |
|---|
| 8 | * The protocol is used by many cable boxes and DVR's made by Scientific Atlantic and |
|---|
| 9 | * Cisco. They are common for Bright House and Time Warner cable systems. |
|---|
| 10 | */ |
|---|
| 11 | |
|---|
| 12 | #ifndef IRLIB_PROTOCOL_05_H |
|---|
| 13 | #define IRLIB_PROTOCOL_05_H |
|---|
| 14 | #define IR_SEND_PROTOCOL_05 case 5: IRsendPanasonic_Old::send(data); break; |
|---|
| 15 | #define IR_DECODE_PROTOCOL_05 if(IRdecodePanasonic_Old::decode()) return true; |
|---|
| 16 | #ifdef IRLIB_HAVE_COMBO |
|---|
| 17 | #define PV_IR_DECODE_PROTOCOL_05 ,public virtual IRdecodePanasonic_Old |
|---|
| 18 | #define PV_IR_SEND_PROTOCOL_05 ,public virtual IRsendPanasonic_Old |
|---|
| 19 | #else |
|---|
| 20 | #define PV_IR_DECODE_PROTOCOL_05 public virtual IRdecodePanasonic_Old |
|---|
| 21 | #define PV_IR_SEND_PROTOCOL_05 public virtual IRsendPanasonic_Old |
|---|
| 22 | #endif |
|---|
| 23 | |
|---|
| 24 | #ifdef IRLIBSENDBASE_H |
|---|
| 25 | class IRsendPanasonic_Old: public virtual IRsendBase { |
|---|
| 26 | public: |
|---|
| 27 | void send(uint32_t data) { |
|---|
| 28 | sendGeneric(data,22, 833*4, 833*4, 833, 833, 833*3, 833,57, true); |
|---|
| 29 | }; |
|---|
| 30 | }; |
|---|
| 31 | #endif //IRLIBSENDBASE_H |
|---|
| 32 | |
|---|
| 33 | #ifdef IRLIBDECODEBASE_H |
|---|
| 34 | class IRdecodePanasonic_Old: public virtual IRdecodeBase { |
|---|
| 35 | public: |
|---|
| 36 | virtual bool decode(void) { |
|---|
| 37 | IRLIB_ATTEMPT_MESSAGE(F("Panasonic_Old")); |
|---|
| 38 | if(!decodeGeneric(48,833*4,833*4,833,833*3,833)) return false; |
|---|
| 39 | // The protocol spec says that the first 11 bits described the device and function. |
|---|
| 40 | // The next 11 bits are the same thing only it is the logical Bitwise complement. |
|---|
| 41 | // Many protocols have such check features in their definition but our code typically |
|---|
| 42 | // doesn't perform these checks. For example NEC's least significant 8 bits are the |
|---|
| 43 | // complement of the next more significant 8 bits. While it's probably not necessary |
|---|
| 44 | // to error check this, you can un-comment the next 4 lines of code to do this extra |
|---|
| 45 | // checking. |
|---|
| 46 | // long S1= (value & 0x0007ff); // 00 0000 0000 0111 1111 1111 |
|---|
| 47 | // long S2= (value & 0x3ff800)>> 11; // 11 1111 1111 1000 0000 0000 |
|---|
| 48 | // S2= (~S2) & 0x0007ff; |
|---|
| 49 | // if (S1!=S2) return IRLIB_REJECTION_MESSAGE(F("inverted bit redundancy")); |
|---|
| 50 | protocolNum = PANASONIC_OLD; |
|---|
| 51 | return true; |
|---|
| 52 | }; |
|---|
| 53 | }; |
|---|
| 54 | #endif //IRLIBDECODEBASE_H |
|---|
| 55 | |
|---|
| 56 | #define IRLIB_HAVE_COMBO |
|---|
| 57 | |
|---|
| 58 | #endif //IRLIB_PROTOCOL_05_H |
|---|