The mesh settings.c module is a giant piece of code responsible for storing the mesh stack configuration. Such approach makes it difficult to control the data to be stored, breaks the stack modules' encapsulation by forcing them to reveal the internal kitchen, which leads to unpleasant issues such as #19799. This commit moves the responsibility of storing the configuration to corresponding modules while keeping control of the moment of storing the configuration and of starting the stack after the settingss loading is completed. This doesn't introduce any abstraction between the mesh settings.c and other modules as it will add more complexity and overhead than necessary for the actual task. Fixes #19850 Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
28 lines
614 B
C
28 lines
614 B
C
/* Bluetooth Mesh */
|
|
|
|
/*
|
|
* Copyright (c) 2017 Intel Corporation
|
|
* Copyright (c) 2020 Lingao Meng
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
struct bt_mesh_rpl {
|
|
uint16_t src;
|
|
bool old_iv;
|
|
#if defined(CONFIG_BT_SETTINGS)
|
|
bool store;
|
|
#endif
|
|
uint32_t seq;
|
|
};
|
|
|
|
typedef void (*bt_mesh_rpl_func_t)(struct bt_mesh_rpl *rpl,
|
|
void *user_data);
|
|
|
|
void bt_mesh_rpl_reset(void);
|
|
bool bt_mesh_rpl_check(struct bt_mesh_net_rx *rx,
|
|
struct bt_mesh_rpl **match);
|
|
void bt_mesh_rpl_clear(void);
|
|
void bt_mesh_rpl_update(struct bt_mesh_rpl *rpl,
|
|
struct bt_mesh_net_rx *rx);
|
|
void bt_mesh_rpl_pending_store(void);
|