*\r
* Copyright (c) 2009-2010 Frank Meyer - frank(at)fli4l.de\r
*\r
- * $Id: irmp.c,v 1.88 2011/02/08 08:40:27 fm Exp $\r
+ * $Id: irmp.c,v 1.90 2011/02/21 11:49:37 fm Exp $\r
*\r
* ATMEGA88 @ 8 MHz\r
*\r
*\r
*---------------------------------------------------------------------------------------------------------------------------------------------------\r
*\r
- * SIEMENS:\r
- * --------\r
+ * SIEMENS or RUWIDO:\r
+ * ------------------\r
*\r
* SIEMENS frame: 1 start bit + 22 data bits + no stop bit\r
* SIEMENS data: 13 address bits + 1 repeat bit + 7 data bits + 1 unknown bit\r
#define IRMP_SUPPORT_GRUNDIG_OR_NOKIA_PROTOCOL 0\r
#endif\r
\r
-#if IRMP_SUPPORT_RC5_PROTOCOL == 1 || IRMP_SUPPORT_RC6_PROTOCOL == 1 || IRMP_SUPPORT_GRUNDIG_OR_NOKIA_PROTOCOL == 1 || IRMP_SUPPORT_SIEMENS_PROTOCOL == 1 \r
+#if IRMP_SUPPORT_SIEMENS_PROTOCOL == 1 || IRMP_SUPPORT_RUWIDO_PROTOCOL == 1\r
+#define IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL 1\r
+#else\r
+#define IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL 0\r
+#endif\r
+\r
+#if IRMP_SUPPORT_RC5_PROTOCOL == 1 || \\r
+ IRMP_SUPPORT_RC6_PROTOCOL == 1 || \\r
+ IRMP_SUPPORT_GRUNDIG_OR_NOKIA_PROTOCOL == 1 || \\r
+ IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1\r
#define IRMP_SUPPORT_MANCHESTER 1\r
#else\r
#define IRMP_SUPPORT_MANCHESTER 0\r
#define DENON_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * DENON_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
#define DENON_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * DENON_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
#define DENON_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * DENON_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
-#define DENON_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * DENON_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
+#if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1\r
+#define DENON_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * DENON_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5)) // no -1, avoid conflict with RUWIDO\r
+#else\r
+#define DENON_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * DENON_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1) // be more tolerant\r
+#endif\r
#define DENON_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * DENON_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
\r
#define RC6_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RC6_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
#define GRUNDIG_OR_NOKIA_PRE_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * GRUNDIG_OR_NOKIA_PRE_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) + 1)\r
#define GRUNDIG_OR_NOKIA_PRE_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * GRUNDIG_OR_NOKIA_PRE_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r
\r
-#define SIEMENS_START_BIT_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIEMENS_BIT_TIME * 1 + 0.5) - 1)\r
-#define SIEMENS_START_BIT_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIEMENS_BIT_TIME * 1 + 0.5) + 1)\r
-#define SIEMENS_BIT_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIEMENS_BIT_TIME * 1 + 0.5) - 1)\r
-#define SIEMENS_BIT_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIEMENS_BIT_TIME * 1 + 0.5) + 1)\r
-#define SIEMENS_BIT_LEN_MIN_2 ((uint8_t)(F_INTERRUPTS * 2 * SIEMENS_BIT_TIME * 1 + 0.5) - 1)\r
-#define SIEMENS_BIT_LEN_MAX_2 ((uint8_t)(F_INTERRUPTS * 2 * SIEMENS_BIT_TIME * 1 + 0.5) + 1)\r
+#define SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
+#define SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
+#define SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
+#define SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
+#define SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN_2 ((uint8_t)(F_INTERRUPTS * 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
+#define SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX_2 ((uint8_t)(F_INTERRUPTS * 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
+#define SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN_2 ((uint8_t)(F_INTERRUPTS * 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
+#define SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX_2 ((uint8_t)(F_INTERRUPTS * 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
+#define SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
+#define SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
+#define SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
+#define SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
+#define SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN_2 ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PULSE_TIME_2 * MIN_TOLERANCE_10 + 0.5) - 1)\r
+#define SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX_2 ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PULSE_TIME_2 * MAX_TOLERANCE_10 + 0.5) + 1)\r
+#define SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN_2 ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PAUSE_TIME_2 * MIN_TOLERANCE_10 + 0.5) - 1)\r
+#define SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX_2 ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PAUSE_TIME_2 * MAX_TOLERANCE_10 + 0.5) + 1)\r
\r
#define FDC_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * FDC_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
#define FDC_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * FDC_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
#define NIKON_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NIKON_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r
#define NIKON_FRAME_REPEAT_PAUSE_LEN_MAX (uint16_t)(F_INTERRUPTS * NIKON_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)\r
\r
-#define RUWIDO_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RUWIDO_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r
-#define RUWIDO_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RUWIDO_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r
-#define RUWIDO_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RUWIDO_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r
-#define RUWIDO_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RUWIDO_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r
-#define RUWIDO_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RUWIDO_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
-#define RUWIDO_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RUWIDO_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
-#define RUWIDO_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RUWIDO_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r
-#define RUWIDO_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RUWIDO_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r
-#define RUWIDO_BIT_PULSE_LEN_MIN_2 ((uint8_t)(F_INTERRUPTS * RUWIDO_BIT_PULSE_TIME_2 * MIN_TOLERANCE_10 + 0.5) - 1)\r
-#define RUWIDO_BIT_PULSE_LEN_MAX_2 ((uint8_t)(F_INTERRUPTS * RUWIDO_BIT_PULSE_TIME_2 * MAX_TOLERANCE_10 + 0.5) + 1)\r
-#define RUWIDO_BIT_PAUSE_LEN_MIN_2 ((uint8_t)(F_INTERRUPTS * RUWIDO_BIT_PAUSE_TIME_2 * MIN_TOLERANCE_10 + 0.5) - 1)\r
-#define RUWIDO_BIT_PAUSE_LEN_MAX_2 ((uint8_t)(F_INTERRUPTS * RUWIDO_BIT_PAUSE_TIME_2 * MAX_TOLERANCE_10 + 0.5) + 1)\r
-\r
#define AUTO_FRAME_REPETITION_LEN (uint16_t)(F_INTERRUPTS * AUTO_FRAME_REPETITION_TIME + 0.5) // use uint16_t!\r
\r
#ifdef ANALYZE\r
\r
#endif\r
\r
-#if IRMP_SUPPORT_SIEMENS_PROTOCOL == 1\r
+#if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1\r
\r
-static PROGMEM IRMP_PARAMETER siemens_param =\r
+static PROGMEM IRMP_PARAMETER ruwido_param =\r
{\r
- IRMP_SIEMENS_PROTOCOL, // protocol: ir protocol\r
- SIEMENS_BIT_LEN_MIN, // pulse_1_len_min: here: minimum length of short pulse\r
- SIEMENS_BIT_LEN_MAX, // pulse_1_len_max: here: maximum length of short pulse\r
- SIEMENS_BIT_LEN_MIN, // pause_1_len_min: here: minimum length of short pause\r
- SIEMENS_BIT_LEN_MAX, // pause_1_len_max: here: maximum length of short pause\r
- SIEMENS_BIT_LEN_MIN_2, // pulse_0_len_min: here: minimum length of long pulse\r
- SIEMENS_BIT_LEN_MAX_2, // pulse_0_len_max: here: maximum length of long pulse\r
- SIEMENS_BIT_LEN_MIN_2, // pause_0_len_min: here: minimum length of long pause\r
- SIEMENS_BIT_LEN_MAX_2, // pause_0_len_max: here: maximum length of long pause\r
- SIEMENS_ADDRESS_OFFSET, // address_offset: address offset\r
- SIEMENS_ADDRESS_OFFSET + SIEMENS_ADDRESS_LEN, // address_end: end of address\r
- SIEMENS_COMMAND_OFFSET, // command_offset: command offset\r
- SIEMENS_COMMAND_OFFSET + SIEMENS_COMMAND_LEN, // command_end: end of command\r
- SIEMENS_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r
- SIEMENS_STOP_BIT, // stop_bit: flag: frame has stop bit\r
- SIEMENS_LSB, // lsb_first: flag: LSB first\r
- SIEMENS_FLAGS // flags: some flags\r
+ IRMP_RUWIDO_PROTOCOL, // protocol: ir protocol\r
+ SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN, // pulse_1_len_min: here: minimum length of short pulse\r
+ SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX, // pulse_1_len_max: here: maximum length of short pulse\r
+ SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN, // pause_1_len_min: here: minimum length of short pause\r
+ SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX, // pause_1_len_max: here: maximum length of short pause\r
+ SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN_2, // pulse_0_len_min: here: minimum length of long pulse\r
+ SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX_2, // pulse_0_len_max: here: maximum length of long pulse\r
+ SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN_2, // pause_0_len_min: here: minimum length of long pause\r
+ SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX_2, // pause_0_len_max: here: maximum length of long pause\r
+ RUWIDO_ADDRESS_OFFSET, // address_offset: address offset\r
+ RUWIDO_ADDRESS_OFFSET + RUWIDO_ADDRESS_LEN, // address_end: end of address\r
+ RUWIDO_COMMAND_OFFSET, // command_offset: command offset\r
+ RUWIDO_COMMAND_OFFSET + RUWIDO_COMMAND_LEN, // command_end: end of command\r
+ SIEMENS_COMPLETE_DATA_LEN, // complete_len: complete length of frame, here: SIEMENS instead of RUWIDO!\r
+ SIEMENS_OR_RUWIDO_STOP_BIT, // stop_bit: flag: frame has stop bit\r
+ SIEMENS_OR_RUWIDO_LSB, // lsb_first: flag: LSB first\r
+ SIEMENS_OR_RUWIDO_FLAGS // flags: some flags\r
};\r
\r
#endif\r
\r
#endif\r
\r
-#if IRMP_SUPPORT_RUWIDO_PROTOCOL == 1\r
-\r
-static PROGMEM IRMP_PARAMETER ruwido_param =\r
-{\r
- IRMP_RUWIDO_PROTOCOL, // protocol: ir protocol\r
- RUWIDO_BIT_PULSE_LEN_MIN, // pulse_1_len_min: here: minimum length of short pulse\r
- RUWIDO_BIT_PULSE_LEN_MAX, // pulse_1_len_max: here: maximum length of short pulse\r
- RUWIDO_BIT_PAUSE_LEN_MIN, // pause_1_len_min: here: minimum length of short pause\r
- RUWIDO_BIT_PAUSE_LEN_MAX, // pause_1_len_max: here: maximum length of short pause\r
- RUWIDO_BIT_PULSE_LEN_MIN_2, // pulse_0_len_min: here: minimum length of long pulse\r
- RUWIDO_BIT_PULSE_LEN_MAX_2, // pulse_0_len_max: here: maximum length of long pulse\r
- RUWIDO_BIT_PAUSE_LEN_MIN_2, // pause_0_len_min: here: minimum length of long pause\r
- RUWIDO_BIT_PAUSE_LEN_MAX_2, // pause_0_len_max: here: maximum length of long pause\r
- RUWIDO_ADDRESS_OFFSET, // address_offset: address offset\r
- RUWIDO_ADDRESS_OFFSET + RUWIDO_ADDRESS_LEN, // address_end: end of address\r
- RUWIDO_COMMAND_OFFSET, // command_offset: command offset\r
- RUWIDO_COMMAND_OFFSET + RUWIDO_COMMAND_LEN, // command_end: end of command\r
- RUWIDO_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r
- RUWIDO_STOP_BIT, // stop_bit: flag: frame has stop bit\r
- RUWIDO_LSB, // lsb_first: flag: LSB first\r
- RUWIDO_FLAGS // flags: some flags\r
-};\r
-\r
-#endif\r
-\r
static uint8_t irmp_bit; // current bit position\r
static IRMP_PARAMETER irmp_param;\r
\r
}\r
break;\r
#endif\r
-#if IRMP_SUPPORT_SIEMENS_PROTOCOL == 1\r
+#if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1\r
case IRMP_SIEMENS_PROTOCOL:\r
+ case IRMP_RUWIDO_PROTOCOL:\r
if (((irmp_command >> 1) & 0x0001) == (~irmp_command & 0x0001))\r
{\r
irmp_command >>= 1;\r
}\r
else\r
#endif // IRMP_SUPPORT_FDC_PROTOCOL == 1\r
+\r
#if IRMP_SUPPORT_RCCAR_PROTOCOL == 1\r
if (irmp_pulse_time >= RCCAR_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= RCCAR_START_BIT_PULSE_LEN_MAX &&\r
irmp_pause_time >= RCCAR_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= RCCAR_START_BIT_PAUSE_LEN_MAX)\r
else\r
#endif // IRMP_SUPPORT_GRUNDIG_OR_NOKIA_PROTOCOL == 1\r
\r
-#if IRMP_SUPPORT_SIEMENS_PROTOCOL == 1\r
- if (((irmp_pulse_time >= SIEMENS_START_BIT_LEN_MIN && irmp_pulse_time <= SIEMENS_START_BIT_LEN_MAX) ||\r
- (irmp_pulse_time >= 2 * SIEMENS_START_BIT_LEN_MIN && irmp_pulse_time <= 2 * SIEMENS_START_BIT_LEN_MAX)) &&\r
- ((irmp_pause_time >= SIEMENS_START_BIT_LEN_MIN && irmp_pause_time <= SIEMENS_START_BIT_LEN_MAX) ||\r
- (irmp_pause_time >= 2 * SIEMENS_START_BIT_LEN_MIN && irmp_pause_time <= 2 * SIEMENS_START_BIT_LEN_MAX)))\r
- { // it's SIEMENS\r
- ANALYZE_PRINTF ("protocol = SIEMENS, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
- SIEMENS_START_BIT_LEN_MIN, SIEMENS_START_BIT_LEN_MAX,\r
- SIEMENS_START_BIT_LEN_MIN, SIEMENS_START_BIT_LEN_MAX);\r
- irmp_param_p = (IRMP_PARAMETER *) &siemens_param;\r
+#if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1\r
+ if (((irmp_pulse_time >= SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX) ||\r
+ (irmp_pulse_time >= SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN_2 && irmp_pulse_time <= SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX_2)) &&\r
+ ((irmp_pause_time >= SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX) ||\r
+ (irmp_pause_time >= SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN_2 && irmp_pause_time <= SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX_2)))\r
+ { // it's RUWIDO or SIEMENS\r
+ ANALYZE_PRINTF ("protocol = RUWIDO, start bit timings: pulse: %3d - %3d or %3d - %3d, pause: %3d - %3d or %3d - %3d\n",\r
+ SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN, SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX,\r
+ SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN_2, SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX_2,\r
+ SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN, SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX,\r
+ SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN_2, SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX_2);\r
+ irmp_param_p = (IRMP_PARAMETER *) &ruwido_param;\r
last_pause = irmp_pause_time;\r
last_value = 1;\r
}\r
else\r
-#endif // IRMP_SUPPORT_SIEMENS_PROTOCOL == 1\r
+#endif // IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1\r
+\r
#if IRMP_SUPPORT_FDC_PROTOCOL == 1\r
if (irmp_pulse_time >= FDC_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= FDC_START_BIT_PULSE_LEN_MAX &&\r
irmp_pause_time >= FDC_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= FDC_START_BIT_PAUSE_LEN_MAX)\r
}\r
else\r
#endif // IRMP_SUPPORT_FDC_PROTOCOL == 1\r
+\r
#if IRMP_SUPPORT_RCCAR_PROTOCOL == 1\r
if (irmp_pulse_time >= RCCAR_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= RCCAR_START_BIT_PULSE_LEN_MAX &&\r
irmp_pause_time >= RCCAR_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= RCCAR_START_BIT_PAUSE_LEN_MAX)\r
irmp_param_p = (IRMP_PARAMETER *) &rccar_param;\r
}\r
else\r
-#endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1\r
-#if IRMP_SUPPORT_RUWIDO_PROTOCOL == 1\r
- if ((irmp_pulse_time >= RUWIDO_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= RUWIDO_START_BIT_PULSE_LEN_MAX) &&\r
- (irmp_pause_time >= RUWIDO_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= RUWIDO_START_BIT_PAUSE_LEN_MAX))\r
- { // it's RUWIDO\r
- {\r
- ANALYZE_PRINTF ("protocol = RUWIDO, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r
- RUWIDO_START_BIT_PULSE_LEN_MIN, RUWIDO_START_BIT_PULSE_LEN_MAX,\r
- RUWIDO_START_BIT_PAUSE_LEN_MIN, RUWIDO_START_BIT_PAUSE_LEN_MAX);\r
- }\r
-\r
- irmp_param_p = (IRMP_PARAMETER *) &ruwido_param;\r
- last_pause = irmp_pause_time;\r
-\r
- last_value = 1;\r
- }\r
- else\r
#endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1\r
{\r
ANALYZE_PRINTF ("protocol = UNKNOWN\n");\r
else\r
{\r
ANALYZE_PRINTF ("pulse: %3d - %3d or %3d - %3d\n", irmp_param.pulse_1_len_min, irmp_param.pulse_1_len_max,\r
- irmp_param.pulse_0_len_max + 1, irmp_param.pulse_0_len_max);\r
+ irmp_param.pulse_0_len_min, irmp_param.pulse_0_len_max);\r
ANALYZE_PRINTF ("pause: %3d - %3d or %3d - %3d\n", irmp_param.pause_1_len_min, irmp_param.pause_1_len_max,\r
- irmp_param.pause_0_len_max + 1, 2 * irmp_param.pause_0_len_max);\r
+ irmp_param.pause_0_len_min, irmp_param.pause_0_len_max);\r
}\r
\r
#if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)\r
irmp_bit = 0;\r
\r
#if IRMP_SUPPORT_MANCHESTER == 1\r
- if ((irmp_param.flags & IRMP_PARAM_FLAG_IS_MANCHESTER) && irmp_param.protocol != IRMP_RC6_PROTOCOL) // Manchester, but not RC6\r
+ if ((irmp_param.flags & IRMP_PARAM_FLAG_IS_MANCHESTER) &&\r
+ irmp_param.protocol != IRMP_RUWIDO_PROTOCOL && // Manchester, but not RUWIDO\r
+ irmp_param.protocol != IRMP_RC6_PROTOCOL) // Manchester, but not RC6\r
{\r
- if (irmp_pause_time > irmp_param.pulse_1_len_max && irmp_pause_time <= irmp_param.pulse_0_len_max)\r
+ if (irmp_pause_time > irmp_param.pulse_1_len_max && irmp_pause_time <= irmp_param.pulse_0_len_max) // XXXXXXXX!!!\r
{\r
ANALYZE_PRINTF ("%8d [bit %2d: pulse = %3d, pause = %3d] ", time_counter, irmp_bit, irmp_pulse_time, irmp_pause_time);\r
ANALYZE_PUTCHAR ((irmp_param.flags & IRMP_PARAM_FLAG_1ST_PULSE_IS_1) ? '0' : '1');\r
}\r
else\r
#endif\r
+#if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1\r
+ if (irmp_param.protocol == IRMP_RUWIDO_PROTOCOL && !irmp_param.stop_bit)\r
+ {\r
+ if (irmp_pause_time > irmp_param.pause_0_len_max && irmp_bit >= RUWIDO_COMPLETE_DATA_LEN - 2)\r
+ { // special manchester decoder\r
+ irmp_param.complete_len = RUWIDO_COMPLETE_DATA_LEN; // correct complete len\r
+ got_light = TRUE; // this is a lie, but generates a stop bit ;-)\r
+ irmp_param.stop_bit = TRUE; // set flag\r
+ }\r
+ else if (irmp_bit >= RUWIDO_COMPLETE_DATA_LEN)\r
+ {\r
+ ANALYZE_PRINTF ("Switching to SIEMENS protocol\n");\r
+ irmp_param.protocol = IRMP_SIEMENS_PROTOCOL; // change protocol\r
+ irmp_param.address_offset = SIEMENS_ADDRESS_OFFSET;\r
+ irmp_param.address_end = SIEMENS_ADDRESS_OFFSET + SIEMENS_ADDRESS_LEN;\r
+ irmp_param.command_offset = SIEMENS_COMMAND_OFFSET;\r
+ irmp_param.command_end = SIEMENS_COMMAND_OFFSET + SIEMENS_COMMAND_LEN;\r
+\r
+ // 76543210\r
+ // RUWIDO: AAAAAAAAACCCCCCCp\r
+ // SIEMENS: AAAAAAAAAAACCCCCCCCCCp\r
+ irmp_tmp_address <<= 2;\r
+ irmp_tmp_address |= (irmp_tmp_command >> 6);\r
+ irmp_tmp_command &= 0x003F;\r
+ irmp_tmp_command <<= 4;\r
+ irmp_tmp_command |= last_value;\r
+ }\r
+ }\r
+ else\r
+#endif\r
#if IRMP_SUPPORT_MANCHESTER == 1\r
if ((irmp_param.flags & IRMP_PARAM_FLAG_IS_MANCHESTER) &&\r
irmp_pause_time > irmp_param.pause_0_len_max && irmp_bit >= irmp_param.complete_len - 2 && !irmp_param.stop_bit)\r
GRUNDIG_OR_NOKIA_START_BIT_LEN_MIN, GRUNDIG_OR_NOKIA_START_BIT_LEN_MAX, GRUNDIG_OR_NOKIA_PRE_PAUSE_LEN_MIN, GRUNDIG_OR_NOKIA_PRE_PAUSE_LEN_MAX,\r
GRUNDIG_OR_NOKIA_BIT_LEN_MIN, GRUNDIG_OR_NOKIA_BIT_LEN_MAX);\r
\r
- printf ("SIEMENS 1 %3d - %3d %3d - %3d %3d - %3d\n",\r
- SIEMENS_START_BIT_LEN_MIN, SIEMENS_START_BIT_LEN_MAX, SIEMENS_START_BIT_LEN_MIN, SIEMENS_START_BIT_LEN_MAX,\r
- SIEMENS_BIT_LEN_MIN, SIEMENS_BIT_LEN_MAX);\r
+ printf ("SIEMENS/RUWIDO 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",\r
+ SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN, SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX,\r
+ SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN, SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX,\r
+ SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN, SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX,\r
+ SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN, SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX,\r
+ SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN_2, SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX_2,\r
+ SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN_2, SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX_2);\r
\r
printf ("FDC 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",\r
FDC_START_BIT_PULSE_LEN_MIN, FDC_START_BIT_PULSE_LEN_MAX, FDC_START_BIT_PAUSE_LEN_MIN, FDC_START_BIT_PAUSE_LEN_MAX,\r