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.
Battery chip driver
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.
Healthd system framework
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 the charger device node through poll. If an event occurs, it will read the corresponding mask value and call the ioctl interface through mask to obtain the value of the corresponding change parameter of charger.
Healthd calls uORB’s API orb_publish_auto to publish the topic information of the battery status.
Healthd monitoring framework
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.
Healthd module
Openvela healthdpublishes health detection modules such as battery charging status, charging voltage and current, and battery temperature through uORB. The Healthd module mainly senses the changes ofmaskthrough all device nodes in the/dev/charge/directory under thepollsystem, obtains the changed parameters and publishes them through uORB.Battery chip driver
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.Healthd system framework
The system framework of Healthd is shown in the figure below:
It is mainly divided into 3 parts:
chargerdevice nodes and add the device nodes to the monitoring list.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 monitoring framework
The
pollframework 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.Healthd code path
Path: frameworks/system/healthd