MCPcopy Create free account
hub / github.com/DanielOgorchock/ST_Anything / getCodeWordA

Method getCodeWordA

Arduino/libraries/RCSwitch/RCSwitch.cpp:278–310  ·  view source on GitHub ↗

* Returns a char[13], representing the Code Word to be send. * * getCodeWordA(char*, char*) * */

Source from the content-addressed store, hash-verified

276 *
277 */
278char* 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)

Callers 2

switchOnMethod · 0.95
switchOffMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected