PebbleOS v4.47.0
Loading...
Searching...
No Matches
Simulator

Simulated battery, full and unplugged until pbl_battery_sim_set() changes it. More...

Functions

void pbl_battery_sim_set (uint8_t percent, bool charger_connected)
 Set the battery state.
 
uint8_t pbl_battery_sim_get_percent (void)
 Get the charge percentage last set.
 

Detailed Description

Simulated battery, full and unplugged until pbl_battery_sim_set() changes it.

Function Documentation

◆ pbl_battery_sim_get_percent()

uint8_t pbl_battery_sim_get_percent ( void  )

Get the charge percentage last set.

Lets the battery service skip the lossy voltage curve round trip.

Returns
Charge percentage, 0 to 100.

◆ pbl_battery_sim_set()

void pbl_battery_sim_set ( uint8_t  percent,
bool  charger_connected 
)

Set the battery state.

The voltage follows the battery curve. A charger change is reported to the connection handler.

Parameters
percentCharge percentage, capped at 100.
charger_connectedWhether the charger is connected.