Daniel Eklöf
30332670aa
module/battery: convert asserts to real error checks
2018-12-25 12:25:24 +01:00
Daniel Eklöf
d81547066d
module/battery: log error message on failure during initialization
2018-12-19 21:12:42 +01:00
Daniel Eklöf
7e95862e12
module/battery: error handling during initialization
2018-12-19 20:54:36 +01:00
Daniel Eklöf
2c7362fefa
module/battery: no need to lock before we've signaled ready
2018-12-19 20:24:36 +01:00
Daniel Eklöf
3413232ed6
module: add new function module_signal_ready()
2018-12-19 20:23:53 +01:00
Daniel Eklöf
a3eb7ebc08
bar: wait for all modules to have started up before continuing
...
After starting all the module threads, wait for all modules to have
signalled "ready" before continuing.
This will allow modules to do initial setup, and knowing that
content() will *not* be called until they've signalled "ready".
2018-12-19 19:41:25 +01:00
Daniel Eklöf
7f0f096ba4
module: begin_expose() and content() take a non-const module pointer
2018-12-19 19:03:19 +01:00
Daniel Eklöf
16553a7216
module/battery: acquire lock when reading/writing state
2018-12-18 20:24:30 +01:00
Daniel Eklöf
d279b585db
module/battery: read all data into local variables first
...
This minimizes the time we'll have to hold the lock (once we lock).
2018-12-18 20:23:19 +01:00
Daniel Eklöf
f253bbebd2
module/battery: we're scanning into a signed long
2018-12-18 20:22:48 +01:00
Daniel Eklöf
76995ddcd5
module/battery: use module common constructor and default destructor
2018-12-18 20:22:30 +01:00
Daniel Eklöf
2fdd419600
module/battery: use log framework
2018-12-18 19:37:10 +01:00
Daniel Eklöf
e186c3447d
module/battery: remove unused left/right spacing options
2018-12-16 19:17:14 +01:00
Daniel Eklöf
8f7fba72a5
module/battery: remove inferior error checks
2018-12-16 17:09:33 +01:00
Daniel Eklöf
a9681dd19c
cleanup
2018-12-16 17:08:38 +01:00
Daniel Eklöf
fa3c17aa4a
module/battery: use libudev to monitor for battery changes
...
This allows us to detect plug/unplug events immediately, instead of
having to wait for the next poll event.
Unfortunately, capacity changes do not appear to generate events :(
2018-12-16 17:04:44 +01:00
Daniel Eklöf
6a0385e294
module/battery: monitors battery state and capacity
2018-12-16 15:58:17 +01:00