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
pollin 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
chargerdevice nodes and add the device nodes to the monitoring list. - Healthd monitors the
POLLINevent of thechargerdevice node throughpoll. If an event occurs, it will read the correspondingmaskvalue and call theioctlinterface throughmaskto 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:
-
chargerdevice node: mainly monitors changes in battery charging, charging status, charging voltage, charging current, battery temperature, etc. -
gaugedevice node: mainly monitors changes in battery charging, battery power, battery temperature, etc. -
chargerdevice node: mainly monitors changes in battery charging, charging status, charging voltage, charging current, battery temperature, etc. -
gaugedevice node: mainly monitors changes in battery presence, battery power, battery temperature, etc.
Path: frameworks/system/healthd

