1/31/2023 6:07 PM | |
Joined: 4/28/2015 Last visit: 6/28/2024 Posts: 578 Rating: (43) |
Sorry for that later reply, seems we missed this. There is an IOCTL called RTC_VL_READ which can be used on /dev/rtc in order to read out the low-voltage status. The type of RTC used here only warns if the voltage is too low (RTC_VL_DATA_INVALID), it supports no other RTC_VL_* status bits. https://github.com/torvalds/linux/blob/master/include/uapi/linux/rtc.h Unfortunately, I have no idea if any standard userspace tool for RTCs check that IOCTL and already provide a higher abstraction. |
2/6/2023 8:58 AM | |
Joined: 8/24/2017 Last visit: 10/1/2024 Posts: 4 Rating: (0) |
Thanks for your feedback. I tried to use the IOCTL statement in a C application. I have oriented myself from examples on GitHub. When running the code, the RTC driver can be opened under /dev/rtc, but the ioctl function gives an error (return value = -1). This happens with both RTC_VL_DATA_INVALID and RTC_VL_READ. Did I do something wrong in the programming or is the functionality missing in the driver? Attached you find the source code of my application as well as terminal-screenshots of the instructions 'cat /proc/driver/rtc' and 'sudo dmesg | grep rtc'. Best regards Max AttachmentReadRTCBattery.zip (501 Downloads) |
2/9/2023 10:01 AM | |
Joined: 4/28/2015 Last visit: 6/28/2024 Posts: 578 Rating: (43) |
|
Follow us on