nrfxlib API 3.3.99
Loading...
Searching...
No Matches

◆ state

const void* nrf_fuel_gauge_init_parameters::state

Optional state memory, previously retrieved using nrf_fuel_gauge_state_get. When used, the library resumes from this state. opt_params and initial measurements are ignored when state is provided. Set to NULL when not used or when initializing the library for the first time.

The state buffer is copied into library internal state memory, and the provided buffer can be freed or reused after initialization.

Note
If the battery model memory address has changed since the state was stored, the model or model_primary pointer will always take precedence when it is not NULL.
After a library version update, the state from the old version might not be compatible with the new version, and nrf_fuel_gauge_init will return -EBADF. In this case, call the function again without the state argument. Use nrf_fuel_gauge_state_compatible_check to validate compatibility.
If there is a significant difference between the measured battery voltage and the battery voltage in the stored state, state-of-charge converge will be slower than an initialization not using a stored state.