Bluetooth: Mesh: Add Proxy callback structure

Adds a Proxy callback structure with a callback for Node ID enable and
disable. This API follows the Friend and LPN API pattern in mesh/main.h,
and can be expanded with more callbacks later.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
This commit is contained in:
Trond Einar Snekvik 2021-03-15 09:37:03 +01:00 committed by Carles Cufí
commit 318d0928c1
3 changed files with 48 additions and 0 deletions

View file

@ -21,6 +21,38 @@
extern "C" {
#endif
/** Callbacks for the Proxy feature.
*
* Should be instantiated with @ref BT_MESH_PROXY_CB_DEFINE.
*/
struct bt_mesh_proxy_cb {
/** @brief Started sending Node Identity beacons on the given subnet.
*
* @param net_idx Network index the Node Identity beacons are running
* on.
*/
void (*identity_enabled)(uint16_t net_idx);
/** @brief Stopped sending Node Identity beacons on the given subnet.
*
* @param net_idx Network index the Node Identity beacons were running
* on.
*/
void (*identity_disabled)(uint16_t net_idx);
};
/** @def BT_MESH_PROXY_CB_DEFINE
*
* @brief Register a callback structure for Proxy events.
*
* Registers a structure with callback functions that gets called on various
* Proxy events.
*
* @param _name Name of callback structure.
*/
#define BT_MESH_PROXY_CB_DEFINE(_name) \
static const Z_STRUCT_SECTION_ITERABLE( \
bt_mesh_proxy_cb, _CONCAT(bt_mesh_proxy_cb, _name))
/** @brief Enable advertising with Node Identity.
*
* This API requires that GATT Proxy support has been enabled. Once called