Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
main.h File Reference

Bluetooth Mesh Protocol APIs. More...

#include <stdbool.h>
#include <stdint.h>
#include <zephyr/kernel.h>
#include <zephyr/sys/iterable_sections.h>

Go to the source code of this file.

Data Structures

struct  bt_mesh_dev_capabilities
 Device Capabilities. More...
 
struct  bt_mesh_prov
 Provisioning properties & capabilities. More...
 
struct  bt_mesh_lpn_cb
 Low Power Node callback functions. More...
 
struct  bt_mesh_friend_cb
 Friend Node callback functions. More...
 

Macros

#define BT_MESH_NET_PRIMARY   0x000
 Primary Network Key index.
 
#define BT_MESH_FEAT_RELAY   BIT(0)
 Relay feature.
 
#define BT_MESH_FEAT_PROXY   BIT(1)
 GATT Proxy feature.
 
#define BT_MESH_FEAT_FRIEND   BIT(2)
 Friend feature.
 
#define BT_MESH_FEAT_LOW_POWER   BIT(3)
 Low Power Node feature.
 
#define BT_MESH_FEAT_SUPPORTED
 Supported heartbeat publication features.
 
#define BT_MESH_LPN_CB_DEFINE(_name)
 Register a callback structure for Friendship events.
 
#define BT_MESH_FRIEND_CB_DEFINE(_name)
 Register a callback structure for Friendship events.
 

Enumerations

enum  { BT_MESH_PROV_AUTH_CMAC_AES128_AES_CCM , BT_MESH_PROV_AUTH_HMAC_SHA256_AES_CCM }
 Available authentication algorithms. More...
 
enum  { BT_MESH_STATIC_OOB_AVAILABLE = BIT(0) , BT_MESH_OOB_AUTH_REQUIRED = BIT(1) }
 OOB Type field values. More...
 
enum  bt_mesh_output_action_t {
  BT_MESH_NO_OUTPUT = 0 , BT_MESH_BLINK = BIT(0) , BT_MESH_BEEP = BIT(1) , BT_MESH_VIBRATE = BIT(2) ,
  BT_MESH_DISPLAY_NUMBER = BIT(3) , BT_MESH_DISPLAY_STRING = BIT(4)
}
 Available Provisioning output authentication actions. More...
 
enum  bt_mesh_input_action_t {
  BT_MESH_NO_INPUT = 0 , BT_MESH_PUSH = BIT(0) , BT_MESH_TWIST = BIT(1) , BT_MESH_ENTER_NUMBER = BIT(2) ,
  BT_MESH_ENTER_STRING = BIT(3)
}
 Available Provisioning input authentication actions. More...
 
enum  bt_mesh_prov_bearer_t { BT_MESH_PROV_ADV = BIT(0) , BT_MESH_PROV_GATT = BIT(1) , BT_MESH_PROV_REMOTE = BIT(2) }
 Available Provisioning bearers. More...
 
enum  bt_mesh_prov_oob_info_t {
  BT_MESH_PROV_OOB_OTHER = BIT(0) , BT_MESH_PROV_OOB_URI = BIT(1) , BT_MESH_PROV_OOB_2D_CODE = BIT(2) , BT_MESH_PROV_OOB_BAR_CODE = BIT(3) ,
  BT_MESH_PROV_OOB_NFC = BIT(4) , BT_MESH_PROV_OOB_NUMBER = BIT(5) , BT_MESH_PROV_OOB_STRING = BIT(6) , BT_MESH_PROV_OOB_CERTIFICATE = BIT(7) ,
  BT_MESH_PROV_OOB_RECORDS = BIT(8) , BT_MESH_PROV_OOB_ON_BOX = BIT(11) , BT_MESH_PROV_OOB_IN_BOX = BIT(12) , BT_MESH_PROV_OOB_ON_PAPER = BIT(13) ,
  BT_MESH_PROV_OOB_IN_MANUAL = BIT(14) , BT_MESH_PROV_OOB_ON_DEV = BIT(15)
}
 Out of Band information location. More...
 

Functions

int bt_mesh_input_string (const char *str)
 Provide provisioning input OOB string.
 
int bt_mesh_input_number (uint32_t num)
 Provide provisioning input OOB number.
 
int bt_mesh_prov_remote_pub_key_set (const uint8_t public_key[64])
 Provide Device public key.
 
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_output (bt_mesh_output_action_t action, uint8_t size)
 Use Output OOB authentication.
 
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_none (void)
 Don't use OOB authentication.
 
int bt_mesh_prov_enable (bt_mesh_prov_bearer_t bearers)
 Enable specific provisioning bearers.
 
int bt_mesh_prov_disable (bt_mesh_prov_bearer_t bearers)
 Disable specific provisioning bearers.
 
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.
 
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_provision_gatt (const uint8_t uuid[16], uint16_t net_idx, uint16_t addr, uint8_t attention_duration)
 Provision a Mesh Node using PB-GATT.
 
int bt_mesh_provision_remote (struct bt_mesh_rpr_cli *cli, const struct bt_mesh_rpr_node *srv, const uint8_t uuid[16], uint16_t net_idx, uint16_t addr)
 Provision a Mesh Node using PB-Remote.
 
int bt_mesh_reprovision_remote (struct bt_mesh_rpr_cli *cli, struct bt_mesh_rpr_node *srv, uint16_t addr, bool comp_change)
 Reprovision a Mesh Node using PB-Remote.
 
bool bt_mesh_is_provisioned (void)
 Check if the local node has been provisioned.
 
int bt_mesh_init (const struct bt_mesh_prov *prov, const struct bt_mesh_comp *comp)
 Initialize Mesh support.
 
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_resume (void)
 Resume a suspended Mesh network.
 
void bt_mesh_iv_update_test (bool enable)
 Toggle the IV Update test mode.
 
bool bt_mesh_iv_update (void)
 Toggle the IV Update state.
 
int bt_mesh_lpn_set (bool enable)
 Toggle the Low Power feature of the local device.
 
int bt_mesh_lpn_poll (void)
 Send out a Friend Poll message.
 
int bt_mesh_friend_terminate (uint16_t lpn_addr)
 Terminate Friendship.
 
void bt_mesh_rpl_pending_store (uint16_t addr)
 Store pending RPL entry(ies) in the persistent storage.
 
const uint8_tbt_mesh_va_uuid_get (uint16_t addr, const uint8_t *uuid, uint16_t *retaddr)
 Iterate stored Label UUIDs.
 

Detailed Description

Bluetooth Mesh Protocol APIs.