NimBLE-Arduino 2.1.2
Loading...
Searching...
No Matches
cfg.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 2020 Nordic Semiconductor
7 *
8 * SPDX-License-Identifier: Apache-2.0
9 */
10#ifndef _BT_MESH_CFG_H_
11#define _BT_MESH_CFG_H_
12
13#include <stdbool.h>
14#include <stddef.h>
15#include <sys/types.h>
16
24#ifdef __cplusplus
25extern "C" {
26#endif
27
37
38/* Key Refresh Phase */
39#define BT_MESH_KR_NORMAL 0x00
40#define BT_MESH_KR_PHASE_1 0x01
41#define BT_MESH_KR_PHASE_2 0x02
42#define BT_MESH_KR_PHASE_3 0x03
43
44/* Legacy feature defines */
45#define BT_MESH_RELAY_DISABLED BT_MESH_FEATURE_DISABLED
46#define BT_MESH_RELAY_ENABLED BT_MESH_FEATURE_ENABLED
47#define BT_MESH_RELAY_NOT_SUPPORTED BT_MESH_FEATURE_NOT_SUPPORTED
48
49#define BT_MESH_BEACON_DISABLED BT_MESH_FEATURE_DISABLED
50#define BT_MESH_BEACON_ENABLED BT_MESH_FEATURE_ENABLED
51
52#define BT_MESH_GATT_PROXY_DISABLED BT_MESH_FEATURE_DISABLED
53#define BT_MESH_GATT_PROXY_ENABLED BT_MESH_FEATURE_ENABLED
54#define BT_MESH_GATT_PROXY_NOT_SUPPORTED BT_MESH_FEATURE_NOT_SUPPORTED
55
56#define BT_MESH_FRIEND_DISABLED BT_MESH_FEATURE_DISABLED
57#define BT_MESH_FRIEND_ENABLED BT_MESH_FEATURE_ENABLED
58#define BT_MESH_FRIEND_NOT_SUPPORTED BT_MESH_FEATURE_NOT_SUPPORTED
59
60#define BT_MESH_NODE_IDENTITY_STOPPED BT_MESH_FEATURE_DISABLED
61#define BT_MESH_NODE_IDENTITY_RUNNING BT_MESH_FEATURE_ENABLED
62#define BT_MESH_NODE_IDENTITY_NOT_SUPPORTED BT_MESH_FEATURE_NOT_SUPPORTED
63
68void bt_mesh_beacon_set(bool beacon);
69
75
88int bt_mesh_default_ttl_set(uint8_t default_ttl);
89
95
106void bt_mesh_net_transmit_set(uint8_t xmit);
107
116
138int bt_mesh_relay_set(enum bt_mesh_feat_state relay, uint8_t xmit);
139
145
155
177
183
202
208
230uint8_t bt_mesh_subnet_add(uint16_t net_idx, const uint8_t key[16]);
231
251uint8_t bt_mesh_subnet_update(uint16_t net_idx, const uint8_t key[16]);
252
266uint8_t bt_mesh_subnet_del(uint16_t net_idx);
267
274bool bt_mesh_subnet_exists(uint16_t net_idx);
275
295uint8_t bt_mesh_subnet_kr_phase_set(uint16_t net_idx, uint8_t *phase);
296
305uint8_t bt_mesh_subnet_kr_phase_get(uint16_t net_idx, uint8_t *phase);
306
330uint8_t bt_mesh_subnet_node_id_set(uint16_t net_idx,
331 enum bt_mesh_feat_state node_id);
332
341uint8_t bt_mesh_subnet_node_id_get(uint16_t net_idx,
342 enum bt_mesh_feat_state *node_id);
343
365ssize_t bt_mesh_subnets_get(uint16_t net_idxs[], size_t max, off_t skip);
366
400uint8_t bt_mesh_app_key_add(uint16_t app_idx, uint16_t net_idx,
401 const uint8_t key[16]);
402
427uint8_t bt_mesh_app_key_update(uint16_t app_idx, uint16_t net_idx,
428 const uint8_t key[16]);
429
442uint8_t bt_mesh_app_key_del(uint16_t app_idx, uint16_t net_idx);
443
450bool bt_mesh_app_key_exists(uint16_t app_idx);
451
476ssize_t bt_mesh_app_keys_get(uint16_t net_idx, uint16_t app_idxs[], size_t max,
477 off_t skip);
478
483#ifdef __cplusplus
484}
485#endif
486
491#endif /* _BT_MESH_CFG_H_ */
uint8_t bt_mesh_app_key_add(uint16_t app_idx, uint16_t net_idx, const uint8_t key[16])
Add an Application key.
bool bt_mesh_app_key_exists(uint16_t app_idx)
Check if an Application key is known.
uint8_t bt_mesh_app_key_update(uint16_t app_idx, uint16_t net_idx, const uint8_t key[16])
Update an Application key.
uint8_t bt_mesh_app_key_del(uint16_t app_idx, uint16_t net_idx)
Delete an Application key.
ssize_t bt_mesh_app_keys_get(uint16_t net_idx, uint16_t app_idxs[], size_t max, off_t skip)
Get a list of all known Application key indexes.
ssize_t bt_mesh_subnets_get(uint16_t net_idxs[], size_t max, off_t skip)
Get a list of all known Subnet indexes.
uint8_t bt_mesh_subnet_update(uint16_t net_idx, const uint8_t key[16])
Update the given Subnet.
uint8_t bt_mesh_subnet_node_id_set(uint16_t net_idx, enum bt_mesh_feat_state node_id)
Set the Node Identity state of the Subnet.
uint8_t bt_mesh_subnet_node_id_get(uint16_t net_idx, enum bt_mesh_feat_state *node_id)
Get the Node Identity state of the Subnet.
uint8_t bt_mesh_subnet_add(uint16_t net_idx, const uint8_t key[16])
Add a Subnet.
uint8_t bt_mesh_subnet_kr_phase_get(uint16_t net_idx, uint8_t *phase)
Get the Subnet's Key Refresh phase.
bool bt_mesh_subnet_exists(uint16_t net_idx)
Check whether a Subnet is known.
uint8_t bt_mesh_subnet_del(uint16_t net_idx)
Delete a Subnet.
uint8_t bt_mesh_subnet_kr_phase_set(uint16_t net_idx, uint8_t *phase)
Set the Subnet's Key Refresh phase.
uint8_t bt_mesh_net_transmit_get(void)
Get the current Network Transmit parameters.
bt_mesh_feat_state
Definition cfg.h:29
void bt_mesh_beacon_set(bool beacon)
Enable or disable sending of the Secure Network Beacon.
bool bt_mesh_beacon_enabled(void)
Get the current Secure Network Beacon state.
int bt_mesh_friend_set(enum bt_mesh_feat_state friendship)
Enable or disable the Friend feature.
enum bt_mesh_feat_state bt_mesh_gatt_proxy_get(void)
Get the current GATT Proxy state.
void bt_mesh_net_transmit_set(uint8_t xmit)
Set the Network Transmit parameters.
uint8_t bt_mesh_default_ttl_get(void)
Get the current default TTL value.
int bt_mesh_gatt_proxy_set(enum bt_mesh_feat_state gatt_proxy)
Enable or disable the GATT Proxy feature.
int bt_mesh_default_ttl_set(uint8_t default_ttl)
Set the default TTL value.
enum bt_mesh_feat_state bt_mesh_friend_get(void)
Get the current Friend state.
int bt_mesh_relay_set(enum bt_mesh_feat_state relay, uint8_t xmit)
Configure the Relay feature.
enum bt_mesh_feat_state bt_mesh_relay_get(void)
Get the current Relay feature state.
uint8_t bt_mesh_relay_retransmit_get(void)
Get the current Relay Retransmit parameters.
@ BT_MESH_FEATURE_DISABLED
Definition cfg.h:31
@ BT_MESH_FEATURE_NOT_SUPPORTED
Definition cfg.h:35
@ BT_MESH_FEATURE_ENABLED
Definition cfg.h:33