ESP-BLE-MESH

With various features of ESP-BLE-MESH, users can create a managed flooding mesh network for several scenarios, such as lighting, sensor and etc.

For an ESP32 to join and work on a ESP-BLE-MESH network, it must be provisioned firstly. By provisioning, the ESP32, as an unprovisioned device, will join the ESP-BLE-MESH network and become a ESP-BLE-MESH node, communicating with other nodes within or beyond the radio range.

Apart from ESP-BLE-MESH nodes, inside ESP-BLE-MESH network, there is also ESP32 that works as ESP-BLE-MESH Provisioner, which could provision unprovisioned devices into ESP-BLE-MESH nodes and configure the nodes with various features.

For information how to start using ESP32 and ESP-BLE-MESH, please see the Section Getting Started with ESP-BLE-MESH. If you are interested in information on ESP-BLE-MESH architecture, including some details of software implementation, please see Section ESP-BLE-MESH Architecture.

Application Examples and Demos

Please refer to Sections ESP-BLE-MESH Examples and ESP-BLE-MESH Demo Videos.

API Reference

ESP-BLE-MESH APIs are divided into the following parts:

ESP-BLE-MESH Definitions

This section contains only one header file, which lists the following items of ESP-BLE-MESH.

  • ID of all the models and related message opcodes
  • Structs of model, element and Composition Data
  • Structs of used by ESP-BLE-MESH Node/Provisioner for provisioning
  • Structs used to transmit/receive messages
  • Event types and related event parameters

Unions

union esp_ble_mesh_prov_cb_param_t
#include <esp_ble_mesh_defs.h>

BLE Mesh Node/Provisioner callback parameters union.

Public Members

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_prov_register_comp_param prov_register_comp

Event parameter of ESP_BLE_MESH_PROV_REGISTER_COMP_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_set_unprov_dev_name_comp_param node_set_unprov_dev_name_comp

Event parameter of ESP_BLE_MESH_NODE_SET_UNPROV_DEV_NAME_COMP_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_prov_enable_comp_param node_prov_enable_comp

Event parameter of ESP_BLE_MESH_NODE_PROV_ENABLE_COMP_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_prov_disable_comp_param node_prov_disable_comp

Event parameter of ESP_BLE_MESH_NODE_PROV_DISABLE_COMP_EVT

Event parameter of ESP_BLE_MESH_NODE_PROV_LINK_OPEN_EVT

Event parameter of ESP_BLE_MESH_NODE_PROV_LINK_CLOSE_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_output_num_evt_param node_prov_output_num

Event parameter of ESP_BLE_MESH_NODE_PROV_OUTPUT_NUMBER_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_output_str_evt_param node_prov_output_str

Event parameter of ESP_BLE_MESH_NODE_PROV_OUTPUT_STRING_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_input_evt_param node_prov_input

Event parameter of ESP_BLE_MESH_NODE_PROV_INPUT_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_provision_complete_evt_param node_prov_complete

Event parameter of ESP_BLE_MESH_NODE_PROV_COMPLETE_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_provision_reset_param node_prov_reset

Event parameter of ESP_BLE_MESH_NODE_PROV_RESET_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_set_oob_pub_key_comp_param node_prov_set_oob_pub_key_comp

Event parameter of ESP_BLE_MESH_NODE_PROV_SET_OOB_PUB_KEY_COMP_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_input_number_comp_param node_prov_input_num_comp

Event parameter of ESP_BLE_MESH_NODE_PROV_INPUT_NUM_COMP_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_input_string_comp_param node_prov_input_str_comp

Event parameter of ESP_BLE_MESH_NODE_PROV_INPUT_STR_COMP_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_proxy_identity_enable_comp_param node_proxy_identity_enable_comp

Event parameter of ESP_BLE_MESH_NODE_PROXY_IDENTITY_ENABLE_COMP_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_proxy_gatt_enable_comp_param node_proxy_gatt_enable_comp

Event parameter of ESP_BLE_MESH_NODE_PROXY_GATT_ENABLE_COMP_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_proxy_gatt_disable_comp_param node_proxy_gatt_disable_comp

Event parameter of ESP_BLE_MESH_NODE_PROXY_GATT_DISABLE_COMP_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_provisioner_recv_unprov_adv_pkt_param provisioner_recv_unprov_adv_pkt

Event parameter of ESP_BLE_MESH_PROVISIONER_RECV_UNPROV_ADV_PKT_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_provisioner_prov_enable_comp_param provisioner_prov_enable_comp

Event parameter of ESP_BLE_MESH_PROVISIONER_PROV_ENABLE_COMP_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_provisioner_prov_disable_comp_param provisioner_prov_disable_comp

Event parameter of ESP_BLE_MESH_PROVISIONER_PROV_DISABLE_COMP_EVT

Event parameter of ESP_BLE_MESH_PROVISIONER_PROV_LINK_OPEN_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_provisioner_prov_read_oob_pub_key_evt_param provisioner_prov_read_oob_pub_key

Event parameter of ESP_BLE_MESH_PROVISIONER_PROV_READ_OOB_PUB_KEY_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_provisioner_prov_input_evt_param provisioner_prov_input

Event parameter of ESP_BLE_MESH_PROVISIONER_PROV_INPUT_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_provisioner_prov_output_evt_param provisioner_prov_output

Event parameter of ESP_BLE_MESH_PROVISIONER_PROV_OUTPUT_EVT

Event parameter of ESP_BLE_MESH_PROVISIONER_PROV_LINK_CLOSE_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_provisioner_prov_comp_param provisioner_prov_complete

Event parameter of ESP_BLE_MESH_PROVISIONER_PROV_COMPLETE_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_provisioner_add_unprov_dev_comp_param provisioner_add_unprov_dev_comp

Event parameter of ESP_BLE_MESH_PROVISIONER_ADD_UNPROV_DEV_COMP_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_provisioner_delete_dev_comp_param provisioner_delete_dev_comp

Event parameter of ESP_BLE_MESH_PROVISIONER_DELETE_DEV_COMP_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_provisioner_set_dev_uuid_match_comp_param provisioner_set_dev_uuid_match_comp

Event parameter of ESP_BLE_MESH_PROVISIONER_SET_DEV_UUID_MATCH_COMP_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_provisioner_set_prov_data_info_comp_param provisioner_set_prov_data_info_comp

Event parameter of ESP_BLE_MESH_PROVISIONER_SET_PROV_DATA_INFO_COMP_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_provisioner_prov_read_oob_pub_key_comp_param provisioner_prov_read_oob_pub_key_comp

Event parameter of ESP_BLE_MESH_PROVISIONER_PROV_READ_OOB_PUB_KEY_COMP_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_provisioner_prov_input_num_comp_param provisioner_prov_input_num_comp

Event parameter of ESP_BLE_MESH_PROVISIONER_PROV_INPUT_NUMBER_COMP_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_provisioner_prov_input_str_comp_param provisioner_prov_input_str_comp

Event parameter of ESP_BLE_MESH_PROVISIONER_PROV_INPUT_STRING_COMP_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_provisioner_set_node_name_comp_param provisioner_set_node_name_comp

Event parameter of ESP_BLE_MESH_PROVISIONER_SET_NODE_NAME_COMP_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_provisioner_add_local_app_key_comp_param provisioner_add_app_key_comp

Event parameter of ESP_BLE_MESH_PROVISIONER_ADD_LOCAL_APP_KEY_COMP_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_provisioner_bind_local_mod_app_comp_param provisioner_bind_app_key_to_model_comp

Event parameter of ESP_BLE_MESH_PROVISIONER_BIND_APP_KEY_TO_MODEL_COMP_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_provisioner_add_local_net_key_comp_param provisioner_add_net_key_comp

Event parameter of ESP_BLE_MESH_PROVISIONER_ADD_LOCAL_NET_KEY_COMP_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_set_fast_prov_info_comp_param set_fast_prov_info_comp

Event parameter of ESP_BLE_MESH_SET_FAST_PROV_INFO_COMP_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_set_fast_prov_action_comp_param set_fast_prov_action_comp

Event parameter of ESP_BLE_MESH_SET_FAST_PROV_ACTION_COMP_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_heartbeat_msg_recv_param heartbeat_msg_recv

Event parameter of ESP_BLE_MESH_HEARTBEAT_MESSAGE_RECV_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_lpn_enable_comp_param lpn_enable_comp

Event parameter of ESP_BLE_MESH_LPN_ENABLE_COMP_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_lpn_disable_comp_param lpn_disable_comp

Event parameter of ESP_BLE_MESH_LPN_DISABLE_COMP_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_lpn_poll_comp_param lpn_poll_comp

Event parameter of ESP_BLE_MESH_LPN_POLL_COMP_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_lpn_friendship_establish_param lpn_friendship_establish

Event parameter of ESP_BLE_MESH_LPN_FRIENDSHIP_ESTABLISH_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_lpn_friendship_terminate_param lpn_friendship_terminate

Event parameter of ESP_BLE_MESH_LPN_FRIENDSHIP_TERMINATE_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_friend_friendship_establish_param frnd_friendship_establish

Event parameter of ESP_BLE_MESH_FRIEND_FRIENDSHIP_ESTABLISH_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_friend_friendship_terminate_param frnd_friendship_terminate

Event parameter of ESP_BLE_MESH_FRIEND_FRIENDSHIP_TERMINATE_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_proxy_client_recv_adv_pkt_param proxy_client_recv_adv_pkt

Event parameter of ESP_BLE_MESH_PROXY_CLIENT_RECV_ADV_PKT_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_proxy_client_connected_param proxy_client_connected

Event parameter of ESP_BLE_MESH_PROXY_CLIENT_CONNECTED_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_proxy_client_disconnected_param proxy_client_disconnected

Event parameter of ESP_BLE_MESH_PROXY_CLIENT_DISCONNECTED_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_proxy_client_recv_filter_status_param proxy_client_recv_filter_status

Event parameter of ESP_BLE_MESH_PROXY_CLIENT_RECV_FILTER_STATUS_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_proxy_client_connect_comp_param proxy_client_connect_comp

Event parameter of ESP_BLE_MESH_PROXY_CLIENT_CONNECT_COMP_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_proxy_client_disconnect_comp_param proxy_client_disconnect_comp

Event parameter of ESP_BLE_MESH_PROXY_CLIENT_DISCONNECT_COMP_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_proxy_client_set_filter_type_comp_param proxy_client_set_filter_type_comp

Event parameter of ESP_BLE_MESH_PROXY_CLIENT_SET_FILTER_TYPE_COMP_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_proxy_client_add_filter_addr_comp_param proxy_client_add_filter_addr_comp

Event parameter of ESP_BLE_MESH_PROXY_CLIENT_ADD_FILTER_ADDR_COMP_EVT

struct esp_ble_mesh_prov_cb_param_t::ble_mesh_proxy_client_remove_filter_addr_comp_param proxy_client_remove_filter_addr_comp

Event parameter of ESP_BLE_MESH_PROXY_CLIENT_REMOVE_FILTER_ADDR_COMP_EVT

struct ble_mesh_friend_friendship_establish_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_FRIEND_FRIENDSHIP_ESTABLISH_EVT.

Public Members

uint16_t lpn_addr

Low Power Node unciast address

struct ble_mesh_friend_friendship_terminate_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_FRIEND_FRIENDSHIP_TERMINATE_EVT.

Public Types

enum [anonymous]

This enum value is the reason of friendship termination on the friend node side

Values:

ESP_BLE_MESH_FRND_FRIENDSHIP_TERMINATE_ESTABLISH_FAIL

Friend Offer has been sent, but Friend Offer is not received within 1 second, friendship fails to be established

ESP_BLE_MESH_FRND_FRIENDSHIP_TERMINATE_POLL_TIMEOUT

Friendship is established, PollTimeout timer expires and no Friend Poll/Sub Add/Sub Remove is received

ESP_BLE_MESH_FRND_FRIENDSHIP_TERMINATE_RECV_FRND_REQ

Receive Friend Request from existing Low Power Node

ESP_BLE_MESH_FRND_FRIENDSHIP_TERMINATE_RECV_FRND_CLEAR

Receive Friend Clear from other friend node

ESP_BLE_MESH_FRND_FRIENDSHIP_TERMINATE_DISABLE

Friend feature disabled or corresponding NetKey is deleted

Public Members

uint16_t lpn_addr

Low Power Node unicast address

esp_ble_mesh_prov_cb_param_t::ble_mesh_friend_friendship_terminate_param::[anonymous] reason

This enum value is the reason of friendship termination on the friend node side Friendship terminated reason

struct ble_mesh_heartbeat_msg_recv_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_HEARTBEAT_MESSAGE_RECV_EVT.

Public Members

uint8_t hops

Heartbeat hops (InitTTL - RxTTL + 1)

uint16_t feature

Bit field of currently active features of the node

struct ble_mesh_input_evt_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_NODE_PROV_INPUT_EVT.

Public Members

esp_ble_mesh_input_action_t action

Action of Input OOB Authentication

uint8_t size

Size of Input OOB Authentication

struct ble_mesh_input_number_comp_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_NODE_PROV_INPUT_NUM_COMP_EVT.

Public Members

int err_code

Indicate the result of inputting number

struct ble_mesh_input_string_comp_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_NODE_PROV_INPUT_STR_COMP_EVT.

Public Members

int err_code

Indicate the result of inputting string

#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_NODE_PROV_LINK_CLOSE_EVT.

Public Members

Type of the bearer used when device link is closed

#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_NODE_PROV_LINK_OPEN_EVT.

Public Members

Type of the bearer used when device link is open

struct ble_mesh_lpn_disable_comp_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_LPN_DISABLE_COMP_EVT.

Public Members

int err_code

Indicate the result of disabling LPN functionality

struct ble_mesh_lpn_enable_comp_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_LPN_ENABLE_COMP_EVT.

Public Members

int err_code

Indicate the result of enabling LPN functionality

struct ble_mesh_lpn_friendship_establish_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_LPN_FRIENDSHIP_ESTABLISH_EVT.

Public Members

uint16_t friend_addr

Friend Node unicast address

struct ble_mesh_lpn_friendship_terminate_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_LPN_FRIENDSHIP_TERMINATE_EVT.

Public Members

uint16_t friend_addr

Friend Node unicast address

struct ble_mesh_lpn_poll_comp_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_LPN_POLL_COMP_EVT.

Public Members

int err_code

Indicate the result of sending Friend Poll

struct ble_mesh_output_num_evt_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_NODE_PROV_OUTPUT_NUMBER_EVT.

Public Members

esp_ble_mesh_output_action_t action

Action of Output OOB Authentication

uint32_t number

Number of Output OOB Authentication

struct ble_mesh_output_str_evt_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_NODE_PROV_OUTPUT_STRING_EVT.

Public Members

char string[8]

String of Output OOB Authentication

struct ble_mesh_prov_disable_comp_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_NODE_PROV_DISABLE_COMP_EVT.

Public Members

int err_code

Indicate the result of disabling BLE Mesh device

struct ble_mesh_prov_enable_comp_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_NODE_PROV_ENABLE_COMP_EVT.

Public Members

int err_code

Indicate the result of enabling BLE Mesh device

struct ble_mesh_prov_register_comp_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_PROV_REGISTER_COMP_EVT.

Public Members

int err_code

Indicate the result of BLE Mesh initialization

struct ble_mesh_provision_complete_evt_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_NODE_PROV_COMPLETE_EVT.

Public Members

uint16_t net_idx

NetKey Index

uint8_t net_key[16]

NetKey

uint16_t addr

Primary address

uint8_t flags

Flags

uint32_t iv_index

IV Index

struct ble_mesh_provision_reset_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_NODE_PROV_RESET_EVT.

struct ble_mesh_provisioner_add_local_app_key_comp_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_PROVISIONER_ADD_LOCAL_APP_KEY_COMP_EVT.

Public Members

int err_code

Indicate the result of adding local AppKey by the Provisioner

uint16_t app_idx

AppKey Index

struct ble_mesh_provisioner_add_local_net_key_comp_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_PROVISIONER_ADD_LOCAL_NET_KEY_COMP_EVT.

Public Members

int err_code

Indicate the result of adding local NetKey by the Provisioner

uint16_t net_idx

NetKey Index

struct ble_mesh_provisioner_add_unprov_dev_comp_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_PROVISIONER_ADD_UNPROV_DEV_COMP_EVT.

Public Members

int err_code

Indicate the result of adding device into queue by the Provisioner

struct ble_mesh_provisioner_bind_local_mod_app_comp_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_PROVISIONER_BIND_APP_KEY_TO_MODEL_COMP_EVT.

Public Members

int err_code

Indicate the result of binding AppKey with model by the Provisioner

struct ble_mesh_provisioner_delete_dev_comp_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_PROVISIONER_DELETE_DEV_COMP_EVT.

Public Members

int err_code

Indicate the result of deleting device by the Provisioner

#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_PROVISIONER_PROV_LINK_CLOSE_EVT.

Public Members

Type of the bearer used when Provisioner link is closed

Reason of the closed provisioning link

#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_PROVISIONER_PROV_LINK_OPEN_EVT.

Public Members

Type of the bearer used when Provisioner link is opened

struct ble_mesh_provisioner_prov_comp_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_PROVISIONER_PROV_COMPLETE_EVT.

Public Members

int node_idx

Index of the provisioned device

esp_ble_mesh_octet16_t device_uuid

Device UUID of the provisioned device

uint16_t unicast_addr

Primary address of the provisioned device

uint8_t element_num

Element count of the provisioned device

uint16_t netkey_idx

NetKey Index of the provisioned device

struct ble_mesh_provisioner_prov_disable_comp_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_PROVISIONER_PROV_DISABLE_COMP_EVT.

Public Members

int err_code

Indicate the result of disabling BLE Mesh Provisioner

struct ble_mesh_provisioner_prov_enable_comp_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_PROVISIONER_PROV_ENABLE_COMP_EVT.

Public Members

int err_code

Indicate the result of enabling BLE Mesh Provisioner

struct ble_mesh_provisioner_prov_input_evt_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_PROVISIONER_PROV_INPUT_EVT.

Public Members

esp_ble_mesh_oob_method_t method

Method of device Output OOB Authentication

esp_ble_mesh_output_action_t action

Action of device Output OOB Authentication

uint8_t size

Size of device Output OOB Authentication

Index of the provisioning link

struct ble_mesh_provisioner_prov_input_num_comp_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_PROVISIONER_PROV_INPUT_NUMBER_COMP_EVT.

Public Members

int err_code

Indicate the result of inputting number by the Provisioner

struct ble_mesh_provisioner_prov_input_str_comp_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_PROVISIONER_PROV_INPUT_STRING_COMP_EVT.

Public Members

int err_code

Indicate the result of inputting string by the Provisioner

struct ble_mesh_provisioner_prov_output_evt_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_PROVISIONER_PROV_OUTPUT_EVT.

Public Members

esp_ble_mesh_oob_method_t method

Method of device Input OOB Authentication

esp_ble_mesh_input_action_t action

Action of device Input OOB Authentication

uint8_t size

Size of device Input OOB Authentication

Index of the provisioning link

char string[8]

String output by the Provisioner

uint32_t number

Number output by the Provisioner

union esp_ble_mesh_prov_cb_param_t::ble_mesh_provisioner_prov_output_evt_param::[anonymous] [anonymous]
struct ble_mesh_provisioner_prov_read_oob_pub_key_comp_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_PROVISIONER_PROV_READ_OOB_PUB_KEY_COMP_EVT.

Public Members

int err_code

Indicate the result of setting OOB Public Key by the Provisioner

struct ble_mesh_provisioner_prov_read_oob_pub_key_evt_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_PROVISIONER_PROV_READ_OOB_PUB_KEY_EVT.

Public Members

Index of the provisioning link

struct ble_mesh_provisioner_recv_unprov_adv_pkt_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_PROVISIONER_RECV_UNPROV_ADV_PKT_EVT.

Public Members

uint8_t dev_uuid[16]

Device UUID of the unprovisoned device

esp_ble_mesh_bd_addr_t addr

Device address of the unprovisoned device

esp_ble_mesh_addr_type_t addr_type

Device address type

uint16_t oob_info

OOB Info of the unprovisoned device

uint8_t adv_type

Avertising type of the unprovisoned device

esp_ble_mesh_prov_bearer_t bearer

Bearer of the unprovisoned device

struct ble_mesh_provisioner_set_dev_uuid_match_comp_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_PROVISIONER_SET_DEV_UUID_MATCH_COMP_EVT.

Public Members

int err_code

Indicate the result of setting Device UUID match value by the Provisioner

struct ble_mesh_provisioner_set_node_name_comp_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_PROVISIONER_SET_NODE_NAME_COMP_EVT.

Public Members

int err_code

Indicate the result of setting provisioned device name by the Provisioner

int node_index

Index of the provisioned device

struct ble_mesh_provisioner_set_prov_data_info_comp_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_PROVISIONER_SET_PROV_DATA_INFO_COMP_EVT.

Public Members

int err_code

Indicate the result of setting provisioning info by the Provisioner

struct ble_mesh_proxy_client_add_filter_addr_comp_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_PROXY_CLIENT_ADD_FILTER_ADDR_COMP_EVT.

Public Members

int err_code

Indicate the result of Proxy Client add filter address

uint8_t conn_handle

Proxy connection handle

uint16_t net_idx

Corresponding NetKey Index

struct ble_mesh_proxy_client_connect_comp_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_PROXY_CLIENT_CONNECT_COMP_EVT.

Public Members

int err_code

Indicate the result of Proxy Client connect

esp_ble_mesh_bd_addr_t addr

Device address of the Proxy Server

esp_ble_mesh_addr_type_t addr_type

Device address type

uint16_t net_idx

Corresponding NetKey Index

struct ble_mesh_proxy_client_connected_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_PROXY_CLIENT_CONNECTED_EVT.

Public Members

esp_ble_mesh_bd_addr_t addr

Device address of the Proxy Server

esp_ble_mesh_addr_type_t addr_type

Device address type

uint8_t conn_handle

Proxy connection handle

uint16_t net_idx

Corresponding NetKey Index

struct ble_mesh_proxy_client_disconnect_comp_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_PROXY_CLIENT_DISCONNECT_COMP_EVT.

Public Members

int err_code

Indicate the result of Proxy Client disconnect

uint8_t conn_handle

Proxy connection handle

struct ble_mesh_proxy_client_disconnected_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_PROXY_CLIENT_DISCONNECTED_EVT.

Public Members

esp_ble_mesh_bd_addr_t addr

Device address of the Proxy Server

esp_ble_mesh_addr_type_t addr_type

Device address type

uint8_t conn_handle

Proxy connection handle

uint16_t net_idx

Corresponding NetKey Index

uint8_t reason

Proxy disconnect reason

struct ble_mesh_proxy_client_recv_adv_pkt_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_PROXY_CLIENT_RECV_ADV_PKT_EVT.

Public Members

esp_ble_mesh_bd_addr_t addr

Device address

esp_ble_mesh_addr_type_t addr_type

Device address type

uint16_t net_idx

Network ID related NetKey Index

uint8_t net_id[8]

Network ID contained in the advertising packet

struct ble_mesh_proxy_client_recv_filter_status_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_PROXY_CLIENT_RECV_FILTER_STATUS_EVT.

Public Members

uint8_t conn_handle

Proxy connection handle

uint16_t server_addr

Proxy Server primary element address

uint16_t net_idx

Corresponding NetKey Index

uint8_t filter_type

Proxy Server filter type(whitelist or blacklist)

uint16_t list_size

Number of addresses in the Proxy Server filter list

struct ble_mesh_proxy_client_remove_filter_addr_comp_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_PROXY_CLIENT_REMOVE_FILTER_ADDR_COMP_EVT.

Public Members

int err_code

Indicate the result of Proxy Client remove filter address

uint8_t conn_handle

Proxy connection handle

uint16_t net_idx

Corresponding NetKey Index

struct ble_mesh_proxy_client_set_filter_type_comp_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_PROXY_CLIENT_SET_FILTER_TYPE_COMP_EVT.

Public Members

int err_code

Indicate the result of Proxy Client set filter type

uint8_t conn_handle

Proxy connection handle

uint16_t net_idx

Corresponding NetKey Index

struct ble_mesh_proxy_gatt_disable_comp_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_NODE_PROXY_GATT_DISABLE_COMP_EVT.

Public Members

int err_code

Indicate the result of disabling Mesh Proxy Service

struct ble_mesh_proxy_gatt_enable_comp_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_NODE_PROXY_GATT_ENABLE_COMP_EVT.

Public Members

int err_code

Indicate the result of enabling Mesh Proxy Service

struct ble_mesh_proxy_identity_enable_comp_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_NODE_PROXY_IDENTITY_ENABLE_COMP_EVT.

Public Members

int err_code

Indicate the result of enabling Mesh Proxy advertising

struct ble_mesh_set_fast_prov_action_comp_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_SET_FAST_PROV_ACTION_COMP_EVT.

Public Members

uint8_t status_action

Indicate the result of setting action of fast provisioning

struct ble_mesh_set_fast_prov_info_comp_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_SET_FAST_PROV_INFO_COMP_EVT.

Public Members

uint8_t status_unicast

Indicate the result of setting unicast address range of fast provisioning

uint8_t status_net_idx

Indicate the result of setting NetKey Index of fast provisioning

uint8_t status_match

Indicate the result of setting matching Device UUID of fast provisioning

struct ble_mesh_set_oob_pub_key_comp_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_NODE_PROV_SET_OOB_PUB_KEY_COMP_EVT.

Public Members

int err_code

Indicate the result of setting OOB Public Key

struct ble_mesh_set_unprov_dev_name_comp_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_NODE_SET_UNPROV_DEV_NAME_COMP_EVT.

Public Members

int err_code

Indicate the result of setting BLE Mesh device name

union esp_ble_mesh_server_state_value_t
#include <esp_ble_mesh_defs.h>

Server model state value union.

Public Members

uint8_t onoff

The value of the Generic OnOff state

The value of the Light LC Light OnOff state

struct esp_ble_mesh_server_state_value_t::[anonymous] gen_onoff

The Generic OnOff state

int16_t level

The value of the Generic Level state

struct esp_ble_mesh_server_state_value_t::[anonymous] gen_level

The Generic Level state

uint8_t onpowerup

The value of the Generic OnPowerUp state

struct esp_ble_mesh_server_state_value_t::[anonymous] gen_onpowerup

The Generic OnPowerUp state

uint16_t power

The value of the Generic Power Actual state

struct esp_ble_mesh_server_state_value_t::[anonymous] gen_power_actual

The Generic Power Actual state

uint16_t lightness

The value of the Light Lightness Actual state

The value of the Light Lightness Linear state

The value of the Light CTL Lightness state

The value of the Light HSL Lightness state

The value of the Light xyL Lightness state

struct esp_ble_mesh_server_state_value_t::[anonymous] light_lightness_actual

The Light Lightness Actual state

struct esp_ble_mesh_server_state_value_t::[anonymous] light_lightness_linear

The Light Lightness Linear state

struct esp_ble_mesh_server_state_value_t::[anonymous] light_ctl_lightness

The Light CTL Lightness state

uint16_t temperature

The value of the Light CTL Temperature state

int16_t delta_uv

The value of the Light CTL Delta UV state

struct esp_ble_mesh_server_state_value_t::[anonymous] light_ctl_temp_delta_uv

The Light CTL Temperature & Delta UV states

struct esp_ble_mesh_server_state_value_t::[anonymous] light_hsl_lightness

The Light HSL Lightness state

uint16_t hue

The value of the Light HSL Hue state

struct esp_ble_mesh_server_state_value_t::[anonymous] light_hsl_hue

The Light HSL Hue state

uint16_t saturation

The value of the Light HSL Saturation state

struct esp_ble_mesh_server_state_value_t::[anonymous] light_hsl_saturation

The Light HSL Saturation state

struct esp_ble_mesh_server_state_value_t::[anonymous] light_xyl_lightness

The Light xyL Lightness state

struct esp_ble_mesh_server_state_value_t::[anonymous] light_lc_light_onoff

The Light LC Light OnOff state

union esp_ble_mesh_model_cb_param_t
#include <esp_ble_mesh_defs.h>

BLE Mesh model callback parameters union.

Public Members

struct esp_ble_mesh_model_cb_param_t::ble_mesh_model_operation_evt_param model_operation

Event parameter of ESP_BLE_MESH_MODEL_OPERATION_EVT

struct esp_ble_mesh_model_cb_param_t::ble_mesh_model_send_comp_param model_send_comp

Event parameter of ESP_BLE_MESH_MODEL_SEND_COMP_EVT

struct esp_ble_mesh_model_cb_param_t::ble_mesh_model_publish_comp_param model_publish_comp

Event parameter of ESP_BLE_MESH_MODEL_PUBLISH_COMP_EVT

struct esp_ble_mesh_model_cb_param_t::ble_mesh_mod_recv_publish_msg_param client_recv_publish_msg

Event parameter of ESP_BLE_MESH_CLIENT_MODEL_RECV_PUBLISH_MSG_EVT

struct esp_ble_mesh_model_cb_param_t::ble_mesh_client_model_send_timeout_param client_send_timeout

Event parameter of ESP_BLE_MESH_CLIENT_MODEL_SEND_TIMEOUT_EVT

struct esp_ble_mesh_model_cb_param_t::ble_mesh_model_publish_update_evt_param model_publish_update

Event parameter of ESP_BLE_MESH_MODEL_PUBLISH_UPDATE_EVT

struct esp_ble_mesh_model_cb_param_t::ble_mesh_server_model_update_state_comp_param server_model_update_state

Event parameter of ESP_BLE_MESH_SERVER_MODEL_UPDATE_STATE_COMP_EVT

struct ble_mesh_client_model_send_timeout_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_CLIENT_MODEL_SEND_TIMEOUT_EVT.

Public Members

uint32_t opcode

Opcode of the previously sent message

esp_ble_mesh_model_t *model

Pointer to the model which sends the previous message

esp_ble_mesh_msg_ctx_t *ctx

Pointer to the context of the previous message

struct ble_mesh_mod_recv_publish_msg_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_CLIENT_MODEL_RECV_PUBLISH_MSG_EVT.

Public Members

uint32_t opcode

Opcode of the unsoliciated received message

esp_ble_mesh_model_t *model

Pointer to the model which receives the message

esp_ble_mesh_msg_ctx_t *ctx

Pointer to the context of the message

uint16_t length

Length of the received message

uint8_t *msg

Value of the received message

struct ble_mesh_model_operation_evt_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_MODEL_OPERATION_EVT.

Public Members

uint32_t opcode

Opcode of the recieved message

esp_ble_mesh_model_t *model

Pointer to the model which receives the message

esp_ble_mesh_msg_ctx_t *ctx

Pointer to the context of the received message

uint16_t length

Length of the received message

uint8_t *msg

Value of the received message

struct ble_mesh_model_publish_comp_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_MODEL_PUBLISH_COMP_EVT.

Public Members

int err_code

Indicate the result of publishing a message

esp_ble_mesh_model_t *model

Pointer to the model which publishes the message

struct ble_mesh_model_publish_update_evt_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_MODEL_PUBLISH_UPDATE_EVT.

Public Members

esp_ble_mesh_model_t *model

Pointer to the model which is going to update its publish message

struct ble_mesh_model_send_comp_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_MODEL_SEND_COMP_EVT.

Public Members

int err_code

Indicate the result of sending a message

uint32_t opcode

Opcode of the message

esp_ble_mesh_model_t *model

Pointer to the model which sends the message

esp_ble_mesh_msg_ctx_t *ctx

Context of the message

struct ble_mesh_server_model_update_state_comp_param
#include <esp_ble_mesh_defs.h>

ESP_BLE_MESH_SERVER_MODEL_UPDATE_STATE_COMP_EVT.

Public Members

int err_code

Indicate the result of updating server model state

esp_ble_mesh_model_t *model

Pointer to the server model which state value is updated

esp_ble_mesh_server_state_type_t type

Type of the updated server state

Structures

struct esp_ble_mesh_elem_t

Abstraction that describes a BLE Mesh Element. This structure is associated with struct bt_mesh_elem in mesh_access.h

Public Members

uint16_t element_addr

Element Address, assigned during provisioning.

const uint16_t location

Location Descriptor (GATT Bluetooth Namespace Descriptors)

const uint8_t sig_model_count

SIG Model count

const uint8_t vnd_model_count

Vendor Model count

esp_ble_mesh_model_t *sig_models

SIG Models

esp_ble_mesh_model_t *vnd_models

Vendor Models

struct esp_ble_mesh_model_pub_t

Abstraction that describes a model publication context. This structure is associated with struct bt_mesh_model_pub in mesh_access.h

Public Members

esp_ble_mesh_model_t *model

Pointer to the model to which the context belongs. Initialized by the stack.

uint16_t publish_addr

Publish Address.

uint16_t app_idx

Publish AppKey Index.

uint8_t ttl

Publish Time to Live.

uint8_t retransmit

Retransmit Count & Interval Steps.

uint8_t period

Publish Period.

uint16_t period_div

Divisor for the Period.

uint16_t cred

Friendship Credentials Flag.

uint16_t fast_period

Use FastPeriodDivisor

uint16_t count

Retransmissions left.

uint32_t period_start

Start of the current period.

struct net_buf_simple *msg

Publication buffer, containing the publication message.

This will get correctly created when the publication context has been defined using the ESP_BLE_MESH_MODEL_PUB_DEFINE macro.

ESP_BLE_MESH_MODEL_PUB_DEFINE(name, size);

esp_ble_mesh_cb_t update

Callback used to update publish message. Initialized by the stack.

uint8_t dev_role

Role of the device that is going to publish messages

struct k_delayed_work timer

Publish Period Timer. Initialized by the stack.

struct esp_ble_mesh_model_op_t

Abstraction that describes a model operation context. This structure is associated with struct bt_mesh_model_op in mesh_access.h

Public Members

const uint32_t opcode

Message opcode

const size_t min_len

Message minimum length

esp_ble_mesh_cb_t param_cb

Callback used to handle message. Initialized by the stack.

struct esp_ble_mesh_model

Abstraction that describes a Mesh Model instance. This structure is associated with struct bt_mesh_model in mesh_access.h

Public Members

union esp_ble_mesh_model::[anonymous] [anonymous]

Model ID

uint8_t element_idx

Internal information, mainly for persistent storage Belongs to Nth element

uint8_t model_idx

Is the Nth model in the element

uint16_t flags

Information about what has changed

esp_ble_mesh_elem_t *element

The Element to which this Model belongs

esp_ble_mesh_model_pub_t *const pub

Model Publication

uint16_t keys[CONFIG_BLE_MESH_MODEL_KEY_COUNT]

AppKey List

uint16_t groups[CONFIG_BLE_MESH_MODEL_GROUP_COUNT]

Subscription List (group or virtual addresses)

esp_ble_mesh_model_op_t *op

Model operation context

void *user_data

Model-specific user data

struct esp_ble_mesh_msg_ctx_t

Message sending context. This structure is associated with struct bt_mesh_msg_ctx in mesh_access.h

Public Members

uint16_t net_idx

NetKey Index of the subnet through which to send the message.

uint16_t app_idx

AppKey Index for message encryption.

uint16_t addr

Remote address.

uint16_t recv_dst

Destination address of a received message. Not used for sending.

uint8_t recv_ttl

Received TTL value. Not used for sending.

uint8_t send_rel

Force sending reliably by using segment acknowledgement

uint8_t send_ttl

TTL, or BLE_MESH_TTL_DEFAULT for default TTL.

uint32_t recv_op

Opcode of a received message. Not used for sending message.

esp_ble_mesh_model_t *model

Model corresponding to the message, no need to be initialized before sending message

bool srv_send

Indicate if the message is sent by a node server model, no need to be initialized before sending message

struct esp_ble_mesh_prov_t

Provisioning properties & capabilities. This structure is associated with struct bt_mesh_prov in mesh_access.h

struct esp_ble_mesh_comp_t

Node Composition data context. This structure is associated with struct bt_mesh_comp in mesh_access.h

Public Members

uint16_t cid

16-bit SIG-assigned company identifier

uint16_t pid

16-bit vendor-assigned product identifier

uint16_t vid

16-bit vendor-assigned product version identifier

size_t element_count

Element count

esp_ble_mesh_elem_t *elements

A sequence of elements

struct esp_ble_mesh_unprov_dev_add_t

Information of the device which is going to be added for provisioning.

Public Members

esp_ble_mesh_bd_addr_t addr

Device address

esp_ble_mesh_addr_type_t addr_type

Device address type

uint8_t uuid[16]

Device UUID

uint16_t oob_info

Device OOB Info ADD_DEV_START_PROV_NOW_FLAG shall not be set if the bearer has both PB-ADV and PB-GATT enabled

esp_ble_mesh_prov_bearer_t bearer

Provisioning Bearer

struct esp_ble_mesh_device_delete_t

Information of the device which is going to be deleted.

Public Members

esp_ble_mesh_bd_addr_t addr

Device address

esp_ble_mesh_addr_type_t addr_type

Device address type

uint8_t uuid[16]

Device UUID

uint8_t flag

BIT0: device address; BIT1: device UUID

struct esp_ble_mesh_prov_data_info_t

Information of the provisioner which is going to be updated.

Public Members

uint16_t net_idx

NetKey Index

uint8_t flags

Flags

uint32_t iv_index

IV Index

uint8_t flag

BIT0: net_idx; BIT1: flags; BIT2: iv_index

struct esp_ble_mesh_fast_prov_info_t

Context of fast provisioning which need to be set.

Public Members

uint16_t unicast_min

Minimum unicast address used for fast provisioning

uint16_t unicast_max

Maximum unicast address used for fast provisioning

uint16_t net_idx

Netkey index used for fast provisioning

uint8_t flags

Flags used for fast provisioning

uint32_t iv_index

IV Index used for fast provisioning

uint8_t offset

Offset of the UUID to be compared

uint8_t match_len

Length of the UUID to be compared

uint8_t match_val[16]

Value of UUID to be compared

struct esp_ble_mesh_client_op_pair_t

BLE Mesh client models related definitions.

Client model Get/Set message opcode and corresponding Status message opcode

Public Members

uint32_t cli_op

The client message opcode

uint32_t status_op

The server status opcode corresponding to the client message opcode

struct esp_ble_mesh_client_t

Client Model user data context.

Public Members

esp_ble_mesh_model_t *model

Pointer to the client model. Initialized by the stack.

int op_pair_size

Size of the op_pair

const esp_ble_mesh_client_op_pair_t *op_pair

Table containing get/set message opcode and corresponding status message opcode

uint32_t publish_status

Callback used to handle the received unsoliciated message. Initialized by the stack.

void *internal_data

Pointer to the internal data of client model

uint8_t msg_role

Role of the device (Node/Provisioner) that is going to send messages

struct esp_ble_mesh_client_common_param_t

Common parameters of the messages sent by Client Model.

Public Members

esp_ble_mesh_opcode_t opcode

Message opcode

esp_ble_mesh_model_t *model

Pointer to the client model structure

esp_ble_mesh_msg_ctx_t ctx

The context used to send message

int32_t msg_timeout

Timeout value (ms) to get response to the sent message Note: if using default timeout value in menuconfig, make sure to set this value to 0

uint8_t msg_role

Role of the device - Node/Provisioner

struct esp_ble_mesh_state_transition_t

Parameters of the server model state transition

Public Functions

BLE_MESH_ATOMIC_DEFINE(flag, ESP_BLE_MESH_SERVER_FLAG_MAX)

Flag used to indicate if the transition timer has been started internally.

If the model which contains esp_ble_mesh_state_transition_t sets “set_auto_rsp” to ESP_BLE_MESH_SERVER_RSP_BY_APP, the handler of the timer shall be initialized by the users.

And users can use this flag to indicate whether the timer is started or not.

Public Members

bool just_started

Indicate if the state transition has just started

uint8_t trans_time

State transition time

uint8_t remain_time

Remaining time of state transition

uint8_t delay

Delay before starting state transition

uint32_t quo_tt

Duration of each divided transition step

uint32_t counter

Number of steps which the transition duration is divided

uint32_t total_duration

State transition total duration

int64_t start_timestamp

Time when the state transition is started

struct k_delayed_work timer

Timer used for state transition

struct esp_ble_mesh_last_msg_info_t

Parameters of the server model received last same set message.

Public Members

uint8_t tid

Transaction number of the last message

uint16_t src

Source address of the last message

uint16_t dst

Destination address of the last messgae

int64_t timestamp

Time when the last message is received

struct esp_ble_mesh_server_rsp_ctrl_t

Parameters of the Server Model response control

Public Members

uint8_t get_auto_rsp

BLE Mesh Server Response Option.

  1. If get_auto_rsp is set to ESP_BLE_MESH_SERVER_RSP_BY_APP, then the response of Client Get messages need to be replied by the application;
  2. If get_auto_rsp is set to ESP_BLE_MESH_SERVER_AUTO_RSP, then the response of Client Get messages will be replied by the server models;
  3. If set_auto_rsp is set to ESP_BLE_MESH_SERVER_RSP_BY_APP, then the response of Client Set messages need to be replied by the application;
  4. If set_auto_rsp is set to ESP_BLE_MESH_SERVER_AUTO_RSP, then the response of Client Set messages will be replied by the server models;
  5. If status_auto_rsp is set to ESP_BLE_MESH_SERVER_RSP_BY_APP, then the response of Server Status messages need to be replied by the application;
  6. If status_auto_rsp is set to ESP_BLE_MESH_SERVER_AUTO_RSP, then the response of Server Status messages will be replied by the server models;Response control for Client Get messages

uint8_t set_auto_rsp

Response control for Client Set messages

uint8_t status_auto_rsp

Response control for Server Status messages

Macros

ESP_BLE_HOST_STATUS_ENABLED
ESP_BLE_HOST_STATUS_CHECK(status)

The maximum length of a BLE Mesh message, including Opcode, Payload and TransMIC

ESP_BLE_MESH_SDU_MAX_LEN

The maximum length of a BLE Mesh provisioned node name

ESP_BLE_MESH_NODE_NAME_MAX_LEN

The maximum length of a BLE Mesh unprovisioned device name

ESP_BLE_MESH_DEVICE_NAME_MAX_LEN

Define the BLE Mesh octet 16 bytes size

ESP_BLE_MESH_OCTET16_LEN
ESP_BLE_MESH_OCTET8_LEN
ESP_BLE_MESH_ADDR_UNASSIGNED
ESP_BLE_MESH_ADDR_ALL_NODES
ESP_BLE_MESH_ADDR_PROXIES
ESP_BLE_MESH_ADDR_FRIENDS
ESP_BLE_MESH_ADDR_RELAYS
ESP_BLE_MESH_KEY_UNUSED
ESP_BLE_MESH_KEY_DEV
ESP_BLE_MESH_KEY_PRIMARY
ESP_BLE_MESH_KEY_ANY

Primary Network Key index

ESP_BLE_MESH_NET_PRIMARY

Relay state value

ESP_BLE_MESH_RELAY_DISABLED
ESP_BLE_MESH_RELAY_ENABLED
ESP_BLE_MESH_RELAY_NOT_SUPPORTED

Beacon state value

ESP_BLE_MESH_BEACON_DISABLED
ESP_BLE_MESH_BEACON_ENABLED

GATT Proxy state value

ESP_BLE_MESH_GATT_PROXY_DISABLED
ESP_BLE_MESH_GATT_PROXY_ENABLED
ESP_BLE_MESH_GATT_PROXY_NOT_SUPPORTED

Friend state value

ESP_BLE_MESH_FRIEND_DISABLED
ESP_BLE_MESH_FRIEND_ENABLED
ESP_BLE_MESH_FRIEND_NOT_SUPPORTED

Node identity state value

ESP_BLE_MESH_NODE_IDENTITY_STOPPED
ESP_BLE_MESH_NODE_IDENTITY_RUNNING
ESP_BLE_MESH_NODE_IDENTITY_NOT_SUPPORTED

Supported features

ESP_BLE_MESH_FEATURE_RELAY
ESP_BLE_MESH_FEATURE_PROXY
ESP_BLE_MESH_FEATURE_FRIEND
ESP_BLE_MESH_FEATURE_LOW_POWER
ESP_BLE_MESH_FEATURE_ALL_SUPPORTED
ESP_BLE_MESH_ADDR_IS_UNICAST(addr)
ESP_BLE_MESH_ADDR_IS_GROUP(addr)
ESP_BLE_MESH_ADDR_IS_VIRTUAL(addr)
ESP_BLE_MESH_ADDR_IS_RFU(addr)
ESP_BLE_MESH_INVALID_NODE_INDEX
ESP_BLE_MESH_TRANSMIT(count, int_ms)

Encode transmission count & interval steps.

Note
For example, ESP_BLE_MESH_TRANSMIT(2, 20) means that the message will be sent about 90ms(count is 3, step is 1, interval is 30 ms which includes 10ms of advertising interval random delay).
Return
BLE Mesh transmit value that can be used e.g. for the default values of the Configuration Model data.
Parameters
  • count: Number of retransmissions (first transmission is excluded).
  • int_ms: Interval steps in milliseconds. Must be greater than 0 and a multiple of 10.

ESP_BLE_MESH_GET_TRANSMIT_COUNT(transmit)

Decode transmit count from a transmit value.

Return
Transmission count (actual transmissions equal to N + 1).
Parameters
  • transmit: Encoded transmit count & interval value.

ESP_BLE_MESH_GET_TRANSMIT_INTERVAL(transmit)

Decode transmit interval from a transmit value.

Return
Transmission interval in milliseconds.
Parameters
  • transmit: Encoded transmit count & interval value.

ESP_BLE_MESH_PUBLISH_TRANSMIT(count, int_ms)

Encode Publish Retransmit count & interval steps.

Return
BLE Mesh transmit value that can be used e.g. for the default values of the Configuration Model data.
Parameters
  • count: Number of retransmissions (first transmission is excluded).
  • int_ms: Interval steps in milliseconds. Must be greater than 0 and a multiple of 50.

ESP_BLE_MESH_GET_PUBLISH_TRANSMIT_COUNT(transmit)

Decode Publish Retransmit count from a given value.

Return
Retransmission count (actual transmissions equal to N + 1).
Parameters
  • transmit: Encoded Publish Retransmit count & interval value.

ESP_BLE_MESH_GET_PUBLISH_TRANSMIT_INTERVAL(transmit)

Decode Publish Retransmit interval from a given value.

Callbacks which are not needed to be initialized by users (set with 0 and will be initialized internally)

Return
Transmission interval in milliseconds.
Parameters
  • transmit: Encoded Publish Retransmit count & interval value.

ESP_BLE_MESH_MODEL_OP_1(b0)
ESP_BLE_MESH_MODEL_OP_2(b0, b1)
ESP_BLE_MESH_MODEL_OP_3(b0, cid)

This macro is associated with BLE_MESH_MODEL in mesh_access.h

ESP_BLE_MESH_SIG_MODEL(_id, _op, _pub, _user_data)

This macro is associated with BLE_MESH_MODEL_VND in mesh_access.h

ESP_BLE_MESH_VENDOR_MODEL(_company, _id, _op, _pub, _user_data)
ESP_BLE_MESH_ELEMENT(_loc, _mods, _vnd_mods)

Helper to define a BLE Mesh element within an array.

In case the element has no SIG or Vendor models, the helper macro ESP_BLE_MESH_MODEL_NONE can be given instead.

Note
This macro is associated with BLE_MESH_ELEM in mesh_access.h
Parameters
  • _loc: Location Descriptor.
  • _mods: Array of SIG models.
  • _vnd_mods: Array of vendor models.

ESP_BLE_MESH_PROV(uuid, sta_val, sta_val_len, out_size, out_act, in_size, in_act)
BT_OCTET32_LEN
BD_ADDR_LEN
ESP_BLE_MESH_MODEL_PUB_DEFINE(_name, _msg_len, _role)

Define a model publication context.

Parameters
  • _name: Variable name given to the context.
  • _msg_len: Length of the publication message.
  • _role: Role of the device which contains the model.

ESP_BLE_MESH_MODEL_OP(_opcode, _min_len)

Define a model operation context.

Parameters
  • _opcode: Message opcode.
  • _min_len: Message minimum length.

ESP_BLE_MESH_MODEL_OP_END

Define the terminator for the model operation table. Each model operation struct array must use this terminator as the end tag of the operation unit.

ESP_BLE_MESH_MODEL_NONE

Helper to define an empty model array. This structure is associated with BLE_MESH_MODEL_NONE in mesh_access.h

ADD_DEV_RM_AFTER_PROV_FLAG

Device will be removed from queue after provisioned successfully

ADD_DEV_START_PROV_NOW_FLAG

Start provisioning device immediately

ADD_DEV_FLUSHABLE_DEV_FLAG

Device can be remove when queue is full and new device is going to added

DEL_DEV_ADDR_FLAG
DEL_DEV_UUID_FLAG
PROV_DATA_NET_IDX_FLAG
PROV_DATA_FLAGS_FLAG
PROV_DATA_IV_INDEX_FLAG
ESP_BLE_MESH_MODEL_ID_CONFIG_SRV

BLE Mesh models related Model ID and Opcode definitions.

< Foundation Models

ESP_BLE_MESH_MODEL_ID_CONFIG_CLI
ESP_BLE_MESH_MODEL_ID_HEALTH_SRV
ESP_BLE_MESH_MODEL_ID_HEALTH_CLI

Models from the Mesh Model Specification

ESP_BLE_MESH_MODEL_ID_GEN_ONOFF_SRV
ESP_BLE_MESH_MODEL_ID_GEN_ONOFF_CLI
ESP_BLE_MESH_MODEL_ID_GEN_LEVEL_SRV
ESP_BLE_MESH_MODEL_ID_GEN_LEVEL_CLI
ESP_BLE_MESH_MODEL_ID_GEN_DEF_TRANS_TIME_SRV
ESP_BLE_MESH_MODEL_ID_GEN_DEF_TRANS_TIME_CLI
ESP_BLE_MESH_MODEL_ID_GEN_POWER_ONOFF_SRV
ESP_BLE_MESH_MODEL_ID_GEN_POWER_ONOFF_SETUP_SRV
ESP_BLE_MESH_MODEL_ID_GEN_POWER_ONOFF_CLI
ESP_BLE_MESH_MODEL_ID_GEN_POWER_LEVEL_SRV
ESP_BLE_MESH_MODEL_ID_GEN_POWER_LEVEL_SETUP_SRV
ESP_BLE_MESH_MODEL_ID_GEN_POWER_LEVEL_CLI
ESP_BLE_MESH_MODEL_ID_GEN_BATTERY_SRV
ESP_BLE_MESH_MODEL_ID_GEN_BATTERY_CLI
ESP_BLE_MESH_MODEL_ID_GEN_LOCATION_SRV
ESP_BLE_MESH_MODEL_ID_GEN_LOCATION_SETUP_SRV
ESP_BLE_MESH_MODEL_ID_GEN_LOCATION_CLI
ESP_BLE_MESH_MODEL_ID_GEN_ADMIN_PROP_SRV
ESP_BLE_MESH_MODEL_ID_GEN_MANUFACTURER_PROP_SRV
ESP_BLE_MESH_MODEL_ID_GEN_USER_PROP_SRV
ESP_BLE_MESH_MODEL_ID_GEN_CLIENT_PROP_SRV
ESP_BLE_MESH_MODEL_ID_GEN_PROP_CLI
ESP_BLE_MESH_MODEL_ID_SENSOR_SRV
ESP_BLE_MESH_MODEL_ID_SENSOR_SETUP_SRV
ESP_BLE_MESH_MODEL_ID_SENSOR_CLI
ESP_BLE_MESH_MODEL_ID_TIME_SRV
ESP_BLE_MESH_MODEL_ID_TIME_SETUP_SRV
ESP_BLE_MESH_MODEL_ID_TIME_CLI
ESP_BLE_MESH_MODEL_ID_SCENE_SRV
ESP_BLE_MESH_MODEL_ID_SCENE_SETUP_SRV
ESP_BLE_MESH_MODEL_ID_SCENE_CLI
ESP_BLE_MESH_MODEL_ID_SCHEDULER_SRV
ESP_BLE_MESH_MODEL_ID_SCHEDULER_SETUP_SRV
ESP_BLE_MESH_MODEL_ID_SCHEDULER_CLI
ESP_BLE_MESH_MODEL_ID_LIGHT_LIGHTNESS_SRV
ESP_BLE_MESH_MODEL_ID_LIGHT_LIGHTNESS_SETUP_SRV
ESP_BLE_MESH_MODEL_ID_LIGHT_LIGHTNESS_CLI
ESP_BLE_MESH_MODEL_ID_LIGHT_CTL_SRV
ESP_BLE_MESH_MODEL_ID_LIGHT_CTL_SETUP_SRV
ESP_BLE_MESH_MODEL_ID_LIGHT_CTL_CLI
ESP_BLE_MESH_MODEL_ID_LIGHT_CTL_TEMP_SRV
ESP_BLE_MESH_MODEL_ID_LIGHT_HSL_SRV
ESP_BLE_MESH_MODEL_ID_LIGHT_HSL_SETUP_SRV
ESP_BLE_MESH_MODEL_ID_LIGHT_HSL_CLI
ESP_BLE_MESH_MODEL_ID_LIGHT_HSL_HUE_SRV
ESP_BLE_MESH_MODEL_ID_LIGHT_HSL_SAT_SRV
ESP_BLE_MESH_MODEL_ID_LIGHT_XYL_SRV
ESP_BLE_MESH_MODEL_ID_LIGHT_XYL_SETUP_SRV
ESP_BLE_MESH_MODEL_ID_LIGHT_XYL_CLI
ESP_BLE_MESH_MODEL_ID_LIGHT_LC_SRV
ESP_BLE_MESH_MODEL_ID_LIGHT_LC_SETUP_SRV
ESP_BLE_MESH_MODEL_ID_LIGHT_LC_CLI
ESP_BLE_MESH_MODEL_OP_BEACON_GET

Config Beacon Get

ESP_BLE_MESH_MODEL_OP_COMPOSITION_DATA_GET

Config Composition Data Get

ESP_BLE_MESH_MODEL_OP_DEFAULT_TTL_GET

Config Default TTL Get

ESP_BLE_MESH_MODEL_OP_GATT_PROXY_GET

Config GATT Proxy Get

ESP_BLE_MESH_MODEL_OP_RELAY_GET

Config Relay Get

ESP_BLE_MESH_MODEL_OP_MODEL_PUB_GET

Config Model Publication Get

ESP_BLE_MESH_MODEL_OP_FRIEND_GET

Config Friend Get

ESP_BLE_MESH_MODEL_OP_HEARTBEAT_PUB_GET

Config Heartbeat Publication Get

ESP_BLE_MESH_MODEL_OP_HEARTBEAT_SUB_GET

Config Heartbeat Subscription Get

ESP_BLE_MESH_MODEL_OP_NET_KEY_GET

Config NetKey Get

ESP_BLE_MESH_MODEL_OP_APP_KEY_GET

Config AppKey Get

ESP_BLE_MESH_MODEL_OP_NODE_IDENTITY_GET

Config Node Identity Get

ESP_BLE_MESH_MODEL_OP_SIG_MODEL_SUB_GET

Config SIG Model Subscription Get

ESP_BLE_MESH_MODEL_OP_VENDOR_MODEL_SUB_GET

Config Vendor Model Subscription Get

ESP_BLE_MESH_MODEL_OP_SIG_MODEL_APP_GET

Config SIG Model App Get

ESP_BLE_MESH_MODEL_OP_VENDOR_MODEL_APP_GET

Config Vendor Model App Get

ESP_BLE_MESH_MODEL_OP_KEY_REFRESH_PHASE_GET

Config Key Refresh Phase Get

ESP_BLE_MESH_MODEL_OP_LPN_POLLTIMEOUT_GET

Config Low Power Node PollTimeout Get

ESP_BLE_MESH_MODEL_OP_NETWORK_TRANSMIT_GET

Config Network Transmit Get

ESP_BLE_MESH_MODEL_OP_BEACON_SET

Config Beacon Set

ESP_BLE_MESH_MODEL_OP_DEFAULT_TTL_SET

Config Default TTL Set

ESP_BLE_MESH_MODEL_OP_GATT_PROXY_SET

Config GATT Proxy Set

ESP_BLE_MESH_MODEL_OP_RELAY_SET

Config Relay Set

ESP_BLE_MESH_MODEL_OP_MODEL_PUB_SET

Config Model Publication Set

ESP_BLE_MESH_MODEL_OP_MODEL_SUB_ADD

Config Model Subscription Add

ESP_BLE_MESH_MODEL_OP_MODEL_SUB_VIRTUAL_ADDR_ADD

Config Model Subscription Vritual Address Add

ESP_BLE_MESH_MODEL_OP_MODEL_SUB_DELETE

Config Model Subscription Delete

ESP_BLE_MESH_MODEL_OP_MODEL_SUB_VIRTUAL_ADDR_DELETE

Config Model Subscription Virtual Address Delete

ESP_BLE_MESH_MODEL_OP_MODEL_SUB_OVERWRITE

Config Model Subscription Overwrite

ESP_BLE_MESH_MODEL_OP_MODEL_SUB_VIRTUAL_ADDR_OVERWRITE

Config Model Subscription Virtual Address Overwrite

ESP_BLE_MESH_MODEL_OP_NET_KEY_ADD

Config NetKey Add

ESP_BLE_MESH_MODEL_OP_APP_KEY_ADD

Config AppKey Add

ESP_BLE_MESH_MODEL_OP_MODEL_APP_BIND

Config Model App Bind

ESP_BLE_MESH_MODEL_OP_NODE_RESET

Config Node Reset

ESP_BLE_MESH_MODEL_OP_FRIEND_SET

Config Friend Set

ESP_BLE_MESH_MODEL_OP_HEARTBEAT_PUB_SET

Config Heartbeat Publication Set

ESP_BLE_MESH_MODEL_OP_HEARTBEAT_SUB_SET

Config Heartbeat Subscription Set

ESP_BLE_MESH_MODEL_OP_NET_KEY_UPDATE

Config NetKey Update

ESP_BLE_MESH_MODEL_OP_NET_KEY_DELETE

Config NetKey Delete

ESP_BLE_MESH_MODEL_OP_APP_KEY_UPDATE

Config AppKey Update

ESP_BLE_MESH_MODEL_OP_APP_KEY_DELETE

Config AppKey Delete

ESP_BLE_MESH_MODEL_OP_NODE_IDENTITY_SET

Config Node Identity Set

ESP_BLE_MESH_MODEL_OP_KEY_REFRESH_PHASE_SET

Config Key Refresh Phase Set

ESP_BLE_MESH_MODEL_OP_MODEL_PUB_VIRTUAL_ADDR_SET

Config Model Publication Virtual Address Set

ESP_BLE_MESH_MODEL_OP_MODEL_SUB_DELETE_ALL

Config Model Subscription Delete All

ESP_BLE_MESH_MODEL_OP_MODEL_APP_UNBIND

Config Model App Unbind

ESP_BLE_MESH_MODEL_OP_NETWORK_TRANSMIT_SET

Config Network Transmit Set

ESP_BLE_MESH_MODEL_OP_BEACON_STATUS
ESP_BLE_MESH_MODEL_OP_COMPOSITION_DATA_STATUS
ESP_BLE_MESH_MODEL_OP_DEFAULT_TTL_STATUS
ESP_BLE_MESH_MODEL_OP_GATT_PROXY_STATUS
ESP_BLE_MESH_MODEL_OP_RELAY_STATUS
ESP_BLE_MESH_MODEL_OP_MODEL_PUB_STATUS
ESP_BLE_MESH_MODEL_OP_MODEL_SUB_STATUS
ESP_BLE_MESH_MODEL_OP_SIG_MODEL_SUB_LIST
ESP_BLE_MESH_MODEL_OP_VENDOR_MODEL_SUB_LIST
ESP_BLE_MESH_MODEL_OP_NET_KEY_STATUS
ESP_BLE_MESH_MODEL_OP_NET_KEY_LIST
ESP_BLE_MESH_MODEL_OP_APP_KEY_STATUS
ESP_BLE_MESH_MODEL_OP_APP_KEY_LIST
ESP_BLE_MESH_MODEL_OP_NODE_IDENTITY_STATUS
ESP_BLE_MESH_MODEL_OP_MODEL_APP_STATUS
ESP_BLE_MESH_MODEL_OP_SIG_MODEL_APP_LIST
ESP_BLE_MESH_MODEL_OP_VENDOR_MODEL_APP_LIST
ESP_BLE_MESH_MODEL_OP_NODE_RESET_STATUS
ESP_BLE_MESH_MODEL_OP_FRIEND_STATUS
ESP_BLE_MESH_MODEL_OP_KEY_REFRESH_PHASE_STATUS
ESP_BLE_MESH_MODEL_OP_HEARTBEAT_PUB_STATUS
ESP_BLE_MESH_MODEL_OP_HEARTBEAT_SUB_STATUS
ESP_BLE_MESH_MODEL_OP_LPN_POLLTIMEOUT_STATUS
ESP_BLE_MESH_MODEL_OP_NETWORK_TRANSMIT_STATUS
ESP_BLE_MESH_CFG_STATUS_SUCCESS
ESP_BLE_MESH_CFG_STATUS_INVALID_ADDRESS
ESP_BLE_MESH_CFG_STATUS_INVALID_MODEL
ESP_BLE_MESH_CFG_STATUS_INVALID_APPKEY
ESP_BLE_MESH_CFG_STATUS_INVALID_NETKEY
ESP_BLE_MESH_CFG_STATUS_INSUFFICIENT_RESOURCES
ESP_BLE_MESH_CFG_STATUS_KEY_INDEX_ALREADY_STORED
ESP_BLE_MESH_CFG_STATUS_INVALID_PUBLISH_PARAMETERS
ESP_BLE_MESH_CFG_STATUS_NOT_A_SUBSCRIBE_MODEL
ESP_BLE_MESH_CFG_STATUS_STORAGE_FAILURE
ESP_BLE_MESH_CFG_STATUS_FEATURE_NOT_SUPPORTED
ESP_BLE_MESH_CFG_STATUS_CANNOT_UPDATE
ESP_BLE_MESH_CFG_STATUS_CANNOT_REMOVE
ESP_BLE_MESH_CFG_STATUS_CANNOT_BIND
ESP_BLE_MESH_CFG_STATUS_TEMP_UNABLE_TO_CHANGE_STATE
ESP_BLE_MESH_CFG_STATUS_CANNOT_SET
ESP_BLE_MESH_CFG_STATUS_UNSPECIFIED_ERROR
ESP_BLE_MESH_CFG_STATUS_INVALID_BINDING
ESP_BLE_MESH_MODEL_OP_HEALTH_FAULT_GET

Health Fault Get

ESP_BLE_MESH_MODEL_OP_HEALTH_PERIOD_GET

Health Period Get

ESP_BLE_MESH_MODEL_OP_ATTENTION_GET

Health Attention Get

ESP_BLE_MESH_MODEL_OP_HEALTH_FAULT_CLEAR

Health Fault Clear

ESP_BLE_MESH_MODEL_OP_HEALTH_FAULT_CLEAR_UNACK

Health Fault Clear Unacknowledged

ESP_BLE_MESH_MODEL_OP_HEALTH_FAULT_TEST

Health Fault Test

ESP_BLE_MESH_MODEL_OP_HEALTH_FAULT_TEST_UNACK

Health Fault Test Unacknowledged

ESP_BLE_MESH_MODEL_OP_HEALTH_PERIOD_SET

Health Period Set

ESP_BLE_MESH_MODEL_OP_HEALTH_PERIOD_SET_UNACK

Health Period Set Unacknowledged

ESP_BLE_MESH_MODEL_OP_ATTENTION_SET

Health Attention Set

ESP_BLE_MESH_MODEL_OP_ATTENTION_SET_UNACK

Health Attention Set Unacknowledged

ESP_BLE_MESH_MODEL_OP_HEALTH_CURRENT_STATUS
ESP_BLE_MESH_MODEL_OP_HEALTH_FAULT_STATUS
ESP_BLE_MESH_MODEL_OP_HEALTH_PERIOD_STATUS
ESP_BLE_MESH_MODEL_OP_ATTENTION_STATUS
ESP_BLE_MESH_MODEL_OP_GEN_ONOFF_GET
ESP_BLE_MESH_MODEL_OP_GEN_ONOFF_SET
ESP_BLE_MESH_MODEL_OP_GEN_ONOFF_SET_UNACK
ESP_BLE_MESH_MODEL_OP_GEN_ONOFF_STATUS

Generic Level Message Opcode

ESP_BLE_MESH_MODEL_OP_GEN_LEVEL_GET
ESP_BLE_MESH_MODEL_OP_GEN_LEVEL_SET
ESP_BLE_MESH_MODEL_OP_GEN_LEVEL_SET_UNACK
ESP_BLE_MESH_MODEL_OP_GEN_LEVEL_STATUS
ESP_BLE_MESH_MODEL_OP_GEN_DELTA_SET
ESP_BLE_MESH_MODEL_OP_GEN_DELTA_SET_UNACK
ESP_BLE_MESH_MODEL_OP_GEN_MOVE_SET
ESP_BLE_MESH_MODEL_OP_GEN_MOVE_SET_UNACK

Generic Default Transition Time Message Opcode

ESP_BLE_MESH_MODEL_OP_GEN_DEF_TRANS_TIME_GET
ESP_BLE_MESH_MODEL_OP_GEN_DEF_TRANS_TIME_SET
ESP_BLE_MESH_MODEL_OP_GEN_DEF_TRANS_TIME_SET_UNACK
ESP_BLE_MESH_MODEL_OP_GEN_DEF_TRANS_TIME_STATUS

Generic Power OnOff Message Opcode

ESP_BLE_MESH_MODEL_OP_GEN_ONPOWERUP_GET
ESP_BLE_MESH_MODEL_OP_GEN_ONPOWERUP_STATUS

Generic Power OnOff Setup Message Opcode

ESP_BLE_MESH_MODEL_OP_GEN_ONPOWERUP_SET
ESP_BLE_MESH_MODEL_OP_GEN_ONPOWERUP_SET_UNACK

Generic Power Level Message Opcode

ESP_BLE_MESH_MODEL_OP_GEN_POWER_LEVEL_GET
ESP_BLE_MESH_MODEL_OP_GEN_POWER_LEVEL_SET
ESP_BLE_MESH_MODEL_OP_GEN_POWER_LEVEL_SET_UNACK
ESP_BLE_MESH_MODEL_OP_GEN_POWER_LEVEL_STATUS
ESP_BLE_MESH_MODEL_OP_GEN_POWER_LAST_GET
ESP_BLE_MESH_MODEL_OP_GEN_POWER_LAST_STATUS
ESP_BLE_MESH_MODEL_OP_GEN_POWER_DEFAULT_GET
ESP_BLE_MESH_MODEL_OP_GEN_POWER_DEFAULT_STATUS
ESP_BLE_MESH_MODEL_OP_GEN_POWER_RANGE_GET
ESP_BLE_MESH_MODEL_OP_GEN_POWER_RANGE_STATUS

Generic Power Level Setup Message Opcode

ESP_BLE_MESH_MODEL_OP_GEN_POWER_DEFAULT_SET
ESP_BLE_MESH_MODEL_OP_GEN_POWER_DEFAULT_SET_UNACK
ESP_BLE_MESH_MODEL_OP_GEN_POWER_RANGE_SET
ESP_BLE_MESH_MODEL_OP_GEN_POWER_RANGE_SET_UNACK

Generic Battery Message Opcode

ESP_BLE_MESH_MODEL_OP_GEN_BATTERY_GET
ESP_BLE_MESH_MODEL_OP_GEN_BATTERY_STATUS

Generic Location Message Opcode

ESP_BLE_MESH_MODEL_OP_GEN_LOC_GLOBAL_GET
ESP_BLE_MESH_MODEL_OP_GEN_LOC_GLOBAL_STATUS
ESP_BLE_MESH_MODEL_OP_GEN_LOC_LOCAL_GET
ESP_BLE_MESH_MODEL_OP_GEN_LOC_LOCAL_STATUS

Generic Location Setup Message Opcode

ESP_BLE_MESH_MODEL_OP_GEN_LOC_GLOBAL_SET
ESP_BLE_MESH_MODEL_OP_GEN_LOC_GLOBAL_SET_UNACK
ESP_BLE_MESH_MODEL_OP_GEN_LOC_LOCAL_SET
ESP_BLE_MESH_MODEL_OP_GEN_LOC_LOCAL_SET_UNACK

Generic Manufacturer Property Message Opcode

ESP_BLE_MESH_MODEL_OP_GEN_MANUFACTURER_PROPERTIES_GET
ESP_BLE_MESH_MODEL_OP_GEN_MANUFACTURER_PROPERTIES_STATUS
ESP_BLE_MESH_MODEL_OP_GEN_MANUFACTURER_PROPERTY_GET
ESP_BLE_MESH_MODEL_OP_GEN_MANUFACTURER_PROPERTY_SET
ESP_BLE_MESH_MODEL_OP_GEN_MANUFACTURER_PROPERTY_SET_UNACK
ESP_BLE_MESH_MODEL_OP_GEN_MANUFACTURER_PROPERTY_STATUS

Generic Admin Property Message Opcode

ESP_BLE_MESH_MODEL_OP_GEN_ADMIN_PROPERTIES_GET
ESP_BLE_MESH_MODEL_OP_GEN_ADMIN_PROPERTIES_STATUS
ESP_BLE_MESH_MODEL_OP_GEN_ADMIN_PROPERTY_GET
ESP_BLE_MESH_MODEL_OP_GEN_ADMIN_PROPERTY_SET
ESP_BLE_MESH_MODEL_OP_GEN_ADMIN_PROPERTY_SET_UNACK
ESP_BLE_MESH_MODEL_OP_GEN_ADMIN_PROPERTY_STATUS

Generic User Property Message Opcode

ESP_BLE_MESH_MODEL_OP_GEN_USER_PROPERTIES_GET
ESP_BLE_MESH_MODEL_OP_GEN_USER_PROPERTIES_STATUS
ESP_BLE_MESH_MODEL_OP_GEN_USER_PROPERTY_GET
ESP_BLE_MESH_MODEL_OP_GEN_USER_PROPERTY_SET
ESP_BLE_MESH_MODEL_OP_GEN_USER_PROPERTY_SET_UNACK
ESP_BLE_MESH_MODEL_OP_GEN_USER_PROPERTY_STATUS

Generic Client Property Message Opcode

ESP_BLE_MESH_MODEL_OP_GEN_CLIENT_PROPERTIES_GET
ESP_BLE_MESH_MODEL_OP_GEN_CLIENT_PROPERTIES_STATUS
ESP_BLE_MESH_MODEL_OP_SENSOR_DESCRIPTOR_GET
ESP_BLE_MESH_MODEL_OP_SENSOR_DESCRIPTOR_STATUS
ESP_BLE_MESH_MODEL_OP_SENSOR_GET
ESP_BLE_MESH_MODEL_OP_SENSOR_STATUS
ESP_BLE_MESH_MODEL_OP_SENSOR_COLUMN_GET
ESP_BLE_MESH_MODEL_OP_SENSOR_COLUMN_STATUS
ESP_BLE_MESH_MODEL_OP_SENSOR_SERIES_GET
ESP_BLE_MESH_MODEL_OP_SENSOR_SERIES_STATUS

Sensor Setup Message Opcode

ESP_BLE_MESH_MODEL_OP_SENSOR_CADENCE_GET
ESP_BLE_MESH_MODEL_OP_SENSOR_CADENCE_SET
ESP_BLE_MESH_MODEL_OP_SENSOR_CADENCE_SET_UNACK
ESP_BLE_MESH_MODEL_OP_SENSOR_CADENCE_STATUS
ESP_BLE_MESH_MODEL_OP_SENSOR_SETTINGS_GET
ESP_BLE_MESH_MODEL_OP_SENSOR_SETTINGS_STATUS
ESP_BLE_MESH_MODEL_OP_SENSOR_SETTING_GET
ESP_BLE_MESH_MODEL_OP_SENSOR_SETTING_SET
ESP_BLE_MESH_MODEL_OP_SENSOR_SETTING_SET_UNACK
ESP_BLE_MESH_MODEL_OP_SENSOR_SETTING_STATUS
ESP_BLE_MESH_MODEL_OP_TIME_GET
ESP_BLE_MESH_MODEL_OP_TIME_SET
ESP_BLE_MESH_MODEL_OP_TIME_STATUS
ESP_BLE_MESH_MODEL_OP_TIME_ROLE_GET
ESP_BLE_MESH_MODEL_OP_TIME_ROLE_SET
ESP_BLE_MESH_MODEL_OP_TIME_ROLE_STATUS
ESP_BLE_MESH_MODEL_OP_TIME_ZONE_GET
ESP_BLE_MESH_MODEL_OP_TIME_ZONE_SET
ESP_BLE_MESH_MODEL_OP_TIME_ZONE_STATUS
ESP_BLE_MESH_MODEL_OP_TAI_UTC_DELTA_GET
ESP_BLE_MESH_MODEL_OP_TAI_UTC_DELTA_SET
ESP_BLE_MESH_MODEL_OP_TAI_UTC_DELTA_STATUS

Scene Message Opcode

ESP_BLE_MESH_MODEL_OP_SCENE_GET
ESP_BLE_MESH_MODEL_OP_SCENE_RECALL
ESP_BLE_MESH_MODEL_OP_SCENE_RECALL_UNACK
ESP_BLE_MESH_MODEL_OP_SCENE_STATUS
ESP_BLE_MESH_MODEL_OP_SCENE_REGISTER_GET
ESP_BLE_MESH_MODEL_OP_SCENE_REGISTER_STATUS

Scene Setup Message Opcode

ESP_BLE_MESH_MODEL_OP_SCENE_STORE
ESP_BLE_MESH_MODEL_OP_SCENE_STORE_UNACK
ESP_BLE_MESH_MODEL_OP_SCENE_DELETE
ESP_BLE_MESH_MODEL_OP_SCENE_DELETE_UNACK

Scheduler Message Opcode

ESP_BLE_MESH_MODEL_OP_SCHEDULER_ACT_GET
ESP_BLE_MESH_MODEL_OP_SCHEDULER_ACT_STATUS
ESP_BLE_MESH_MODEL_OP_SCHEDULER_GET
ESP_BLE_MESH_MODEL_OP_SCHEDULER_STATUS

Scheduler Setup Message Opcode

ESP_BLE_MESH_MODEL_OP_SCHEDULER_ACT_SET
ESP_BLE_MESH_MODEL_OP_SCHEDULER_ACT_SET_UNACK
ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_GET
ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_SET
ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_SET_UNACK
ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_STATUS
ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_LINEAR_GET
ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_LINEAR_SET
ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_LINEAR_SET_UNACK
ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_LINEAR_STATUS
ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_LAST_GET
ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_LAST_STATUS
ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_DEFAULT_GET
ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_DEFAULT_STATUS
ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_RANGE_GET
ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_RANGE_STATUS

Light Lightness Setup Message Opcode

ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_DEFAULT_SET
ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_DEFAULT_SET_UNACK
ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_RANGE_SET
ESP_BLE_MESH_MODEL_OP_LIGHT_LIGHTNESS_RANGE_SET_UNACK

Light CTL Message Opcode

ESP_BLE_MESH_MODEL_OP_LIGHT_CTL_GET
ESP_BLE_MESH_MODEL_OP_LIGHT_CTL_SET
ESP_BLE_MESH_MODEL_OP_LIGHT_CTL_SET_UNACK
ESP_BLE_MESH_MODEL_OP_LIGHT_CTL_STATUS
ESP_BLE_MESH_MODEL_OP_LIGHT_CTL_TEMPERATURE_GET
ESP_BLE_MESH_MODEL_OP_LIGHT_CTL_TEMPERATURE_RANGE_GET
ESP_BLE_MESH_MODEL_OP_LIGHT_CTL_TEMPERATURE_RANGE_STATUS
ESP_BLE_MESH_MODEL_OP_LIGHT_CTL_TEMPERATURE_SET
ESP_BLE_MESH_MODEL_OP_LIGHT_CTL_TEMPERATURE_SET_UNACK
ESP_BLE_MESH_MODEL_OP_LIGHT_CTL_TEMPERATURE_STATUS
ESP_BLE_MESH_MODEL_OP_LIGHT_CTL_DEFAULT_GET
ESP_BLE_MESH_MODEL_OP_LIGHT_CTL_DEFAULT_STATUS

Light CTL Setup Message Opcode

ESP_BLE_MESH_MODEL_OP_LIGHT_CTL_DEFAULT_SET
ESP_BLE_MESH_MODEL_OP_LIGHT_CTL_DEFAULT_SET_UNACK
ESP_BLE_MESH_MODEL_OP_LIGHT_CTL_TEMPERATURE_RANGE_SET
ESP_BLE_MESH_MODEL_OP_LIGHT_CTL_TEMPERATURE_RANGE_SET_UNACK

Light HSL Message Opcode

ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_GET
ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_HUE_GET
ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_HUE_SET
ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_HUE_SET_UNACK
ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_HUE_STATUS
ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_SATURATION_GET
ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_SATURATION_SET
ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_SATURATION_SET_UNACK
ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_SATURATION_STATUS
ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_SET
ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_SET_UNACK
ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_STATUS
ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_TARGET_GET
ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_TARGET_STATUS
ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_DEFAULT_GET
ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_DEFAULT_STATUS
ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_RANGE_GET
ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_RANGE_STATUS

Light HSL Setup Message Opcode

ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_DEFAULT_SET
ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_DEFAULT_SET_UNACK
ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_RANGE_SET
ESP_BLE_MESH_MODEL_OP_LIGHT_HSL_RANGE_SET_UNACK

Light xyL Message Opcode

ESP_BLE_MESH_MODEL_OP_LIGHT_XYL_GET
ESP_BLE_MESH_MODEL_OP_LIGHT_XYL_SET
ESP_BLE_MESH_MODEL_OP_LIGHT_XYL_SET_UNACK
ESP_BLE_MESH_MODEL_OP_LIGHT_XYL_STATUS
ESP_BLE_MESH_MODEL_OP_LIGHT_XYL_TARGET_GET
ESP_BLE_MESH_MODEL_OP_LIGHT_XYL_TARGET_STATUS
ESP_BLE_MESH_MODEL_OP_LIGHT_XYL_DEFAULT_GET
ESP_BLE_MESH_MODEL_OP_LIGHT_XYL_DEFAULT_STATUS
ESP_BLE_MESH_MODEL_OP_LIGHT_XYL_RANGE_GET
ESP_BLE_MESH_MODEL_OP_LIGHT_XYL_RANGE_STATUS

Light xyL Setup Message Opcode

ESP_BLE_MESH_MODEL_OP_LIGHT_XYL_DEFAULT_SET
ESP_BLE_MESH_MODEL_OP_LIGHT_XYL_DEFAULT_SET_UNACK
ESP_BLE_MESH_MODEL_OP_LIGHT_XYL_RANGE_SET
ESP_BLE_MESH_MODEL_OP_LIGHT_XYL_RANGE_SET_UNACK

Light Control Message Opcode

ESP_BLE_MESH_MODEL_OP_LIGHT_LC_MODE_GET
ESP_BLE_MESH_MODEL_OP_LIGHT_LC_MODE_SET
ESP_BLE_MESH_MODEL_OP_LIGHT_LC_MODE_SET_UNACK
ESP_BLE_MESH_MODEL_OP_LIGHT_LC_MODE_STATUS
ESP_BLE_MESH_MODEL_OP_LIGHT_LC_OM_GET
ESP_BLE_MESH_MODEL_OP_LIGHT_LC_OM_SET
ESP_BLE_MESH_MODEL_OP_LIGHT_LC_OM_SET_UNACK
ESP_BLE_MESH_MODEL_OP_LIGHT_LC_OM_STATUS
ESP_BLE_MESH_MODEL_OP_LIGHT_LC_LIGHT_ONOFF_GET
ESP_BLE_MESH_MODEL_OP_LIGHT_LC_LIGHT_ONOFF_SET
ESP_BLE_MESH_MODEL_OP_LIGHT_LC_LIGHT_ONOFF_SET_UNACK
ESP_BLE_MESH_MODEL_OP_LIGHT_LC_LIGHT_ONOFF_STATUS
ESP_BLE_MESH_MODEL_OP_LIGHT_LC_PROPERTY_GET
ESP_BLE_MESH_MODEL_OP_LIGHT_LC_PROPERTY_SET
ESP_BLE_MESH_MODEL_OP_LIGHT_LC_PROPERTY_SET_UNACK
ESP_BLE_MESH_MODEL_OP_LIGHT_LC_PROPERTY_STATUS
ESP_BLE_MESH_MODEL_STATUS_SUCCESS
ESP_BLE_MESH_MODEL_STATUS_CANNOT_SET_RANGE_MIN
ESP_BLE_MESH_MODEL_STATUS_CANNOT_SET_RANGE_MAX
ESP_BLE_MESH_SERVER_RSP_BY_APP

Response will be sent internally

ESP_BLE_MESH_SERVER_AUTO_RSP

Response need to be sent in the application

Type Definitions

typedef uint8_t esp_ble_mesh_octet16_t[ESP_BLE_MESH_OCTET16_LEN]

Define the BLE Mesh octet 8 bytes size

typedef uint8_t esp_ble_mesh_octet8_t[ESP_BLE_MESH_OCTET8_LEN]
typedef uint32_t esp_ble_mesh_cb_t
typedef uint8_t UINT8
typedef uint16_t UINT16
typedef uint32_t UINT32
typedef uint64_t UINT64
typedef UINT8 BT_OCTET32[BT_OCTET32_LEN]
typedef uint8_t BD_ADDR[BD_ADDR_LEN]
typedef uint8_t esp_ble_mesh_bd_addr_t[BD_ADDR_LEN]
typedef struct esp_ble_mesh_model esp_ble_mesh_model_t
typedef uint8_t esp_ble_mesh_dev_add_flag_t
typedef uint32_t esp_ble_mesh_opcode_config_client_get_t

esp_ble_mesh_opcode_config_client_get_t belongs to esp_ble_mesh_opcode_t, this typedef is only used to locate the opcodes used by esp_ble_mesh_config_client_get_state. The following opcodes will only be used in the esp_ble_mesh_config_client_get_state function.

typedef uint32_t esp_ble_mesh_opcode_config_client_set_t

esp_ble_mesh_opcode_config_client_set_t belongs to esp_ble_mesh_opcode_t, this typedef is only used to locate the opcodes used by esp_ble_mesh_config_client_set_state. The following opcodes will only be used in the esp_ble_mesh_config_client_set_state function.

typedef uint32_t esp_ble_mesh_opcode_config_status_t

esp_ble_mesh_opcode_config_status_t belongs to esp_ble_mesh_opcode_t, this typedef is only used to locate the opcodes used by the Config Model messages The following opcodes are used by the BLE Mesh Config Server Model internally to respond to the Config Client Model’s request messages.

typedef uint8_t esp_ble_mesh_cfg_status_t

This typedef is only used to indicate the status code contained in some of the Configuration Server Model status message.

typedef uint32_t esp_ble_mesh_opcode_health_client_get_t

esp_ble_mesh_opcode_health_client_get_t belongs to esp_ble_mesh_opcode_t, this typedef is only used to locate the opcodes used by esp_ble_mesh_health_client_get_state. The following opcodes will only be used in the esp_ble_mesh_health_client_get_state function.

typedef uint32_t esp_ble_mesh_opcode_health_client_set_t

esp_ble_mesh_opcode_health_client_set_t belongs to esp_ble_mesh_opcode_t, this typedef is only used to locate the opcodes used by esp_ble_mesh_health_client_set_state. The following opcodes will only be used in the esp_ble_mesh_health_client_set_state function.

typedef uint32_t esp_ble_mesh_health_model_status_t

esp_ble_mesh_health_model_status_t belongs to esp_ble_mesh_opcode_t, this typedef is only used to locate the opcodes used by the Health Model messages. The following opcodes are used by the BLE Mesh Health Server Model internally to respond to the Health Client Model’s request messages.

typedef uint32_t esp_ble_mesh_generic_message_opcode_t

esp_ble_mesh_generic_message_opcode_t belongs to esp_ble_mesh_opcode_t, this typedef is only used to locate the opcodes used by functions esp_ble_mesh_generic_client_get_state & esp_ble_mesh_generic_client_set_state.Generic OnOff Message Opcode

typedef uint32_t esp_ble_mesh_sensor_message_opcode_t

esp_ble_mesh_sensor_message_opcode_t belongs to esp_ble_mesh_opcode_t, this typedef is only used to locate the opcodes used by functions esp_ble_mesh_sensor_client_get_state & esp_ble_mesh_sensor_client_set_state.Sensor Message Opcode

typedef uint32_t esp_ble_mesh_time_scene_message_opcode_t

esp_ble_mesh_time_scene_message_opcode_t belongs to esp_ble_mesh_opcode_t, this typedef is only used to locate the opcodes used by functions esp_ble_mesh_time_scene_client_get_state & esp_ble_mesh_time_scene_client_set_state.Time Message Opcode

typedef uint32_t esp_ble_mesh_light_message_opcode_t

esp_ble_mesh_light_message_opcode_t belongs to esp_ble_mesh_opcode_t, this typedef is only used to locate the opcodes used by functions esp_ble_mesh_light_client_get_state & esp_ble_mesh_light_client_set_state.Light Lightness Message Opcode

typedef uint32_t esp_ble_mesh_opcode_t

End of defines of esp_ble_mesh_opcode_t

typedef uint8_t esp_ble_mesh_model_status_t

This typedef is only used to indicate the status code contained in some of the server models (e.g. Generic Server Model) status message.

Enumerations

enum esp_ble_mesh_cb_type_t

Values:

ESP_BLE_MESH_TYPE_PROV_CB
ESP_BLE_MESH_TYPE_OUTPUT_NUM_CB
ESP_BLE_MESH_TYPE_OUTPUT_STR_CB
ESP_BLE_MESH_TYPE_INTPUT_CB
ESP_BLE_MESH_TYPE_COMPLETE_CB
ESP_BLE_MESH_TYPE_RESET_CB
enum esp_ble_mesh_oob_method_t

Values:

ESP_BLE_MESH_NO_OOB
ESP_BLE_MESH_STATIC_OOB
ESP_BLE_MESH_OUTPUT_OOB
ESP_BLE_MESH_INPUT_OOB
enum esp_ble_mesh_output_action_t

Values:

ESP_BLE_MESH_NO_OUTPUT = 0
ESP_BLE_MESH_BEEP = BIT(1)
ESP_BLE_MESH_VIBRATE = BIT(2)
ESP_BLE_MESH_DISPLAY_NUMBER = BIT(3)
ESP_BLE_MESH_DISPLAY_STRING = BIT(4)
enum esp_ble_mesh_input_action_t

Values:

ESP_BLE_MESH_NO_INPUT = 0
ESP_BLE_MESH_PUSH = BIT(0)
ESP_BLE_MESH_TWIST = BIT(1)
ESP_BLE_MESH_ENTER_NUMBER = BIT(2)
ESP_BLE_MESH_ENTER_STRING = BIT(3)
enum esp_ble_mesh_prov_bearer_t

Values:

ESP_BLE_MESH_PROV_ADV = BIT(0)
ESP_BLE_MESH_PROV_GATT = BIT(1)
enum esp_ble_mesh_prov_oob_info_t

Values:

ESP_BLE_MESH_PROV_OOB_OTHER = BIT(0)
ESP_BLE_MESH_PROV_OOB_URI = BIT(1)
ESP_BLE_MESH_PROV_OOB_2D_CODE = BIT(2)
ESP_BLE_MESH_PROV_OOB_BAR_CODE = BIT(3)
ESP_BLE_MESH_PROV_OOB_NFC = BIT(4)
ESP_BLE_MESH_PROV_OOB_NUMBER = BIT(5)
ESP_BLE_MESH_PROV_OOB_STRING = BIT(6)
ESP_BLE_MESH_PROV_OOB_ON_BOX = BIT(11)
ESP_BLE_MESH_PROV_OOB_IN_BOX = BIT(12)
ESP_BLE_MESH_PROV_OOB_ON_PAPER = BIT(13)
ESP_BLE_MESH_PROV_OOB_IN_MANUAL = BIT(14)
ESP_BLE_MESH_PROV_OOB_ON_DEV = BIT(15)
enum esp_ble_mesh_addr_type_t

BLE device address type.

Values:

ESP_BLE_MESH_ADDR_TYPE_PUBLIC = 0x00
ESP_BLE_MESH_ADDR_TYPE_RANDOM = 0x01
ESP_BLE_MESH_ADDR_TYPE_RPA_PUBLIC = 0x02
ESP_BLE_MESH_ADDR_TYPE_RPA_RANDOM = 0x03
enum esp_ble_mesh_dev_role_t

Values:

ROLE_NODE = 0
ROLE_PROVISIONER
ROLE_FAST_PROV
enum esp_ble_mesh_fast_prov_action_t

Values:

FAST_PROV_ACT_NONE
FAST_PROV_ACT_ENTER
FAST_PROV_ACT_SUSPEND
FAST_PROV_ACT_EXIT
FAST_PROV_ACT_MAX
enum esp_ble_mesh_proxy_filter_type_t

Values:

PROXY_FILTER_WHITELIST
PROXY_FILTER_BLACKLIST
enum esp_ble_mesh_prov_cb_event_t

Values:

ESP_BLE_MESH_PROV_REGISTER_COMP_EVT

Initialize BLE Mesh provisioning capabilities and internal data information completion event

ESP_BLE_MESH_NODE_SET_UNPROV_DEV_NAME_COMP_EVT

Set the unprovisioned device name completion event

ESP_BLE_MESH_NODE_PROV_ENABLE_COMP_EVT

Enable node provisioning functionality completion event

ESP_BLE_MESH_NODE_PROV_DISABLE_COMP_EVT

Disable node provisioning functionality completion event

Establish a BLE Mesh link event

Close a BLE Mesh link event

ESP_BLE_MESH_NODE_PROV_OOB_PUB_KEY_EVT

Generate Node input OOB public key event

ESP_BLE_MESH_NODE_PROV_OUTPUT_NUMBER_EVT

Generate Node Output Number event

ESP_BLE_MESH_NODE_PROV_OUTPUT_STRING_EVT

Generate Node Output String event

ESP_BLE_MESH_NODE_PROV_INPUT_EVT

Event requiring the user to input a number or string

ESP_BLE_MESH_NODE_PROV_COMPLETE_EVT

Provisioning done event

ESP_BLE_MESH_NODE_PROV_RESET_EVT

Provisioning reset event

ESP_BLE_MESH_NODE_PROV_SET_OOB_PUB_KEY_COMP_EVT

Node set oob public key completion event

ESP_BLE_MESH_NODE_PROV_INPUT_NUMBER_COMP_EVT

Node input number completion event

ESP_BLE_MESH_NODE_PROV_INPUT_STRING_COMP_EVT

Node input string completion event

ESP_BLE_MESH_NODE_PROXY_IDENTITY_ENABLE_COMP_EVT

Enable BLE Mesh Proxy Identity advertising completion event

ESP_BLE_MESH_NODE_PROXY_GATT_ENABLE_COMP_EVT

Enable BLE Mesh GATT Proxy Service completion event

ESP_BLE_MESH_NODE_PROXY_GATT_DISABLE_COMP_EVT

Disable BLE Mesh GATT Proxy Service completion event

ESP_BLE_MESH_PROVISIONER_PROV_ENABLE_COMP_EVT

Provisioner enable provisioning functionality completion event

ESP_BLE_MESH_PROVISIONER_PROV_DISABLE_COMP_EVT

Provisioner disable provisioning functionality completion event

ESP_BLE_MESH_PROVISIONER_RECV_UNPROV_ADV_PKT_EVT

Provisioner receives unprovisioned device beacon event

ESP_BLE_MESH_PROVISIONER_PROV_READ_OOB_PUB_KEY_EVT

Provisioner read unprovisioned device OOB public key event

ESP_BLE_MESH_PROVISIONER_PROV_INPUT_EVT

Provisioner input value for provisioning procedure event

ESP_BLE_MESH_PROVISIONER_PROV_OUTPUT_EVT

Provisioner output value for provisioning procedure event

Provisioner establish a BLE Mesh link event

Provisioner close a BLE Mesh link event

ESP_BLE_MESH_PROVISIONER_PROV_COMPLETE_EVT

Provisioner provisioning done event

ESP_BLE_MESH_PROVISIONER_ADD_UNPROV_DEV_COMP_EVT

Provisioner add a device to the list which contains devices that are waiting/going to be provisioned completion event

ESP_BLE_MESH_PROVISIONER_DELETE_DEV_COMP_EVT

Provisioner delete a device from the list, close provisioning link with the device if it exists and remove the device from network completion event

ESP_BLE_MESH_PROVISIONER_SET_DEV_UUID_MATCH_COMP_EVT

Provisioner set the value to be compared with part of the unprovisioned device UUID completion event

ESP_BLE_MESH_PROVISIONER_SET_PROV_DATA_INFO_COMP_EVT

Provisioner set net_idx/flags/iv_index used for provisioning completion event

ESP_BLE_MESH_PROVISIONER_PROV_READ_OOB_PUB_KEY_COMP_EVT

Provisioner read unprovisioned device OOB public key completion event

ESP_BLE_MESH_PROVISIONER_PROV_INPUT_NUMBER_COMP_EVT

Provisioner input number completion event

ESP_BLE_MESH_PROVISIONER_PROV_INPUT_STRING_COMP_EVT

Provisioner input string completion event

ESP_BLE_MESH_PROVISIONER_SET_NODE_NAME_COMP_EVT

Provisioner set node name completion event

ESP_BLE_MESH_PROVISIONER_ADD_LOCAL_APP_KEY_COMP_EVT

Provisioner add local app key completion event

ESP_BLE_MESH_PROVISIONER_BIND_APP_KEY_TO_MODEL_COMP_EVT

Provisioner bind local model with local app key completion event

ESP_BLE_MESH_PROVISIONER_ADD_LOCAL_NET_KEY_COMP_EVT

Provisioner add local network key completion event

ESP_BLE_MESH_SET_FAST_PROV_INFO_COMP_EVT

Set fast provisioning information (e.g. unicast address range, net_idx, etc.) completion event

ESP_BLE_MESH_SET_FAST_PROV_ACTION_COMP_EVT

Set fast provisioning action completion event

ESP_BLE_MESH_HEARTBEAT_MESSAGE_RECV_EVT

Receive Heartbeat message event

ESP_BLE_MESH_LPN_ENABLE_COMP_EVT

Enable Low Power Node completion event

ESP_BLE_MESH_LPN_DISABLE_COMP_EVT

Disable Low Power Node completion event

ESP_BLE_MESH_LPN_POLL_COMP_EVT

Low Power Node send Friend Poll completion event

ESP_BLE_MESH_LPN_FRIENDSHIP_ESTABLISH_EVT

Low Power Node establishes friendship event

ESP_BLE_MESH_LPN_FRIENDSHIP_TERMINATE_EVT

Low Power Node terminates friendship event

ESP_BLE_MESH_FRIEND_FRIENDSHIP_ESTABLISH_EVT

Friend Node establishes friendship event

ESP_BLE_MESH_FRIEND_FRIENDSHIP_TERMINATE_EVT

Friend Node terminates friendship event

ESP_BLE_MESH_PROXY_CLIENT_RECV_ADV_PKT_EVT

Proxy Client receives Network ID advertising packet event

ESP_BLE_MESH_PROXY_CLIENT_CONNECTED_EVT

Proxy Client establishes connection successfully event

ESP_BLE_MESH_PROXY_CLIENT_DISCONNECTED_EVT

Proxy Client terminates connection successfully event

ESP_BLE_MESH_PROXY_CLIENT_RECV_FILTER_STATUS_EVT

Proxy Client receives Proxy Filter Status event

ESP_BLE_MESH_PROXY_CLIENT_CONNECT_COMP_EVT

Proxy Client connect completion event

ESP_BLE_MESH_PROXY_CLIENT_DISCONNECT_COMP_EVT

Proxy Client disconnect completion event

ESP_BLE_MESH_PROXY_CLIENT_SET_FILTER_TYPE_COMP_EVT

Proxy Client set filter type completion event

ESP_BLE_MESH_PROXY_CLIENT_ADD_FILTER_ADDR_COMP_EVT

Proxy Client add filter address completion event

ESP_BLE_MESH_PROXY_CLIENT_REMOVE_FILTER_ADDR_COMP_EVT

Proxy Client remove filter address completion event

ESP_BLE_MESH_PROV_EVT_MAX
enum [anonymous]

BLE Mesh server models related definitions.

This enum value is the flag of transition timer operation

Values:

ESP_BLE_MESH_SERVER_TRANS_TIMER_START
ESP_BLE_MESH_SERVER_FLAG_MAX
enum esp_ble_mesh_server_state_type_t

This enum value is the type of server model states

Values:

ESP_BLE_MESH_GENERIC_ONOFF_STATE
ESP_BLE_MESH_GENERIC_LEVEL_STATE
ESP_BLE_MESH_GENERIC_ONPOWERUP_STATE
ESP_BLE_MESH_GENERIC_POWER_ACTUAL_STATE
ESP_BLE_MESH_LIGHT_LIGHTNESS_ACTUAL_STATE
ESP_BLE_MESH_LIGHT_LIGHTNESS_LINEAR_STATE
ESP_BLE_MESH_LIGHT_CTL_LIGHTNESS_STATE
ESP_BLE_MESH_LIGHT_CTL_TEMP_DELTA_UV_STATE
ESP_BLE_MESH_LIGHT_HSL_LIGHTNESS_STATE
ESP_BLE_MESH_LIGHT_HSL_HUE_STATE
ESP_BLE_MESH_LIGHT_HSL_SATURATION_STATE
ESP_BLE_MESH_LIGHT_XYL_LIGHTNESS_STATE
ESP_BLE_MESH_LIGHT_LC_LIGHT_ONOFF_STATE
ESP_BLE_MESH_SERVER_MODEL_STATE_MAX
enum esp_ble_mesh_model_cb_event_t

Values:

ESP_BLE_MESH_MODEL_OPERATION_EVT

User-defined models receive messages from peer devices (e.g. get, set, status, etc) event

ESP_BLE_MESH_MODEL_SEND_COMP_EVT

User-defined models send messages completion event

ESP_BLE_MESH_MODEL_PUBLISH_COMP_EVT

User-defined models publish messages completion event

ESP_BLE_MESH_CLIENT_MODEL_RECV_PUBLISH_MSG_EVT

User-defined client models receive publish messages event

ESP_BLE_MESH_CLIENT_MODEL_SEND_TIMEOUT_EVT

Timeout event for the user-defined client models that failed to receive response from peer server models

ESP_BLE_MESH_MODEL_PUBLISH_UPDATE_EVT

When a model is configured to publish messages periodically, this event will occur during every publish period

ESP_BLE_MESH_SERVER_MODEL_UPDATE_STATE_COMP_EVT

Server models update state value completion event

ESP_BLE_MESH_MODEL_EVT_MAX

ESP-BLE-MESH Core API Reference

This section contains ESP-BLE-MESH Core related APIs, which can be used to initialize ESP-BLE-MESH stack, provision, send/publish messages, etc.

This API reference covers six components:

ESP-BLE-MESH Stack Initialization

Functions

esp_err_t esp_ble_mesh_init(esp_ble_mesh_prov_t *prov, esp_ble_mesh_comp_t *comp)

Initialize BLE Mesh module. This API initializes provisioning capabilities and composition data information.

Note
After calling this API, the device needs to call esp_ble_mesh_prov_enable() to enable provisioning functionality again.
Return
ESP_OK on success or error code otherwise.
Parameters
  • prov: Pointer to the device provisioning capabilities. This pointer must remain valid during the lifetime of the BLE Mesh device.
  • comp: Pointer to the device composition data information. This pointer must remain valid during the lifetime of the BLE Mesh device.

Reading of Local Data Information

Functions

int32_t esp_ble_mesh_get_model_publish_period(esp_ble_mesh_model_t *model)

Get the model publish period, the unit is ms.

Return
Publish period value on success, 0 or (negative) error code from errno.h on failure.
Parameters
  • model: Model instance pointer.

uint16_t esp_ble_mesh_get_primary_element_address(void)

Get the address of the primary element.

Return
Address of the primary element on success, or ESP_BLE_MESH_ADDR_UNASSIGNED on failure which means the device has not been provisioned.

uint16_t *esp_ble_mesh_is_model_subscribed_to_group(esp_ble_mesh_model_t *model, uint16_t group_addr)

Check if the model has subscribed to the given group address. Note: E.g., once a status message is received and the destination address is a group address, the model uses this API to check if it is successfully subscribed to the given group address.

Return
Pointer to the group address within the Subscription List of the model on success, or NULL on failure which means the model has not subscribed to the given group address. Note: With the pointer to the group address returned, you can reset the group address to 0x0000 in order to unsubscribe the model from the group.
Parameters
  • model: Pointer to the model.
  • group_addr: Group address.

esp_ble_mesh_elem_t *esp_ble_mesh_find_element(uint16_t element_addr)

Find the BLE Mesh element pointer via the element address.

Return
Pointer to the element on success, or NULL on failure.
Parameters
  • element_addr: Element address.

uint8_t esp_ble_mesh_get_element_count(void)

Get the number of elements that have been registered.

Return
Number of elements.

esp_ble_mesh_model_t *esp_ble_mesh_find_vendor_model(const esp_ble_mesh_elem_t *element, uint16_t company_id, uint16_t model_id)

Find the Vendor specific model with the given element, the company ID and the Vendor Model ID.

Return
Pointer to the Vendor Model on success, or NULL on failure which means the Vendor Model is not found.
Parameters
  • element: Element to which the model belongs.
  • company_id: A 16-bit company identifier assigned by the Bluetooth SIG.
  • model_id: A 16-bit vendor-assigned model identifier.

esp_ble_mesh_model_t *esp_ble_mesh_find_sig_model(const esp_ble_mesh_elem_t *element, uint16_t model_id)

Find the SIG model with the given element and Model id.

Return
Pointer to the SIG Model on success, or NULL on failure which means the SIG Model is not found.
Parameters
  • element: Element to which the model belongs.
  • model_id: SIG model identifier.

const esp_ble_mesh_comp_t *esp_ble_mesh_get_composition_data(void)

Get the Composition data which has been registered.

Return
Pointer to the Composition data on success, or NULL on failure which means the Composition data is not initialized.

Low Power Operation (Updating)

Functions

esp_err_t esp_ble_mesh_lpn_enable(void)

Enable BLE Mesh device LPN functionality.

Note
This API enables LPN functionality. Once called, the proper Friend Request will be sent.
Return
ESP_OK on success or error code otherwise.

esp_err_t esp_ble_mesh_lpn_disable(bool force)

Disable BLE Mesh device LPN functionality.

Return
ESP_OK on success or error code otherwise.
Parameters
  • force: when disabling LPN functionality, use this flag to indicate whether directly clear corresponding information or just send friend clear to disable it if friendship has already been established.

esp_err_t esp_ble_mesh_lpn_poll(void)

LPN tries to poll messages from the Friend Node.

Note
The Friend Poll message is sent by a Low Power node to ask the Friend node to send a message that it has stored for the Low Power node. Users can call this API to send Friend Poll message manually. If this API is not invoked, the bottom layer of the Low Power node will send Friend Poll before the PollTimeout timer expires. If the corresponding Friend Update is received and MD is set to 0, which means there are no messages for the Low Power node, then the Low Power node will stop scanning.
Return
ESP_OK on success or error code otherwise.

Send/Publish Messages, add Local AppKey, etc.

Functions

esp_err_t esp_ble_mesh_register_custom_model_callback(esp_ble_mesh_model_cb_t callback)

Register BLE Mesh callback for user-defined models’ operations. This callback can report the following events generated for the user-defined models:

  • Call back the messages received by user-defined client and server models to the application layer;
  • If users call esp_ble_mesh_server/client_model_send, this callback notifies the application layer of the send_complete event;
  • If user-defined client model sends a message that requires response, and the response message is received after the timer expires, the response message will be reported to the application layer as published by a peer device;
  • If the user-defined client model fails to receive the response message during a specified period of time, a timeout event will be reported to the application layer.

Note
The client models (i.e. Config Client model, Health Client model, Generic Client models, Sensor Client model, Scene Client model and Lighting Client models) that have been realized internally have their specific register functions. For example, esp_ble_mesh_register_config_client_callback is the register function for Config Client Model.
Return
ESP_OK on success or error code otherwise.
Parameters
  • callback: Pointer to the callback function.

esp_err_t esp_ble_mesh_model_msg_opcode_init(uint8_t *data, uint32_t opcode)

Add the message opcode to the beginning of the model message before sending or publishing the model message.

Note
This API is only used to set the opcode of the message.
Return
ESP_OK on success or error code otherwise.
Parameters
  • data: Pointer to the message data.
  • opcode: The message opcode.

esp_err_t esp_ble_mesh_client_model_init(esp_ble_mesh_model_t *model)

Initialize the user-defined client model. All user-defined client models shall call this function to initialize the client model internal data. Node: Before calling this API, the op_pair_size and op_pair variabled within the user_data(defined using esp_ble_mesh_client_t_) of the client model need to be initialized.

Return
ESP_OK on success or error code otherwise.
Parameters
  • model: BLE Mesh Client model to which the message belongs.

esp_err_t esp_ble_mesh_server_model_send_msg(esp_ble_mesh_model_t *model, esp_ble_mesh_msg_ctx_t *ctx, uint32_t opcode, uint16_t length, uint8_t *data)

Send server model messages(such as server model status messages).

Return
ESP_OK on success or error code otherwise.
Parameters
  • model: BLE Mesh Server Model to which the message belongs.
  • ctx: Message context, includes keys, TTL, etc.
  • opcode: Message opcode.
  • length: Message length (exclude the message opcode).
  • data: Parameters of Access Payload (exclude the message opcode) to be sent.

esp_err_t esp_ble_mesh_client_model_send_msg(esp_ble_mesh_model_t *model, esp_ble_mesh_msg_ctx_t *ctx, uint32_t opcode, uint16_t length, uint8_t *data, int32_t msg_timeout, bool need_rsp, esp_ble_mesh_dev_role_t device_role)

Send client model message (such as model get, set, etc).

Return
ESP_OK on success or error code otherwise.
Parameters
  • model: BLE Mesh Client Model to which the message belongs.
  • ctx: Message context, includes keys, TTL, etc.
  • opcode: Message opcode.
  • length: Message length (exclude the message opcode).
  • data: Parameters of the Access Payload (exclude the message opcode) to be sent.
  • msg_timeout: Time to get response to the message (in milliseconds).
  • need_rsp: TRUE if the opcode requires the peer device to reply, FALSE otherwise.
  • device_role: Role of the device (Node/Provisioner) that sends the message.

esp_err_t esp_ble_mesh_model_publish(esp_ble_mesh_model_t *model, uint32_t opcode, uint16_t length, uint8_t *data, esp_ble_mesh_dev_role_t device_role)

Send a model publication message.

Note
Before calling this function, the user needs to ensure that the model publication message (esp_ble_mesh_model_pub_t::msg) contains a valid message to be sent. And if users want to update the publishing message, this API should be called in ESP_BLE_MESH_MODEL_PUBLISH_UPDATE_EVT with the message updated.
Return
ESP_OK on success or error code otherwise.
Parameters
  • model: Mesh (client) Model publishing the message.
  • opcode: Message opcode.
  • length: Message length (exclude the message opcode).
  • data: Parameters of the Access Payload (exclude the message opcode) to be sent.
  • device_role: Role of the device (node/provisioner) publishing the message of the type esp_ble_mesh_dev_role_t.

esp_err_t esp_ble_mesh_server_model_update_state(esp_ble_mesh_model_t *model, esp_ble_mesh_server_state_type_t type, esp_ble_mesh_server_state_value_t *value)

Update a server model state value. If the model publication state is set properly (e.g. publish address is set to a valid address), it will publish corresponding status message.

Note
Currently this API is used to update bound state value, not for all server model states.
Return
ESP_OK on success or error code otherwise.
Parameters
  • model: Server model which is going to update the state.
  • type: Server model state type.
  • value: Server model state value.

esp_err_t esp_ble_mesh_node_local_reset(void)

Reset the provisioning procedure of the local BLE Mesh node.

Note
All provisioning information in this node will be deleted and the node needs to be reprovisioned. The API function esp_ble_mesh_node_prov_enable() needs to be called to start a new provisioning procedure.
Return
ESP_OK on success or error code otherwise.

esp_err_t esp_ble_mesh_provisioner_set_node_name(int index, const char *name)

This function is called to set the node (provisioned device) name.

Note
index is obtained from the parameters of ESP_BLE_MESH_PROVISIONER_PROV_COMPLETE_EVT.
Return
ESP_OK on success or error code otherwise.
Parameters
  • index: Index of the node in the node queue.
  • name: Name (end by ‘\0’) to be set for the node.

const char *esp_ble_mesh_provisioner_get_node_name(int index)

This function is called to get the node (provisioned device) name.

Note
index is obtained from the parameters of ESP_BLE_MESH_PROVISIONER_PROV_COMPLETE_EVT.
Return
Node name on success, or NULL on failure.
Parameters
  • index: Index of the node in the node queue.

int esp_ble_mesh_provisioner_get_node_index(const char *name)

This function is called to get the node (provisioned device) index.

Return
Node index on success, or (negative) error code from errno.h on failure.
Parameters
  • name: Name of the node (end by ‘\0’).

esp_err_t esp_ble_mesh_provisioner_add_local_app_key(const uint8_t app_key[16], uint16_t net_idx, uint16_t app_idx)

This function is called to set the app key for the local BLE Mesh stack.

Note
app_key: If set to NULL, app_key will be generated internally. net_idx: Should be an existing one. app_idx: If it is going to be generated internally, it should be set to 0xFFFF, and the new app_idx will be reported via an event.
Return
ESP_OK on success or error code otherwise.
Parameters
  • app_key: The app key to be set for the local BLE Mesh stack.
  • net_idx: The network key index.
  • app_idx: The app key index.

const uint8_t *esp_ble_mesh_provisioner_get_local_app_key(uint16_t net_idx, uint16_t app_idx)

This function is called by Provisioner to get the local app key value.

Return
App key on success, or NULL on failure.
Parameters
  • net_idx: Network key index.
  • app_idx: Application key index.

esp_err_t esp_ble_mesh_provisioner_bind_app_key_to_local_model(uint16_t element_addr, uint16_t app_idx, uint16_t model_id, uint16_t company_id)

This function is called by Provisioner to bind own model with proper app key.

Note
company_id: If going to bind app_key with local vendor model, company_id should be set to 0xFFFF.
Return
ESP_OK on success or error code otherwise.
Parameters
  • element_addr: Provisioner local element address
  • app_idx: Provisioner local appkey index
  • model_id: Provisioner local model id
  • company_id: Provisioner local company id

esp_err_t esp_ble_mesh_provisioner_add_local_net_key(const uint8_t net_key[16], uint16_t net_idx)

This function is called by Provisioner to add local network key.

Note
net_key: If set to NULL, net_key will be generated internally. net_idx: If it is going to be generated internally, it should be set to 0xFFFF, and the new net_idx will be reported via an event.
Return
ESP_OK on success or error code otherwise.
Parameters
  • net_key: The network key to be added to the Provisioner local BLE Mesh stack.
  • net_idx: The network key index.

const uint8_t *esp_ble_mesh_provisioner_get_local_net_key(uint16_t net_idx)

This function is called by Provisioner to get the local network key value.

Return
Network key on success, or NULL on failure.
Parameters
  • net_idx: Network key index.

const uint8_t *esp_ble_mesh_get_fast_prov_app_key(uint16_t net_idx, uint16_t app_idx)

This function is called to get fast provisioning application key.

Return
Application key on success, or NULL on failure.
Parameters
  • net_idx: Network key index.
  • app_idx: Application key index.

Type Definitions

typedef void (*esp_ble_mesh_model_cb_t)(esp_ble_mesh_model_cb_event_t event, esp_ble_mesh_model_cb_param_t *param)

: event, event code of user-defined model events; param, parameters of user-defined model events

ESP-BLE-MESH Node/Provisioner Provisioning

Functions

esp_err_t esp_ble_mesh_register_prov_callback(esp_ble_mesh_prov_cb_t callback)

Register BLE Mesh provisioning callback.

Return
ESP_OK on success or error code otherwise.
Parameters
  • callback: Pointer to the callback function.

bool esp_ble_mesh_node_is_provisioned(void)

Check if a device has been provisioned.

Return
TRUE if the device is provisioned, FALSE if the device is unprovisioned.

esp_err_t esp_ble_mesh_node_prov_enable(esp_ble_mesh_prov_bearer_t bearers)

Enable specific provisioning bearers to get the device ready for provisioning.

Note
PB-ADV: send unprovisioned device beacon. PB-GATT: send connectable advertising packets.
Return
ESP_OK on success or error code otherwise.
Parameters
  • bearers: Bit-wise OR of provisioning bearers.

esp_err_t esp_ble_mesh_node_prov_disable(esp_ble_mesh_prov_bearer_t bearers)

Disable specific provisioning bearers to make a device inaccessible for provisioning.

Return
ESP_OK on success or error code otherwise.
Parameters
  • bearers: Bit-wise OR of provisioning bearers.

esp_err_t esp_ble_mesh_node_set_oob_pub_key(uint8_t pub_key_x[32], uint8_t pub_key_y[32], uint8_t private_key[32])

Unprovisioned device set own oob public key & private key pair.

Return
ESP_OK on success or error code otherwise.
Parameters
  • pub_key_x: Unprovisioned device’s Public Key X
  • pub_key_y: Unprovisioned device’s Public Key Y
  • private_key: Unprovisioned device’s Private Key

esp_err_t esp_ble_mesh_node_input_number(uint32_t number)

Provide provisioning input OOB number.

Note
This is intended to be called if the user has received ESP_BLE_MESH_NODE_PROV_INPUT_EVT with ESP_BLE_MESH_ENTER_NUMBER as the action.
Return
ESP_OK on success or error code otherwise.
Parameters
  • number: Number input by device.

esp_err_t esp_ble_mesh_node_input_string(const char *string)

Provide provisioning input OOB string.

Note
This is intended to be called if the user has received ESP_BLE_MESH_NODE_PROV_INPUT_EVT with ESP_BLE_MESH_ENTER_STRING as the action.
Return
ESP_OK on success or error code otherwise.
Parameters
  • string: String input by device.

esp_err_t esp_ble_mesh_set_unprovisioned_device_name(const char *name)

Using this function, an unprovisioned device can set its own device name, which will be broadcasted in its advertising data.

Note
This API applicable to PB-GATT mode only by setting the name to the scan response data, it doesn’t apply to PB-ADV mode.
Return
ESP_OK on success or error code otherwise.
Parameters
  • name: Unprovisioned device name

esp_err_t esp_ble_mesh_provisioner_read_oob_pub_key(uint8_t link_idx, uint8_t pub_key_x[32], uint8_t pub_key_y[32])

Provisioner inputs unprovisioned device’s oob public key.

Return
ESP_OK on success or error code otherwise.
Parameters
  • link_idx: The provisioning link index
  • pub_key_x: Unprovisioned device’s Public Key X
  • pub_key_y: Unprovisioned device’s Public Key Y

esp_err_t esp_ble_mesh_provisioner_input_string(const char *string, uint8_t link_idx)

Provide provisioning input OOB string.

This is intended to be called after the esp_ble_mesh_prov_t prov_input_num callback has been called with ESP_BLE_MESH_ENTER_STRING as the action.

Return
ESP_OK on success or error code otherwise.
Parameters
  • string: String input by Provisioner.
  • link_idx: The provisioning link index.

esp_err_t esp_ble_mesh_provisioner_input_number(uint32_t number, uint8_t link_idx)

Provide provisioning input OOB number.

This is intended to be called after the esp_ble_mesh_prov_t prov_input_num callback has been called with ESP_BLE_MESH_ENTER_NUMBER as the action.

Return
ESP_OK on success or error code otherwise.
Parameters
  • number: Number input by Provisioner.
  • link_idx: The provisioning link index.

esp_err_t esp_ble_mesh_provisioner_prov_enable(esp_ble_mesh_prov_bearer_t bearers)

Enable one or more provisioning bearers.

Note
PB-ADV: Enable BLE scan. PB-GATT: Initialize corresponding BLE Mesh Proxy info.
Return
ESP_OK on success or error code otherwise.
Parameters
  • bearers: Bit-wise OR of provisioning bearers.

esp_err_t esp_ble_mesh_provisioner_prov_disable(esp_ble_mesh_prov_bearer_t bearers)

Disable one or more provisioning bearers.

Note
PB-ADV: Disable BLE scan. PB-GATT: Break any existing BLE Mesh Provisioning connections.
Return
ESP_OK on success or error code otherwise.
Parameters
  • bearers: Bit-wise OR of provisioning bearers.

esp_err_t esp_ble_mesh_provisioner_add_unprov_dev(esp_ble_mesh_unprov_dev_add_t *add_dev, esp_ble_mesh_dev_add_flag_t flags)

Add unprovisioned device info to the unprov_dev queue.

Return
ESP_OK on success or error code otherwise.
Note
: 1. Currently address type only supports public address and static random address.
  1. If device UUID and/or device address as well as address type already exist in the device queue, but the bearer is different from the existing one, add operation will also be successful and it will update the provision bearer supported by the device.
  2. For example, if the Provisioner wants to add an unprovisioned device info before receiving its unprovisioned device beacon or Mesh Provisioning advertising packets, the Provisioner can use this API to add the device info with each one or both of device UUID and device address added. When the Provisioner gets the device’s advertising packets, it will start provisioning the device internally.
    • In this situation, the Provisioner can set bearers with each one or both of ESP_BLE_MESH_PROV_ADV and ESP_BLE_MESH_PROV_GATT enabled, and cannot set flags with ADD_DEV_START_PROV_NOW_FLAG enabled.
  3. Another example is when the Provisioner receives the unprovisioned device’s beacon or Mesh Provisioning advertising packets, the advertising packets will be reported on to the application layer using the callback registered by the function esp_ble_mesh_register_prov_callback. And in the callback, the Provisioner can call this API to start provisioning the device.
    • If the Provisioner uses PB-ADV to provision, either one or both of device UUID and device address can be added, bearers shall be set with ESP_BLE_MESH_PROV_ADV enabled and the flags shall be set with ADD_DEV_START_PROV_NOW_FLAG enabled.
    • If the Provisioner uses PB-GATT to provision, both the device UUID and device address need to be added, bearers shall be set with ESP_BLE_MESH_PROV_GATT enabled, and the flags shall be set with ADD_DEV_START_PROV_NOW_FLAG enabled.
    • If the Provisioner just wants to store the unprovisioned device info when receiving its advertising packets and start to provision it the next time (e.g. after receiving its advertising packets again), then it can add the device info with either one or both of device UUID and device address included. Bearers can be set with either one or both of ESP_BLE_MESH_PROV_ADV and ESP_BLE_MESH_PROV_GATT enabled (recommend to enable the bearer which will receive its advertising packets, because if the other bearer is enabled, the Provisioner is not aware if the device supports the bearer), and flags cannot be set with ADD_DEV_START_PROV_NOW_FLAG enabled.
    • Note: ESP_BLE_MESH_PROV_ADV, ESP_BLE_MESH_PROV_GATT and ADD_DEV_START_PROV_NOW_FLAG can not be enabled at the same time.
Parameters
  • add_dev: Pointer to a struct containing the device information
  • flags: Flags indicate several operations on the device information
    • Remove device information from queue after device has been provisioned (BIT0)
    • Start provisioning immediately after device is added to queue (BIT1)
    • Device can be removed if device queue is full (BIT2)

esp_err_t esp_ble_mesh_provisioner_delete_dev(esp_ble_mesh_device_delete_t *del_dev)

Delete device from queue, reset current provisioning link and reset the node.

Note
If the device is in the queue, remove it from the queue; if the device is being provisioned, terminate the provisioning procedure; if the device has already been provisioned, reset the device. And either one of the addr or device UUID can be input.
Return
ESP_OK on success or error code otherwise.
Parameters
  • del_dev: Pointer to a struct containing the device information.

esp_err_t esp_ble_mesh_provisioner_set_dev_uuid_match(const uint8_t *match_val, uint8_t match_len, uint8_t offset, bool prov_after_match)

This function is called by Provisioner to set the part of the device UUID to be compared before starting to provision.

Return
ESP_OK on success or error code otherwise.
Parameters
  • match_val: Value to be compared with the part of the device UUID.
  • match_len: Length of the compared match value.
  • offset: Offset of the device UUID to be compared (based on zero).
  • prov_after_match: Flag used to indicate whether provisioner should start to provision the device immediately if the part of the UUID matches.

esp_err_t esp_ble_mesh_provisioner_set_prov_data_info(esp_ble_mesh_prov_data_info_t *prov_data_info)

This function is called by Provisioner to set provisioning data information before starting to provision.

Return
ESP_OK on success or error code otherwise.
Parameters
  • prov_data_info: Pointer to a struct containing net_idx or flags or iv_index.

esp_err_t esp_ble_mesh_set_fast_prov_info(esp_ble_mesh_fast_prov_info_t *fast_prov_info)

This function is called to set provisioning data information before starting fast provisioning.

Return
ESP_OK on success or error code otherwise.
Parameters
  • fast_prov_info: Pointer to a struct containing unicast address range, net_idx, etc.

esp_err_t esp_ble_mesh_set_fast_prov_action(esp_ble_mesh_fast_prov_action_t action)

This function is called to start/suspend/exit fast provisioning.

Return
ESP_OK on success or error code otherwise.
Parameters
  • action: fast provisioning action (i.e. enter, suspend, exit).

Type Definitions

typedef void (*esp_ble_mesh_prov_cb_t)(esp_ble_mesh_prov_cb_event_t event, esp_ble_mesh_prov_cb_param_t *param)

: event, event code of provisioning events; param, parameters of provisioning events

typedef void (*esp_ble_mesh_prov_adv_cb_t)(const esp_ble_mesh_bd_addr_t addr, const esp_ble_mesh_addr_type_t addr_type, const uint8_t adv_type, const uint8_t *dev_uuid, uint16_t oob_info, esp_ble_mesh_prov_bearer_t bearer)

Callback for Provisioner that received advertising packets from unprovisioned devices which are not in the unprovisioned device queue.

Report on the unprovisioned device beacon and mesh provisioning service adv data to application.

Parameters
  • addr: Pointer to the unprovisioned device address.
  • addr_type: Unprovisioned device address type.
  • adv_type: Adv packet type(ADV_IND or ADV_NONCONN_IND).
  • dev_uuid: Unprovisioned device UUID pointer.
  • oob_info: OOB information of the unprovisioned device.
  • bearer: Adv packet received from PB-GATT or PB-ADV bearer.

ESP-BLE-MESH GATT Proxy Server

Functions

esp_err_t esp_ble_mesh_proxy_identity_enable(void)

Enable advertising with Node Identity.

Note
This API requires that GATT Proxy support be enabled. Once called, each subnet starts advertising using Node Identity for the next 60 seconds, and after 60s Network ID will be advertised. Under normal conditions, the BLE Mesh Proxy Node Identity and Network ID advertising will be enabled automatically by BLE Mesh stack after the device is provisioned.
Return
ESP_OK on success or error code otherwise.

esp_err_t esp_ble_mesh_proxy_gatt_enable(void)

Enable BLE Mesh GATT Proxy Service.

Return
ESP_OK on success or error code otherwise.

esp_err_t esp_ble_mesh_proxy_gatt_disable(void)

Disconnect the BLE Mesh GATT Proxy connection if there is any, and disable the BLE Mesh GATT Proxy Service.

Return
ESP_OK on success or error code otherwise.

esp_err_t esp_ble_mesh_proxy_client_connect(esp_ble_mesh_bd_addr_t addr, esp_ble_mesh_addr_type_t addr_type, uint16_t net_idx)

Proxy Client creates a connection with the Proxy Server.

Return
ESP_OK on success or error code otherwise.
Parameters
  • addr: Device address of the Proxy Server.
  • addr_type: Device address type(public or static random).
  • net_idx: NetKey Index related with Network ID in the Mesh Proxy advertising packet.

esp_err_t esp_ble_mesh_proxy_client_disconnect(uint8_t conn_handle)

Proxy Client terminates a connection with the Proxy Server.

Return
ESP_OK on success or error code otherwise.
Parameters
  • conn_handle: Proxy connection handle.

esp_err_t esp_ble_mesh_proxy_client_set_filter_type(uint8_t conn_handle, uint16_t net_idx, esp_ble_mesh_proxy_filter_type_t filter_type)

Proxy Client sets the filter type of the Proxy Server.

Return
ESP_OK on success or error code otherwise.
Parameters
  • conn_handle: Proxy connection handle.
  • net_idx: Corresponding NetKey Index.
  • filter_type: whitelist or blacklist.

esp_err_t esp_ble_mesh_proxy_client_add_filter_addr(uint8_t conn_handle, uint16_t net_idx, uint16_t *addr, uint16_t addr_num)

Proxy Client adds address to the Proxy Server filter list.

Return
ESP_OK on success or error code otherwise.
Parameters
  • conn_handle: Proxy connection handle.
  • net_idx: Corresponding NetKey Index.
  • addr: Pointer to the filter address.
  • addr_num: Number of the filter address.

esp_err_t esp_ble_mesh_proxy_client_remove_filter_addr(uint8_t conn_handle, uint16_t net_idx, uint16_t *addr, uint16_t addr_num)

Proxy Client removes address from the Proxy Server filter list.

Return
ESP_OK on success or error code otherwise.
Parameters
  • conn_handle: Proxy connection handle.
  • net_idx: Corresponding NetKey Index.
  • addr: Pointer to the filter address.
  • addr_num: Number of the filter address.

ESP-BLE-MESH Models API Reference

This section contains ESP-BLE-MESH Model related APIs, event types, event parameters, etc.

There are six categories of models:

Note

Definitions related to Server Models are being updated, and will be released soon.

Configuration Client/Server Models

Functions

esp_err_t esp_ble_mesh_register_config_client_callback(esp_ble_mesh_cfg_client_cb_t callback)

Register BLE Mesh Config Client Model callback.

Return
ESP_OK on success or error code otherwise.
Parameters
  • callback: Pointer to the callback function.

esp_err_t esp_ble_mesh_register_config_server_callback(esp_ble_mesh_cfg_server_cb_t callback)

Register BLE Mesh Config Server Model callback.

Return
ESP_OK on success or error code otherwise.
Parameters
  • callback: Pointer to the callback function.

esp_err_t esp_ble_mesh_config_client_get_state(esp_ble_mesh_client_common_param_t *params, esp_ble_mesh_cfg_client_get_state_t *get_state)

Get the value of Config Server Model states using the Config Client Model get messages.

Note
If you want to find the opcodes and corresponding meanings accepted by this API, please refer to esp_ble_mesh_opcode_config_client_get_t in esp_ble_mesh_defs.h
Return
ESP_OK on success or error code otherwise.
Parameters
  • params: Pointer to BLE Mesh common client parameters.
  • get_state: Pointer to a union, each kind of opcode corresponds to one structure inside. Shall not be set to NULL.

esp_err_t esp_ble_mesh_config_client_set_state(esp_ble_mesh_client_common_param_t *params, esp_ble_mesh_cfg_client_set_state_t *set_state)

Set the value of the Configuration Server Model states using the Config Client Model set messages.

Note
If you want to find the opcodes and corresponding meanings accepted by this API, please refer to esp_ble_mesh_opcode_config_client_set_t in esp_ble_mesh_defs.h
Return
ESP_OK on success or error code otherwise.
Parameters
  • params: Pointer to BLE Mesh common client parameters.
  • set_state: Pointer to a union, each kind of opcode corresponds to one structure inside. Shall not be set to NULL.

Unions

union esp_ble_mesh_cfg_client_get_state_t
#include <esp_ble_mesh_config_model_api.h>

For ESP_BLE_MESH_MODEL_OP_BEACON_GET ESP_BLE_MESH_MODEL_OP_COMPOSITION_DATA_GET ESP_BLE_MESH_MODEL_OP_DEFAULT_TTL_GET ESP_BLE_MESH_MODEL_OP_GATT_PROXY_GET ESP_BLE_MESH_MODEL_OP_RELAY_GET ESP_BLE_MESH_MODEL_OP_MODEL_PUB_GET ESP_BLE_MESH_MODEL_OP_FRIEND_GET ESP_BLE_MESH_MODEL_OP_HEARTBEAT_PUB_GET ESP_BLE_MESH_MODEL_OP_HEARTBEAT_SUB_GET the get_state parameter in the esp_ble_mesh_config_client_get_state function should not be set to NULL.

Public Members

esp_ble_mesh_cfg_model_pub_get_t model_pub_get

For ESP_BLE_MESH_MODEL_OP_MODEL_PUB_GET.

esp_ble_mesh_cfg_composition_data_get_t comp_data_get

For ESP_BLE_MESH_MODEL_OP_COMPOSITION_DATA_GET.

esp_ble_mesh_cfg_sig_model_sub_get_t sig_model_sub_get

For ESP_BLE_MESH_MODEL_OP_SIG_MODEL_SUB_GET

esp_ble_mesh_cfg_vnd_model_sub_get_t vnd_model_sub_get

For ESP_BLE_MESH_MODEL_OP_VENDOR_MODEL_SUB_GET

esp_ble_mesh_cfg_app_key_get_t app_key_get

For ESP_BLE_MESH_MODEL_OP_APP_KEY_GET.

esp_ble_mesh_cfg_node_identity_get_t node_identity_get

For ESP_BLE_MESH_MODEL_OP_NODE_IDENTITY_GET.

esp_ble_mesh_cfg_sig_model_app_get_t sig_model_app_get

For ESP_BLE_MESH_MODEL_OP_SIG_MODEL_APP_GET

esp_ble_mesh_cfg_vnd_model_app_get_t vnd_model_app_get

For ESP_BLE_MESH_MODEL_OP_VENDOR_MODEL_APP_GET

esp_ble_mesh_cfg_kr_phase_get_t kr_phase_get

For ESP_BLE_MESH_MODEL_OP_KEY_REFRESH_PHASE_GET

esp_ble_mesh_cfg_lpn_polltimeout_get_t lpn_pollto_get

For ESP_BLE_MESH_MODEL_OP_LPN_POLLTIMEOUT_GET

union esp_ble_mesh_cfg_client_set_state_t
#include <esp_ble_mesh_config_model_api.h>

For ESP_BLE_MESH_MODEL_OP_BEACON_SET ESP_BLE_MESH_MODEL_OP_DEFAULT_TTL_SET ESP_BLE_MESH_MODEL_OP_GATT_PROXY_SET ESP_BLE_MESH_MODEL_OP_RELAY_SET ESP_BLE_MESH_MODEL_OP_MODEL_PUB_SET ESP_BLE_MESH_MODEL_OP_MODEL_SUB_ADD ESP_BLE_MESH_MODEL_OP_MODEL_SUB_VIRTUAL_ADDR_ADD ESP_BLE_MESH_MODEL_OP_MODEL_SUB_DELETE ESP_BLE_MESH_MODEL_OP_MODEL_SUB_VIRTUAL_ADDR_DELETE ESP_BLE_MESH_MODEL_OP_MODEL_SUB_OVERWRITE ESP_BLE_MESH_MODEL_OP_MODEL_SUB_VIRTUAL_ADDR_OVERWRITE ESP_BLE_MESH_MODEL_OP_NET_KEY_ADD ESP_BLE_MESH_MODEL_OP_APP_KEY_ADD ESP_BLE_MESH_MODEL_OP_MODEL_APP_BIND ESP_BLE_MESH_MODEL_OP_NODE_RESET ESP_BLE_MESH_MODEL_OP_FRIEND_SET ESP_BLE_MESH_MODEL_OP_HEARTBEAT_PUB_SET ESP_BLE_MESH_MODEL_OP_HEARTBEAT_SUB_SET the set_state parameter in the esp_ble_mesh_config_client_set_state function should not be set to NULL.

Public Members

esp_ble_mesh_cfg_beacon_set_t beacon_set

For ESP_BLE_MESH_MODEL_OP_BEACON_SET

esp_ble_mesh_cfg_default_ttl_set_t default_ttl_set

For ESP_BLE_MESH_MODEL_OP_DEFAULT_TTL_SET

esp_ble_mesh_cfg_friend_set_t friend_set

For ESP_BLE_MESH_MODEL_OP_FRIEND_SET

esp_ble_mesh_cfg_gatt_proxy_set_t gatt_proxy_set

For ESP_BLE_MESH_MODEL_OP_GATT_PROXY_SET

esp_ble_mesh_cfg_relay_set_t relay_set

For ESP_BLE_MESH_MODEL_OP_RELAY_SET

esp_ble_mesh_cfg_net_key_add_t net_key_add

For ESP_BLE_MESH_MODEL_OP_NET_KEY_ADD

esp_ble_mesh_cfg_app_key_add_t app_key_add

For ESP_BLE_MESH_MODEL_OP_APP_KEY_ADD

esp_ble_mesh_cfg_model_app_bind_t model_app_bind

For ESP_BLE_MESH_MODEL_OP_MODEL_APP_BIND

esp_ble_mesh_cfg_model_pub_set_t model_pub_set

For ESP_BLE_MESH_MODEL_OP_MODEL_PUB_SET

esp_ble_mesh_cfg_model_sub_add_t model_sub_add

For ESP_BLE_MESH_MODEL_OP_MODEL_SUB_ADD

esp_ble_mesh_cfg_model_sub_delete_t model_sub_delete

For ESP_BLE_MESH_MODEL_OP_MODEL_SUB_DELETE

esp_ble_mesh_cfg_model_sub_overwrite_t model_sub_overwrite

For ESP_BLE_MESH_MODEL_OP_MODEL_SUB_OVERWRITE

esp_ble_mesh_cfg_model_sub_va_add_t model_sub_va_add

For ESP_BLE_MESH_MODEL_OP_MODEL_SUB_VIRTUAL_ADDR_ADD

esp_ble_mesh_cfg_model_sub_va_delete_t model_sub_va_delete

For ESP_BLE_MESH_MODEL_OP_MODEL_SUB_VIRTUAL_ADDR_DELETE

esp_ble_mesh_cfg_model_sub_va_overwrite_t model_sub_va_overwrite

For ESP_BLE_MESH_MODEL_OP_MODEL_SUB_VIRTUAL_ADDR_OVERWRITE

esp_ble_mesh_cfg_heartbeat_pub_set_t heartbeat_pub_set

For ESP_BLE_MESH_MODEL_OP_HEARTBEAT_PUB_SET

esp_ble_mesh_cfg_heartbeat_sub_set_t heartbeat_sub_set

For ESP_BLE_MESH_MODEL_OP_HEARTBEAT_SUB_SET

esp_ble_mesh_cfg_model_pub_va_set_t model_pub_va_set

For ESP_BLE_MESH_MODEL_OP_MODEL_PUB_VIRTUAL_ADDR_SET

esp_ble_mesh_cfg_model_sub_delete_all_t model_sub_delete_all

For ESP_BLE_MESH_MODEL_OP_MODEL_SUB_DELETE_ALL

esp_ble_mesh_cfg_net_key_update_t net_key_update

For ESP_BLE_MESH_MODEL_OP_NET_KEY_UPDATE

esp_ble_mesh_cfg_net_key_delete_t net_key_delete

For ESP_BLE_MESH_MODEL_OP_NET_KEY_DELETE

esp_ble_mesh_cfg_app_key_update_t app_key_update

For ESP_BLE_MESH_MODEL_OP_APP_KEY_UPDATE

esp_ble_mesh_cfg_app_key_delete_t app_key_delete

For ESP_BLE_MESH_MODEL_OP_APP_KEY_DELETE

esp_ble_mesh_cfg_node_identity_set_t node_identity_set

For ESP_BLE_MESH_MODEL_OP_NODE_IDENTITY_SET

esp_ble_mesh_cfg_model_app_unbind_t model_app_unbind

For ESP_BLE_MESH_MODEL_OP_MODEL_APP_UNBIND

esp_ble_mesh_cfg_kr_phase_set_t kr_phase_set

For ESP_BLE_MESH_MODEL_OP_KEY_REFRESH_PHASE_SET

esp_ble_mesh_cfg_net_transmit_set_t net_transmit_set

For ESP_BLE_MESH_MODEL_OP_NETWORK_TRANSMIT_SET

union esp_ble_mesh_cfg_client_common_cb_param_t
#include <esp_ble_mesh_config_model_api.h>

Configuration Client Model received message union.

Public Members

esp_ble_mesh_cfg_beacon_status_cb_t beacon_status

The beacon status value

esp_ble_mesh_cfg_comp_data_status_cb_t comp_data_status

The composition data status value

esp_ble_mesh_cfg_default_ttl_status_cb_t default_ttl_status

The default_ttl status value

esp_ble_mesh_cfg_gatt_proxy_status_cb_t gatt_proxy_status

The gatt_proxy status value

esp_ble_mesh_cfg_relay_status_cb_t relay_status

The relay status value

esp_ble_mesh_cfg_model_pub_status_cb_t model_pub_status

The model publication status value

esp_ble_mesh_cfg_model_sub_status_cb_t model_sub_status

The model subscription status value

esp_ble_mesh_cfg_net_key_status_cb_t netkey_status

The netkey status value

esp_ble_mesh_cfg_app_key_status_cb_t appkey_status

The appkey status value

esp_ble_mesh_cfg_mod_app_status_cb_t model_app_status

The model app status value

esp_ble_mesh_cfg_friend_status_cb_t friend_status

The friend status value

esp_ble_mesh_cfg_hb_pub_status_cb_t heartbeat_pub_status

The heartbeat publication status value

esp_ble_mesh_cfg_hb_sub_status_cb_t heartbeat_sub_status

The heartbeat subscription status value

esp_ble_mesh_cfg_net_trans_status_cb_t net_transmit_status

The network transmit status value

esp_ble_mesh_cfg_model_sub_list_cb_t model_sub_list

The model subscription list value

esp_ble_mesh_cfg_net_key_list_cb_t netkey_list

The network key index list value

esp_ble_mesh_cfg_app_key_list_cb_t appkey_list

The application key index list value

esp_ble_mesh_cfg_node_id_status_cb_t node_identity_status

The node identity status value

esp_ble_mesh_cfg_model_app_list_cb_t model_app_list

The model application key index list value

esp_ble_mesh_cfg_kr_phase_status_cb_t kr_phase_status

The key refresh phase status value

esp_ble_mesh_cfg_lpn_pollto_status_cb_t lpn_timeout_status

The low power node poll timeout status value

union esp_ble_mesh_cfg_server_state_change_t
#include <esp_ble_mesh_config_model_api.h>

Configuration Server model state change value union.

Public Members

esp_ble_mesh_state_change_cfg_mod_pub_set_t mod_pub_set

The recv_op in ctx can be used to decide which state is changed.Config Model Publication Set

esp_ble_mesh_state_change_cfg_model_sub_add_t mod_sub_add

Config Model Subscription Add

esp_ble_mesh_state_change_cfg_model_sub_delete_t mod_sub_delete

Config Model Subscription Delete

esp_ble_mesh_state_change_cfg_netkey_add_t netkey_add

Config NetKey Add

esp_ble_mesh_state_change_cfg_netkey_update_t netkey_update

Config NetKey Update

esp_ble_mesh_state_change_cfg_netkey_delete_t netkey_delete

Config NetKey Delete

esp_ble_mesh_state_change_cfg_appkey_add_t appkey_add

Config AppKey Add

esp_ble_mesh_state_change_cfg_appkey_update_t appkey_update

Config AppKey Update

esp_ble_mesh_state_change_cfg_appkey_delete_t appkey_delete

Config AppKey Delete

esp_ble_mesh_state_change_cfg_model_app_bind_t mod_app_bind

Config Model App Bind

esp_ble_mesh_state_change_cfg_model_app_unbind_t mod_app_unbind

Config Model App Unbind

esp_ble_mesh_state_change_cfg_kr_phase_set_t kr_phase_set

Config Key Refresh Phase Set

union esp_ble_mesh_cfg_server_cb_value_t
#include <esp_ble_mesh_config_model_api.h>

Configuration Server model callback value union.

Public Members

esp_ble_mesh_cfg_server_state_change_t state_change

ESP_BLE_MESH_CFG_SERVER_STATE_CHANGE_EVT

Structures

struct esp_ble_mesh_cfg_srv

Configuration Server Model context

Public Members

esp_ble_mesh_model_t *model

Pointer to Configuration Server Model

uint8_t net_transmit

Network Transmit state

uint8_t relay

Relay Mode state

uint8_t relay_retransmit

Relay Retransmit state

uint8_t beacon

Secure Network Beacon state

uint8_t gatt_proxy

GATT Proxy state

uint8_t friend_state

Friend state

uint8_t default_ttl

Default TTL

struct k_delayed_work timer

Heartbeat Publication timer

uint16_t dst

Destination address for Heartbeat messages

uint16_t count

Number of Heartbeat messages to be sent

Number of Heartbeat messages received

uint8_t period

Period for sending Heartbeat messages

uint8_t ttl

TTL to be used when sending Heartbeat messages

uint16_t feature

Bit field indicating features that trigger Heartbeat messages when changed

uint16_t net_idx

NetKey Index used by Heartbeat Publication

struct esp_ble_mesh_cfg_srv::[anonymous] heartbeat_pub

Heartbeat Publication

int64_t expiry

Timestamp when Heartbeat subscription period is expired

uint16_t src

Source address for Heartbeat messages

uint8_t min_hops

Minimum hops when receiving Heartbeat messages

uint8_t max_hops

Maximum hops when receiving Heartbeat messages

esp_ble_mesh_cb_t heartbeat_recv_cb

Optional heartbeat subscription tracking function

struct esp_ble_mesh_cfg_srv::[anonymous] heartbeat_sub

Heartbeat Subscription

struct esp_ble_mesh_cfg_composition_data_get_t

Parameters of Config Composition Data Get.

Public Members

uint8_t page

Page number of the Composition Data.

struct esp_ble_mesh_cfg_model_pub_get_t

Parameters of Config Model Publication Get.

Public Members

uint16_t element_addr

The element address

uint16_t model_id

The model id

uint16_t company_id

The company id, if not a vendor model, shall set to 0xFFFF

struct esp_ble_mesh_cfg_sig_model_sub_get_t

Parameters of Config SIG Model Subscription Get.

Public Members

uint16_t element_addr

The element address

uint16_t model_id

The model id

struct esp_ble_mesh_cfg_vnd_model_sub_get_t

Parameters of Config Vendor Model Subscription Get.

Public Members

uint16_t element_addr

The element address

uint16_t model_id

The model id

uint16_t company_id

The company id, if not a vendor model, shall set to 0xFFFF

struct esp_ble_mesh_cfg_app_key_get_t

Parameters of Config AppKey Get.

Public Members

uint16_t net_idx

The network key index

struct esp_ble_mesh_cfg_node_identity_get_t

Parameters of Config Node Identity Get.

Public Members

uint16_t net_idx

The network key index

struct esp_ble_mesh_cfg_sig_model_app_get_t

Parameters of Config SIG Model App Get.

Public Members

uint16_t element_addr

The element address

uint16_t model_id

The model id

struct esp_ble_mesh_cfg_vnd_model_app_get_t

Parameters of Config Vendor Model App Get.

Public Members

uint16_t element_addr

The element address

uint16_t model_id

The model id

uint16_t company_id

The company id, if not a vendor model, shall set to 0xFFFF

struct esp_ble_mesh_cfg_kr_phase_get_t

Parameters of Config Key Refresh Phase Get.

Public Members

uint16_t net_idx

The network key index

struct esp_ble_mesh_cfg_lpn_polltimeout_get_t

Parameters of Config Low Power Node PollTimeout Get.

Public Members

uint16_t lpn_addr

The unicast address of the Low Power node

struct esp_ble_mesh_cfg_beacon_set_t

Parameters of Config Beacon Set.

Public Members

uint8_t beacon

New Secure Network Beacon state

struct esp_ble_mesh_cfg_default_ttl_set_t

Parameters of Config Default TTL Set.

Public Members

uint8_t ttl

The default TTL state value

struct esp_ble_mesh_cfg_friend_set_t

Parameters of Config Friend Set.

Public Members

uint8_t friend_state

The friend state value

struct esp_ble_mesh_cfg_gatt_proxy_set_t

Parameters of Config GATT Proxy Set.

Public Members

uint8_t gatt_proxy

The GATT Proxy state value

struct esp_ble_mesh_cfg_relay_set_t

Parameters of Config Relay Set.

Public Members

uint8_t relay

The relay value

uint8_t relay_retransmit

The relay retransmit value

struct esp_ble_mesh_cfg_net_key_add_t

Parameters of Config NetKey Add.

Public Members

uint16_t net_idx

The network key index

uint8_t net_key[16]

The network key value

struct esp_ble_mesh_cfg_app_key_add_t

Parameters of Config AppKey Add.

Public Members

uint16_t net_idx

The network key index

uint16_t app_idx

The app key index

uint8_t app_key[16]

The app key value

struct esp_ble_mesh_cfg_model_app_bind_t

Parameters of Config Model App Bind.

Public Members

uint16_t element_addr

The element address

uint16_t model_app_idx

Index of the app key to bind with the model

uint16_t model_id

The model id

uint16_t company_id

The company id, if not a vendor model, shall set to 0xFFFF

struct esp_ble_mesh_cfg_model_pub_set_t

Parameters of Config Model Publication Set.

Public Members

uint16_t element_addr

The element address

uint16_t publish_addr

Value of the publish address

uint16_t publish_app_idx

Index of the application key

bool cred_flag

Value of the Friendship Credential Flag

uint8_t publish_ttl

Default TTL value for the publishing messages

uint8_t publish_period

Period for periodic status publishing

uint8_t publish_retransmit

Number of retransmissions and number of 50-millisecond steps between retransmissions

uint16_t model_id

The model id

uint16_t company_id

The company id, if not a vendor model, shall set to 0xFFFF

struct esp_ble_mesh_cfg_model_sub_add_t

Parameters of Config Model Subscription Add.

Public Members

uint16_t element_addr

The element address

uint16_t sub_addr

The address to be added to the Subscription List

uint16_t model_id

The model id

uint16_t company_id

The company id, if not a vendor model, shall set to 0xFFFF

struct esp_ble_mesh_cfg_model_sub_delete_t

Parameters of Config Model Subscription Delete.

Public Members

uint16_t element_addr

The element address

uint16_t sub_addr

The address to be removed from the Subscription List

uint16_t model_id

The model id

uint16_t company_id

The company id, if not a vendor model, shall set to 0xFFFF

struct esp_ble_mesh_cfg_model_sub_overwrite_t

Parameters of Config Model Subscription Overwrite.

Public Members

uint16_t element_addr

The element address

uint16_t sub_addr

The address to be added to the Subscription List

uint16_t model_id

The model id

uint16_t company_id

The company id, if not a vendor model, shall set to 0xFFFF

struct esp_ble_mesh_cfg_model_sub_va_add_t

Parameters of Config Model Subscription Virtual Address Add.

Public Members

uint16_t element_addr

The element address

uint8_t label_uuid[16]

The Label UUID of the virtual address to be added to the Subscription List

uint16_t model_id

The model id

uint16_t company_id

The company id, if not a vendor model, shall set to 0xFFFF

struct esp_ble_mesh_cfg_model_sub_va_delete_t

Parameters of Config Model Subscription Virtual Address Delete.

Public Members

uint16_t element_addr

The element address

uint8_t label_uuid[16]

The Label UUID of the virtual address to be removed from the Subscription List

uint16_t model_id

The model id

uint16_t company_id

The company id, if not a vendor model, shall set to 0xFFFF

struct esp_ble_mesh_cfg_model_sub_va_overwrite_t

Parameters of Config Model Subscription Virtual Address Overwrite.

Public Members

uint16_t element_addr

The element address

uint8_t label_uuid[16]

The Label UUID of the virtual address to be added to the Subscription List

uint16_t model_id

The model id

uint16_t company_id

The company id, if not a vendor model, shall set to 0xFFFF

struct esp_ble_mesh_cfg_model_pub_va_set_t

Parameters of Config Model Publication Virtual Address Set.

Public Members

uint16_t element_addr

The element address

uint8_t label_uuid[16]

Value of the Label UUID publish address

uint16_t publish_app_idx

Index of the application key

bool cred_flag

Value of the Friendship Credential Flag

uint8_t publish_ttl

Default TTL value for the publishing messages

uint8_t publish_period

Period for periodic status publishing

uint8_t publish_retransmit

Number of retransmissions and number of 50-millisecond steps between retransmissions

uint16_t model_id

The model id

uint16_t company_id

The company id, if not a vendor model, shall set to 0xFFFF

struct esp_ble_mesh_cfg_model_sub_delete_all_t

Parameters of Config Model Subscription Delete All.

Public Members

uint16_t element_addr

The element address

uint16_t model_id

The model id

uint16_t company_id

The company id, if not a vendor model, shall set to 0xFFFF

struct esp_ble_mesh_cfg_net_key_update_t

Parameters of Config NetKey Update.

Public Members

uint16_t net_idx

The network key index

uint8_t net_key[16]

The network key value

struct esp_ble_mesh_cfg_net_key_delete_t

Parameters of Config NetKey Delete.

Public Members

uint16_t net_idx

The network key index

struct esp_ble_mesh_cfg_app_key_update_t

Parameters of Config AppKey Update.

Public Members

uint16_t net_idx

The network key index

uint16_t app_idx

The app key index

uint8_t app_key[16]

The app key value

struct esp_ble_mesh_cfg_app_key_delete_t

Parameters of Config AppKey Delete.

Public Members

uint16_t net_idx

The network key index

uint16_t app_idx

The app key index

struct esp_ble_mesh_cfg_node_identity_set_t

Parameters of Config Node Identity Set.

Public Members

uint16_t net_idx

The network key index

uint8_t identity

New Node Identity state

struct esp_ble_mesh_cfg_model_app_unbind_t

Parameters of Config Model App Unbind.

Public Members

uint16_t element_addr

The element address

uint16_t model_app_idx

Index of the app key to bind with the model

uint16_t model_id

The model id

uint16_t company_id

The company id, if not a vendor model, shall set to 0xFFFF

struct esp_ble_mesh_cfg_kr_phase_set_t

Parameters of Config Key Refresh Phase Set.

Public Members

uint16_t net_idx

The network key index

uint8_t transition

New Key Refresh Phase Transition

struct esp_ble_mesh_cfg_net_transmit_set_t

Parameters of Config Network Transmit Set.

Public Members

uint8_t net_transmit

Network Transmit State

struct esp_ble_mesh_cfg_heartbeat_pub_set_t

Parameters of Config Model Heartbeat Publication Set.

Public Members

uint16_t dst

Destination address for Heartbeat messages

uint8_t count

Number of Heartbeat messages to be sent

uint8_t period

Period for sending Heartbeat messages

uint8_t ttl

TTL to be used when sending Heartbeat messages

uint16_t feature

Bit field indicating features that trigger Heartbeat messages when changed

uint16_t net_idx

NetKey Index

struct esp_ble_mesh_cfg_heartbeat_sub_set_t

Parameters of Config Model Heartbeat Subscription Set.

Public Members

uint16_t src

Source address for Heartbeat messages

uint16_t dst

Destination address for Heartbeat messages

uint8_t period

Period for receiving Heartbeat messages

struct esp_ble_mesh_cfg_beacon_status_cb_t

Parameter of Config Beacon Status

Public Members

uint8_t beacon

Secure Network Beacon state value

struct esp_ble_mesh_cfg_comp_data_status_cb_t

Parameters of Config Composition Data Status

Public Members

uint8_t page

Page number of the Composition Data

struct net_buf_simple *composition_data

Pointer to Composition Data for the identified page

struct esp_ble_mesh_cfg_default_ttl_status_cb_t

Parameter of Config Default TTL Status

Public Members

uint8_t default_ttl

Default TTL state value

struct esp_ble_mesh_cfg_gatt_proxy_status_cb_t

Parameter of Config GATT Proxy Status

Public Members

uint8_t gatt_proxy

GATT Proxy state value

struct esp_ble_mesh_cfg_relay_status_cb_t

Parameters of Config Relay Status

Public Members

uint8_t relay

Relay state value

uint8_t retransmit

Relay retransmit value(number of retransmissions and number of 10-millisecond steps between retransmissions)

struct esp_ble_mesh_cfg_model_pub_status_cb_t

Parameters of Config Model Publication Status

Public Members

uint8_t status

Status Code for the request message

uint16_t element_addr

Address of the element

uint16_t publish_addr

Value of the publish address

uint16_t app_idx

Index of the application key

bool cred_flag

Value of the Friendship Credential Flag

uint8_t ttl

Default TTL value for the outgoing messages

uint8_t period

Period for periodic status publishing

uint8_t transmit

Number of retransmissions and number of 50-millisecond steps between retransmissions

uint16_t company_id

Company ID

uint16_t model_id

Model ID

struct esp_ble_mesh_cfg_model_sub_status_cb_t

Parameters of Config Model Subscription Status

Public Members

uint8_t status

Status Code for the request message

uint16_t element_addr

Address of the element

uint16_t sub_addr

Value of the address

uint16_t company_id

Company ID

uint16_t model_id

Model ID

struct esp_ble_mesh_cfg_net_key_status_cb_t

Parameters of Config NetKey Status

Public Members

uint8_t status

Status Code for the request message

uint16_t net_idx

Index of the NetKey

struct esp_ble_mesh_cfg_app_key_status_cb_t

Parameters of Config AppKey Status

Public Members

uint8_t status

Status Code for the request message

uint16_t net_idx

Index of the NetKey

uint16_t app_idx

Index of the application key

struct esp_ble_mesh_cfg_mod_app_status_cb_t

Parameters of Config Model App Status

Public Members

uint8_t status

Status Code for the request message

uint16_t element_addr

Address of the element

uint16_t app_idx

Index of the application key

uint16_t company_id

Company ID

uint16_t model_id

Model ID

struct esp_ble_mesh_cfg_friend_status_cb_t

Parameter of Config Friend Status

Public Members

uint8_t friend_state

Friend state value

struct esp_ble_mesh_cfg_hb_pub_status_cb_t

Parameters of Config Heartbeat Publication Status

Public Members

uint8_t status

Status Code for the request message

uint16_t dst

Destination address for Heartbeat messages

uint8_t count

Number of Heartbeat messages remaining to be sent

uint8_t period

Period for sending Heartbeat messages

uint8_t ttl

TTL to be used when sending Heartbeat messages

uint16_t features

Features that trigger Heartbeat messages when changed

uint16_t net_idx

Index of the NetKey

struct esp_ble_mesh_cfg_hb_sub_status_cb_t

Parameters of Config Heartbeat Subscription Status

Public Members

uint8_t status

Status Code for the request message

uint16_t src

Source address for Heartbeat messages

uint16_t dst

Destination address for Heartbeat messages

uint8_t period

Remaining Period for processing Heartbeat messages

uint8_t count

Number of Heartbeat messages received

uint8_t min_hops

Minimum hops when receiving Heartbeat messages

uint8_t max_hops

Maximum hops when receiving Heartbeat messages

struct esp_ble_mesh_cfg_net_trans_status_cb_t

Parameters of Config Network Transmit Status

Public Members

uint8_t net_trans_count

Number of transmissions for each Network PDU originating from the node

uint8_t net_trans_step

Maximum hops when receiving Heartbeat messages

struct esp_ble_mesh_cfg_model_sub_list_cb_t

Parameters of Config SIG/Vendor Subscription List

Public Members

uint8_t status

Status Code for the request message

uint16_t element_addr

Address of the element

uint16_t company_id

Company ID

uint16_t model_id

Model ID

struct net_buf_simple *sub_addr

A block of all addresses from the Subscription List

struct esp_ble_mesh_cfg_net_key_list_cb_t

Parameter of Config NetKey List

Public Members

struct net_buf_simple *net_idx

A list of NetKey Indexes known to the node

struct esp_ble_mesh_cfg_app_key_list_cb_t

Parameters of Config AppKey List

Public Members

uint8_t status

Status Code for the request message

uint16_t net_idx

NetKey Index of the NetKey that the AppKeys are bound to

struct net_buf_simple *app_idx

A list of AppKey indexes that are bound to the NetKey identified by NetKeyIndex

struct esp_ble_mesh_cfg_node_id_status_cb_t

Parameters of Config Node Identity Status

Public Members

uint8_t status

Status Code for the request message

uint16_t net_idx

Index of the NetKey

uint8_t identity

Node Identity state

struct esp_ble_mesh_cfg_model_app_list_cb_t

Parameters of Config SIG/Vendor Model App List

Public Members

uint8_t status

Status Code for the request message

uint16_t element_addr

Address of the element

uint16_t company_id

Company ID

uint16_t model_id

Model ID

struct net_buf_simple *app_idx

All AppKey indexes bound to the Model

struct esp_ble_mesh_cfg_kr_phase_status_cb_t

Parameters of Config Key Refresh Phase Status

Public Members

uint8_t status

Status Code for the request message

uint16_t net_idx

Index of the NetKey

uint8_t phase

Key Refresh Phase state

struct esp_ble_mesh_cfg_lpn_pollto_status_cb_t

Parameters of Config Low Power Node PollTimeout Status

Public Members

uint16_t lpn_addr

The unicast address of the Low Power node

int32_t poll_timeout

The current value of the PollTimeout timer of the Low Power node

struct esp_ble_mesh_cfg_client_cb_param_t

Configuration Client Model callback parameters

Public Members

int error_code

Appropriate error code

esp_ble_mesh_client_common_param_t *params

The client common parameters

esp_ble_mesh_cfg_client_common_cb_param_t status_cb

The config status message callback values

struct esp_ble_mesh_state_change_cfg_mod_pub_set_t

Configuration Server model related context.

Public Members

uint16_t element_addr

Element Address

uint16_t pub_addr

Publish Address

uint16_t app_idx

AppKey Index

bool cred_flag

Friendship Credential Flag

uint8_t pub_ttl

Publish TTL

uint8_t pub_period

Publish Period

uint8_t pub_retransmit

Publish Retransmit

uint16_t company_id

Company ID

uint16_t model_id

Model ID

struct esp_ble_mesh_state_change_cfg_model_sub_add_t

Parameters of Config Model Subscription Add

Public Members

uint16_t element_addr

Element Address

uint16_t sub_addr

Subscription Address

uint16_t company_id

Company ID

uint16_t model_id

Model ID

struct esp_ble_mesh_state_change_cfg_model_sub_delete_t

Parameters of Config Model Subscription Delete

Public Members

uint16_t element_addr

Element Address

uint16_t sub_addr

Subscription Address

uint16_t company_id

Company ID

uint16_t model_id

Model ID

struct esp_ble_mesh_state_change_cfg_netkey_add_t

Parameters of Config NetKey Add

Public Members

uint16_t net_idx

NetKey Index

uint8_t net_key[16]

NetKey

struct esp_ble_mesh_state_change_cfg_netkey_update_t

Parameters of Config NetKey Update

Public Members

uint16_t net_idx

NetKey Index

uint8_t net_key[16]

NetKey

struct esp_ble_mesh_state_change_cfg_netkey_delete_t

Parameter of Config NetKey Delete

Public Members

uint16_t net_idx

NetKey Index

struct esp_ble_mesh_state_change_cfg_appkey_add_t

Parameters of Config AppKey Add

Public Members

uint16_t net_idx

NetKey Index

uint16_t app_idx

AppKey Index

uint8_t app_key[16]

AppKey

struct esp_ble_mesh_state_change_cfg_appkey_update_t

Parameters of Config AppKey Update

Public Members

uint16_t net_idx

NetKey Index

uint16_t app_idx

AppKey Index

uint8_t app_key[16]

AppKey

struct esp_ble_mesh_state_change_cfg_appkey_delete_t

Parameters of Config AppKey Delete

Public Members

uint16_t net_idx

NetKey Index

uint16_t app_idx

AppKey Index

struct esp_ble_mesh_state_change_cfg_model_app_bind_t

Parameters of Config Model App Bind

Public Members

uint16_t element_addr

Element Address

uint16_t app_idx

AppKey Index

uint16_t company_id

Company ID

uint16_t model_id

Model ID

struct esp_ble_mesh_state_change_cfg_model_app_unbind_t

Parameters of Config Model App Unbind

Public Members

uint16_t element_addr

Element Address

uint16_t app_idx

AppKey Index

</