thermferm/devices.c

changeset 711
844588d0df65
parent 693
3518c07737d8
child 713
ea24b4ce02b1
equal deleted inserted replaced
710:abe60578d695 711:844588d0df65
299 299
300 } 300 }
301 #endif 301 #endif
302 if ((device->type == DEVTYPE_W1) && (device->direction == DEVDIR_OUT_BIN) && (device->present == DEVPRESENT_YES)) { 302 if ((device->type == DEVTYPE_W1) && (device->direction == DEVDIR_OUT_BIN) && (device->present == DEVPRESENT_YES)) {
303 if (strncmp(device->address, (char *)"3a", 2) == 0) { 303 if (strncmp(device->address, (char *)"3a", 2) == 0) {
304 syslog(LOG_NOTICE, "DS2413 PIO%c value=%d (%s)", (device->subdevice == 0) ? 'A' : 'B', (value == 0) ? 0 : 1, device->comment); 304 // syslog(LOG_NOTICE, "DS2413 PIO%c value=%d (%s)", (device->subdevice == 0) ? 'A' : 'B', (value == 0) ? 0 : 1, device->comment);
305 // pthread_mutex_lock(&mutexes[LOCK_DEVICES]); 305 // pthread_mutex_lock(&mutexes[LOCK_DEVICES]);
306 if (device->value != (value == 0) ? 0 : 1) { 306 if (device->value != (value == 0) ? 0 : 1) {
307 syslog(LOG_NOTICE, "DS2413 PIO%c value=%d (%s)", (device->subdevice == 0) ? 'A' : 'B', (value == 0) ? 0 : 1, device->comment);
307 device->value = (value == 0) ? 0 : 1; 308 device->value = (value == 0) ? 0 : 1;
308 device->timestamp = time(NULL); 309 device->timestamp = time(NULL);
309 devices_ws(); 310 devices_ws();
310 } 311 }
311 // pthread_mutex_unlock(&mutexes[LOCK_DEVICES]); 312 // pthread_mutex_unlock(&mutexes[LOCK_DEVICES]);
437 comma = true; 438 comma = true;
438 free(payloadu); 439 free(payloadu);
439 payloadu = NULL; 440 payloadu = NULL;
440 } 441 }
441 payload = xstrcat(payload, (char *)"]}"); 442 payload = xstrcat(payload, (char *)"]}");
442 syslog(LOG_NOTICE, "%s", payload);
443 ws_broadcast(payload); 443 ws_broadcast(payload);
444 free(payload); 444 free(payload);
445 payload = NULL; 445 payload = NULL;
446 } 446 }
447 447

mercurial