349 } |
355 } |
350 } |
356 } |
351 |
357 |
352 #ifdef USE_SIMULATOR |
358 #ifdef USE_SIMULATOR |
353 if ((device->type == DEVTYPE_SIM) && (device->direction == DEVDIR_OUT_BIN) && (device->present == DEVPRESENT_YES)) { |
359 if ((device->type == DEVTYPE_SIM) && (device->direction == DEVDIR_OUT_BIN) && (device->present == DEVPRESENT_YES)) { |
354 |
360 if ((strcmp((char *)"SimCooler", device->address) == 0) || (strcmp((char *)"SimHeater", device->address) == 0)) { |
|
361 if (value != device->value) { |
|
362 syslog(LOG_NOTICE, "SIM %s value=%d", device->address, value); |
|
363 if (debug) |
|
364 fprintf(stdout, "SIM %s value=%d\n", device->address, value); |
|
365 } |
|
366 device->value = value; |
|
367 device->timestamp = time(NULL); |
|
368 if (strcmp((char *)"SimCooler", device->address) == 0) |
|
369 SIMcooling = value; |
|
370 if (strcmp((char *)"SimHeater", device->address) == 0) |
|
371 SIMheating = value; |
|
372 } |
355 } |
373 } |
356 #endif |
374 #endif |
357 } else { |
375 } else { |
358 #ifdef HAVE_WIRINGPI_H |
376 #ifdef HAVE_WIRINGPI_H |
359 piUnlock(LOCK_DEVICES); |
377 piUnlock(LOCK_DEVICES); |