311 enableTransmit(device->gpiopin); |
310 enableTransmit(device->gpiopin); |
312 rc = toggleSwitch(buf); |
311 rc = toggleSwitch(buf); |
313 disableTransmit(); |
312 disableTransmit(); |
314 piLock(LOCK_DEVICES); |
313 piLock(LOCK_DEVICES); |
315 syslog(LOG_NOTICE, "RC433 command %s rc=%d", buf, rc); |
314 syslog(LOG_NOTICE, "RC433 command %s rc=%d", buf, rc); |
316 if (debug) |
|
317 fprintf(stdout, "RC433 command %s rc=%d\n", buf, rc); |
|
318 device->value = value; |
315 device->value = value; |
319 device->timestamp = time(NULL); |
316 device->timestamp = time(NULL); |
320 piUnlock(LOCK_DEVICES); |
317 piUnlock(LOCK_DEVICES); |
321 return rc; |
318 return rc; |
322 } |
319 } |
361 if ((device->type == DEVTYPE_SIM) && (device->direction == DEVDIR_OUT_BIN) && (device->present == DEVPRESENT_YES)) { |
358 if ((device->type == DEVTYPE_SIM) && (device->direction == DEVDIR_OUT_BIN) && (device->present == DEVPRESENT_YES)) { |
362 if ((strcmp((char *)"SimCooler", device->address) == 0) || (strcmp((char *)"SimHeater", device->address) == 0) || |
359 if ((strcmp((char *)"SimCooler", device->address) == 0) || (strcmp((char *)"SimHeater", device->address) == 0) || |
363 (strcmp((char *)"SimFan" , device->address) == 0) || (strcmp((char *)"SimLight" , device->address) == 0)) { |
360 (strcmp((char *)"SimFan" , device->address) == 0) || (strcmp((char *)"SimLight" , device->address) == 0)) { |
364 if (value != device->value) { |
361 if (value != device->value) { |
365 syslog(LOG_NOTICE, "SIM %s value=%d", device->address, value); |
362 syslog(LOG_NOTICE, "SIM %s value=%d", device->address, value); |
366 if (debug) |
|
367 fprintf(stdout, "SIM %s value=%d\n", device->address, value); |
|
368 } |
363 } |
369 device->value = value; |
364 device->value = value; |
370 device->timestamp = time(NULL); |
365 device->timestamp = time(NULL); |
371 if (strcmp((char *)"SimCooler", device->address) == 0) |
366 if (strcmp((char *)"SimCooler", device->address) == 0) |
372 SIMcooling = value; |
367 SIMcooling = value; |