diff options
Diffstat (limited to 'libsensors/ProximitySensor.cpp')
-rw-r--r-- | libsensors/ProximitySensor.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/libsensors/ProximitySensor.cpp b/libsensors/ProximitySensor.cpp index 9e5d7d1..2ba56c1 100644 --- a/libsensors/ProximitySensor.cpp +++ b/libsensors/ProximitySensor.cpp @@ -73,8 +73,18 @@ int ProximitySensor::setInitialState() { int ProximitySensor::setDelay(int32_t handle, int64_t ns) { - // unsupported - return 0; + int fd; + + strcpy(&input_sysfs_path[input_sysfs_path_len], "prox_poll_delay"); + fd = open(input_sysfs_path, O_RDWR); + if (fd >= 0) { + char buf[80]; + sprintf(buf, "%lld", ns); + write(fd, buf, strlen(buf)+1); + close(fd); + return 0; + } + return -1; } int ProximitySensor::enable(int32_t handle, int en) { |