* Returns a char[13], representing the Code Word to be send. * * getCodeWordA(char*, char*) * */
| 276 | * |
| 277 | */ |
| 278 | char* RCSwitch::getCodeWordA(char* sGroup, char* sDevice, boolean bOn) { |
| 279 | static char sDipSwitches[13]; |
| 280 | int i = 0; |
| 281 | int j = 0; |
| 282 | |
| 283 | for (i=0; i < 5; i++) { |
| 284 | if (sGroup[i] == '0') { |
| 285 | sDipSwitches[j++] = 'F'; |
| 286 | } else { |
| 287 | sDipSwitches[j++] = '0'; |
| 288 | } |
| 289 | } |
| 290 | |
| 291 | for (i=0; i < 5; i++) { |
| 292 | if (sDevice[i] == '0') { |
| 293 | sDipSwitches[j++] = 'F'; |
| 294 | } else { |
| 295 | sDipSwitches[j++] = '0'; |
| 296 | } |
| 297 | } |
| 298 | |
| 299 | if ( bOn ) { |
| 300 | sDipSwitches[j++] = '0'; |
| 301 | sDipSwitches[j++] = 'F'; |
| 302 | } else { |
| 303 | sDipSwitches[j++] = 'F'; |
| 304 | sDipSwitches[j++] = '0'; |
| 305 | } |
| 306 | |
| 307 | sDipSwitches[j] = '\0'; |
| 308 | |
| 309 | return sDipSwitches; |
| 310 | } |
| 311 | |
| 312 | /** |
| 313 | * Like getCodeWord (Type C = Intertechno) |