250 devices_list *device; |
250 devices_list *device; |
251 int tmp; |
251 int tmp; |
252 |
252 |
253 for (device = Config.devices; device; device = device->next) { |
253 for (device = Config.devices; device; device = device->next) { |
254 if (strcmp(address, device->uuid) == 0) { |
254 if (strcmp(address, device->uuid) == 0) { |
|
255 #ifdef HAVE_WIRINGPI_H |
|
256 piLock(LOCK_DEVICES); |
|
257 #endif |
255 tmp = device->value + device->offset; |
258 tmp = device->value + device->offset; |
|
259 #ifdef HAVE_WIRINGPI_H |
|
260 piUnlock(LOCK_DEVICES); |
|
261 #endif |
256 *val = tmp; |
262 *val = tmp; |
257 return device->present; |
263 return device->present; |
258 } |
264 } |
259 } |
265 } |
260 |
266 |