The module implements the following states:
- STATE_WAITING_FOR_MODEM_INIT: The initial state, where the system waits for the modem library to complete initialization before proceeding.
-
STATE_RUNNING: Parent state entered after modem initialization. At this level, the module handles battery sampling requests regardless of the sub-state.
- STATE_ACTIVE: Default sub-state of
STATE_RUNNING, entered when the modem wakes up from sleep. In this state, the module samples the fuel gauge periodically, based on the timer controlled byCONFIG_APP_POWER_SAMPLE_INTERVAL_MS. - STATE_IDLE: Sub-state entered when the modem enters sleep. The module calls
nrf_fuel_gauge_idle_set()with the configured idle currentCONFIG_APP_POWER_IDLE_CURRENT_NA, so the fuel gauge can estimate consumption while sampling is paused.
- STATE_ACTIVE: Default sub-state of