Openvela healthd
publishes health detection modules such as battery charging status, charging voltage and current, and battery temperature through uORB. The Healthd module mainly senses the changes of mask
through all device nodes in the /dev/charge/
directory under the poll
system, obtains the changed parameters and publishes them through uORB.
For different battery chip drivers, the following requirements are required for the framework:
-
The device nodes registered by the battery chip need to be in the
/dev/charge/
directory. -
The battery chip driver must implement parameter change perception notification, and support the upper layer to access through
poll
in the process.
The system framework of Healthd is shown in the figure below:
It is mainly divided into 3 parts:
- Healthd will open all registered
charger
device nodes and add the device nodes to the monitoring list. - Healthd monitors the
POLLIN
event of thecharger
device node throughpoll
. If an event occurs, it will read the correspondingmask
value and call theioctl
interface throughmask
to obtain the value of the corresponding change parameter ofcharger
. - Healthd calls uORB's API orb_publish_auto to publish the topic information of the battery status.
The poll
framework of Healthd is shown in the figure below:
The battery chip mainly registers two types of device nodes:
-
charger
device node: mainly monitors changes in battery charging, charging status, charging voltage, charging current, battery temperature, etc. -
gauge
device node: mainly monitors changes in battery charging, battery power, battery temperature, etc. -
charger
device node: mainly monitors changes in battery charging, charging status, charging voltage, charging current, battery temperature, etc. -
gauge
device node: mainly monitors changes in battery presence, battery power, battery temperature, etc.
Path: frameworks/system/healthd