OpenSourceSimWheelESP32
Open-source wireless steering wheel/button box for ESP32 boards
Loading...
Searching...
No Matches
BatteryMonitorInterface Class Referenceabstract

Interface to hardware implementing a battery monitor. More...

#include <BatteryMonitorHardware.hpp>

Public Member Functions

virtual void getStatus (BatteryStatus &currentStatus)
 Get the battery status.
 
virtual void onStart ()
 Called once when the battery monitor daemon is started.
 

Protected Member Functions

virtual bool read_soc (uint8_t &soc)=0
 Retrieve the current state of charge.
 

Detailed Description

Interface to hardware implementing a battery monitor.

Definition at line 25 of file BatteryMonitorHardware.hpp.

Member Function Documentation

◆ getStatus()

virtual void BatteryMonitorInterface::getStatus ( BatteryStatus & currentStatus)
virtual

Get the battery status.

Note
May be called before onStart()
Parameters
[out]currentStatusCurrent battery status

Reimplemented in FakeBatteryMonitor.

◆ onStart()

virtual void BatteryMonitorInterface::onStart ( )
inlinevirtual

Called once when the battery monitor daemon is started.

Reimplemented in MAX1704x.

Definition at line 41 of file BatteryMonitorHardware.hpp.

◆ read_soc()

virtual bool BatteryMonitorInterface::read_soc ( uint8_t & soc)
protectedpure virtual

Retrieve the current state of charge.

Parameters
[out]socState of charge. Higher than 101 if the battery is charging at constant voltage.
Returns
true If soc was retrieved with success
false If there is no battery or soc is unknown

Implemented in FakeBatteryMonitor, MAX1704x, and VoltageDividerMonitor.


The documentation for this class was generated from the following file: