10#ifndef __BT_MESH_MAIN_H
11#define __BT_MESH_MAIN_H
25 BT_MESH_NO_OUTPUT = 0,
26 BT_MESH_BLINK = BIT(0),
27 BT_MESH_BEEP = BIT(1),
28 BT_MESH_VIBRATE = BIT(2),
29 BT_MESH_DISPLAY_NUMBER = BIT(3),
30 BT_MESH_DISPLAY_STRING = BIT(4),
31} bt_mesh_output_action_t;
35 BT_MESH_PUSH = BIT(0),
36 BT_MESH_TWIST = BIT(1),
37 BT_MESH_ENTER_NUMBER = BIT(2),
38 BT_MESH_ENTER_STRING = BIT(3),
39} bt_mesh_input_action_t;
42 BT_MESH_PROV_ADV = BIT(0),
43 BT_MESH_PROV_GATT = BIT(1),
44} bt_mesh_prov_bearer_t;
47 BT_MESH_PROV_OOB_OTHER = BIT(0),
48 BT_MESH_PROV_OOB_URI = BIT(1),
49 BT_MESH_PROV_OOB_2D_CODE = BIT(2),
50 BT_MESH_PROV_OOB_BAR_CODE = BIT(3),
51 BT_MESH_PROV_OOB_NFC = BIT(4),
52 BT_MESH_PROV_OOB_NUMBER = BIT(5),
53 BT_MESH_PROV_OOB_STRING = BIT(6),
55 BT_MESH_PROV_OOB_ON_BOX = BIT(11),
56 BT_MESH_PROV_OOB_IN_BOX = BIT(12),
57 BT_MESH_PROV_OOB_ON_PAPER = BIT(13),
58 BT_MESH_PROV_OOB_IN_MANUAL = BIT(14),
59 BT_MESH_PROV_OOB_ON_DEV = BIT(15),
60} bt_mesh_prov_oob_info_t;
188 int (*
input)(bt_mesh_input_action_t act, uint8_t size);
403#define BT_MESH_NET_PRIMARY 0x000
406#define BT_MESH_FEAT_RELAY BIT(0)
407#define BT_MESH_FEAT_PROXY BIT(1)
408#define BT_MESH_FEAT_FRIEND BIT(2)
409#define BT_MESH_FEAT_LOW_POWER BIT(3)
410#define BT_MESH_FEAT_SUPPORTED (BT_MESH_FEAT_RELAY | \
411 BT_MESH_FEAT_PROXY | \
412 BT_MESH_FEAT_FRIEND | \
413 BT_MESH_FEAT_LOW_POWER)
480 uint8_t flags, uint32_t iv_index, uint16_t addr,
481 const uint8_t dev_key[16]);
494 uint8_t attention_duration);
int bt_mesh_input_string(const char *str)
Provide provisioning input OOB string.
int bt_mesh_prov_enable(bt_mesh_prov_bearer_t bearers)
Enable specific provisioning bearers.
int bt_mesh_prov_remote_pub_key_set(const uint8_t public_key[BT_PUB_KEY_LEN])
Provide Device public key.
int bt_mesh_auth_method_set_static(const uint8_t *static_val, uint8_t size)
Use static OOB authentication.
int bt_mesh_auth_method_set_input(bt_mesh_input_action_t action, uint8_t size)
Use Input OOB authentication.
int bt_mesh_auth_method_set_none(void)
Don't use OOB authentication.
int bt_mesh_prov_disable(bt_mesh_prov_bearer_t bearers)
Disable specific provisioning bearers.
int bt_mesh_input_number(uint32_t num)
Provide provisioning input OOB number.
int bt_mesh_auth_method_set_output(bt_mesh_output_action_t action, uint8_t size)
Use Output OOB authentication.
bool bt_mesh_is_provisioned(void)
Check if the local node has been provisioned.
void bt_mesh_lpn_set_cb(void(*cb)(uint16_t friend_addr, bool established))
Register a callback for Friendship changes.
int bt_mesh_provision_adv(const uint8_t uuid[16], uint16_t net_idx, uint16_t addr, uint8_t attention_duration)
Provision a Mesh Node using PB-ADV.
int bt_mesh_friend_terminate(uint16_t lpn_addr)
Terminate Friendship.
int bt_mesh_lpn_poll(void)
Send out a Friend Poll message.
void bt_mesh_iv_update_test(bool enable)
Toggle the IV Update test mode.
int bt_mesh_provision(const uint8_t net_key[16], uint16_t net_idx, uint8_t flags, uint32_t iv_index, uint16_t addr, const uint8_t dev_key[16])
Provision the local Mesh Node.
void bt_mesh_rpl_pending_store(uint16_t addr)
Store pending RPL entry(ies) in the persistent storage.
void bt_mesh_reset(void)
Reset the state of the local Mesh node.
int bt_mesh_suspend(void)
Suspend the Mesh network temporarily.
int bt_mesh_lpn_set(bool enable)
Toggle the Low Power feature of the local device.
int bt_mesh_resume(void)
Resume a suspended Mesh network.
bool bt_mesh_iv_update(void)
Toggle the IV Update state.
int bt_mesh_init(uint8_t own_addr_type, const struct bt_mesh_prov *prov, const struct bt_mesh_comp *comp)
Initialize Mesh support.
bt_mesh_output_action_t output_actions
Definition main.h:77
uint8_t output_size
Definition main.h:83
bt_mesh_input_action_t input_actions
Definition main.h:80
uint16_t algorithms
Definition main.h:68
uint8_t pub_key_type
Definition main.h:71
uint8_t static_oob
Definition main.h:74
uint8_t input_size
Definition main.h:86
uint8_t elem_count
Definition main.h:65
void(* link_close)(bt_mesh_prov_bearer_t bearer)
Provisioning link has been closed.
Definition main.h:228
const uint8_t * uuid
Definition main.h:92
const uint8_t * public_key_be
Definition main.h:111
const uint8_t * private_key_be
Definition main.h:119
void(* input_complete)(void)
The other device finished their OOB input.
Definition main.h:196
int(* output_string)(const char *str)
Output of a string is requested.
Definition main.h:172
int(* input)(bt_mesh_input_action_t act, uint8_t size)
Input is requested.
Definition main.h:188
void(* link_open)(bt_mesh_prov_bearer_t bearer)
Provisioning link has been opened.
Definition main.h:219
uint8_t output_size
Definition main.h:127
const char * uri
Definition main.h:99
bt_mesh_prov_oob_info_t oob_info
Definition main.h:102
void(* unprovisioned_beacon)(uint8_t uuid[16], bt_mesh_prov_oob_info_t oob_info, uint32_t *uri_hash)
Unprovisioned beacon has been received.
Definition main.h:208
uint16_t output_actions
Definition main.h:129
uint8_t static_val_len
Definition main.h:124
const uint8_t * static_val
Definition main.h:122
void(* node_added)(uint16_t net_idx, uint8_t uuid[16], uint16_t addr, uint8_t num_elem)
A new node has been added to the provisioning database.
Definition main.h:252
void(* complete)(uint16_t net_idx, uint16_t addr)
Provisioning is complete.
Definition main.h:239
void(* reset)(void)
Node has been reset.
Definition main.h:263
int(* output_number)(bt_mesh_output_action_t act, uint32_t num)
Output of a number is requested.
Definition main.h:161
uint16_t input_actions
Definition main.h:134
void(* capabilities)(const struct bt_mesh_dev_capabilities *cap)
Provisioning Capabilities.
Definition main.h:149