When the IV Update state enters Normal operation or IV Update in Progress, we need to keep track of how many hours has passed in the state, since the specification requires us to remain in the state at least for 96 hours (Update in Progress has an additional upper limit of 144 hours). In order to fulfil the above requirement, even if the node might be powered off once in a while, we need to store persistently how many hours the node has been in the state. This doesn't necessarily need to happen every hour (thanks to the flexible duration range). The exact cadence will depend a lot on the ways that the node will be used and what kind of power source it has. Since there is no single optimal answer, this patch adds a new configuration option, which allows specifying a divider, i.e. how many intervals the 96 hour minimum gets split into. After each interval the duration that the node has been in the current state gets stored to flash. E.g. the default value of 4 means that the state is saved every 24 hours (96 / 4). Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
25 lines
791 B
C
25 lines
791 B
C
/*
|
|
* Copyright (c) 2018 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
void bt_mesh_store_net(void);
|
|
void bt_mesh_store_iv(bool only_duration);
|
|
void bt_mesh_store_seq(void);
|
|
void bt_mesh_store_rpl(struct bt_mesh_rpl *rpl);
|
|
void bt_mesh_store_subnet(struct bt_mesh_subnet *sub);
|
|
void bt_mesh_store_app_key(struct bt_mesh_app_key *key);
|
|
void bt_mesh_store_hb_pub(void);
|
|
void bt_mesh_store_cfg(void);
|
|
void bt_mesh_store_mod_bind(struct bt_mesh_model *mod);
|
|
void bt_mesh_store_mod_sub(struct bt_mesh_model *mod);
|
|
void bt_mesh_store_mod_pub(struct bt_mesh_model *mod);
|
|
|
|
void bt_mesh_clear_net(void);
|
|
void bt_mesh_clear_subnet(struct bt_mesh_subnet *sub);
|
|
void bt_mesh_clear_app_key(struct bt_mesh_app_key *key);
|
|
void bt_mesh_clear_rpl(void);
|
|
|
|
void bt_mesh_settings_init(void);
|