MCPcopy Create free account
hub / github.com/SmingHub/Sming / getCodeWordA

Method getCodeWordA

Sming/Libraries/RCSwitch/RCSwitch.cpp:316–340  ·  view source on GitHub ↗

* Returns a char[13], representing the code word to be send. * */

Source from the content-addressed store, hash-verified

314 *
315 */
316char* RCSwitch::getCodeWordA(const char* sGroup, const char* sDevice, boolean bOn) {
317 static char sDipSwitches[13];
318 int i = 0;
319 int j = 0;
320
321 for (i = 0; i < 5; i++) {
322 sDipSwitches[j++] = (sGroup[i] == '0') ? 'F' : '0';
323 }
324
325 for (i = 0; i < 5; i++) {
326 sDipSwitches[j++] = (sDevice[i] == '0') ? 'F' : '0';
327 }
328
329 if (bOn) {
330 sDipSwitches[j++] = '0';
331 sDipSwitches[j++] = 'F';
332 } else {
333 sDipSwitches[j++] = 'F';
334 sDipSwitches[j++] = '0';
335 }
336
337 sDipSwitches[j] = '\0';
338
339 return sDipSwitches;
340}
341
342/**
343 * Like getCodeWord (Type C = Intertechno)

Callers 2

switchOnMethod · 0.95
switchOffMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected