Rev 2013 | Rev 2119 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 2013 | Rev 2065 | ||
|---|---|---|---|
| Line 960... | Line 960... | ||
| 960 | 960 | ||
| 961 | #if (IR_PROTOCOLS_USE_NEXA2) |
961 | #if (IR_PROTOCOLS_USE_NEXA2) |
| 962 | /** |
962 | /** |
| 963 | * Test data on NEXA protocol |
963 | * Test data on NEXA protocol |
| 964 | * http://elektronikforumet.com/wiki/index.php?title=RF_Protokoll_-_Nexa_sj%C3%A4lvl%C3%A4rande |
964 | * http://elektronikforumet.com/wiki/index.php?title=RF_Protokoll_-_Nexa_sj%C3%A4lvl%C3%A4rande |
| - | 965 | * http://pastebin.com/PJX3bRAs |
|
| 965 | * |
966 | * |
| 966 | * @param buf |
967 | * @param buf |
| 967 | * Pointer to buffer to where to data to parse is stored |
968 | * Pointer to buffer to where to data to parse is stored |
| 968 | * @param len |
969 | * @param len |
| 969 | * Length of the data |
970 | * Length of the data |
| Line 1043... | Line 1044... | ||
| 1043 | /* No dimming */ |
1044 | /* No dimming */ |
| 1044 | *len = 131; |
1045 | *len = 131; |
| 1045 | uint8_t dimming = 0; |
1046 | uint8_t dimming = 0; |
| 1046 | 1047 | ||
| 1047 | /* If most significant bit is set, then dimming should be sent */ |
1048 | /* If most significant bit is set, then dimming should be sent */ |
| 1048 |
|
1049 | if (tempshift&(1ULL<<47)) |
| 1049 |
|
1050 | { |
| 1050 | /* Dimming */ |
1051 | /* Dimming */ |
| 1051 |
|
1052 | *len = 147; |
| 1052 |
|
1053 | dimming=1; |
| 1053 |
|
1054 | } |
| 1054 | 1055 | ||
| 1055 | for (uint8_t i = 2; i < |
1056 | for (uint8_t i = 2; i < *len; i+=4) |
| 1056 | { |
1057 | { |
| 1057 | buf[i] = IR_NEXA2_HIGH; |
1058 | buf[i] = IR_NEXA2_HIGH; |
| 1058 | buf[i+2] = IR_NEXA2_HIGH; |
1059 | buf[i+2] = IR_NEXA2_HIGH; |
| 1059 | if (tempshift&1) { |
1060 | if (tempshift&1) { |
| 1060 | buf[i+1] = IR_NEXA2_LOW_ONE; |
1061 | buf[i+1] = IR_NEXA2_LOW_ONE; |
| Line 1066... | Line 1067... | ||
| 1066 | tempshift = tempshift>>1; |
1067 | tempshift = tempshift>>1; |
| 1067 | } |
1068 | } |
| 1068 | 1069 | ||
| 1069 | if (dimming) |
1070 | if (dimming) |
| 1070 | { |
1071 | { |
| 1071 | //TODO: |
1072 | //TODO: verify below bit numbers |
| - | 1073 | buf[111] = IR_NEXA2_LOW_ONE; |
|
| 1072 |
|
1074 | buf[113] = IR_NEXA2_LOW_ONE; |
| 1073 | } |
1075 | } |
| 1074 | 1076 | ||
| 1075 | proto->modfreq=IR_NEXA2_F_MOD; |
1077 | proto->modfreq=IR_NEXA2_F_MOD; |
| 1076 | proto->timeout=IR_NEXA2_START1/1000; |
1078 | proto->timeout=IR_NEXA2_START1/1000; |
| 1077 | proto->repeats=IR_NEXA2_REPS; |
1079 | proto->repeats=IR_NEXA2_REPS; |