MeshX 0.3
This repository provides an implementation for Bluetooth Low Energy (BLE) Mesh network nodes. The project allows you to create BLE mesh nodes that can communicate with each other, enabling the development of smart home solutions or other IoT-based applications.
Loading...
Searching...
No Matches
esp_prov_srv_model.c File Reference

Implementation of BLE Mesh provisioning server model for ESP32. This file contains the provisioning callback handling, control task message mapping, and provisioning parameter initialization. It facilitates the provisioning process and event handling for BLE Mesh. More...

Include dependency graph for esp_prov_srv_model.c:

Go to the source code of this file.

Functions

static void meshx_provisioning_cb (MESHX_PROV_CB_EVT event, const MESHX_PROV_CB_PARAM *param)
 Callback function for BLE Mesh provisioning events.
 
meshx_err_t meshx_plat_init_prov (const uint8_t *uuid)
 Initialize provisioning parameters.
 
meshx_ptr_t meshx_plat_get_prov (void)
 Get the provisioning parameters.
 

Variables

static MESHX_PROV g_meshx_prov
 Global provisioning structure.
 

Detailed Description

Implementation of BLE Mesh provisioning server model for ESP32. This file contains the provisioning callback handling, control task message mapping, and provisioning parameter initialization. It facilitates the provisioning process and event handling for BLE Mesh.

Copyright (c) 2024 - 2025 MeshX

Author
Pranjal Chanda

Definition in file esp_prov_srv_model.c.

Function Documentation

◆ meshx_plat_get_prov()

meshx_ptr_t meshx_plat_get_prov ( void )

Get the provisioning parameters.

This function returns a pointer to the global provisioning parameters.

Returns
Pointer to the global provisioning parameters.

Definition at line 78 of file esp_prov_srv_model.c.

79{
81}
static MESHX_PROV g_meshx_prov
Global provisioning structure.
void * meshx_ptr_t
Here is the caller graph for this function:

◆ meshx_plat_init_prov()

meshx_err_t meshx_plat_init_prov ( const uint8_t * uuid)

Initialize provisioning parameters.

This function initializes the provisioning parameters by copying the UUID from the provided server configuration and registering the provisioning callback.

Parameters
uuidPointer to the UUID of the device.
Returns
  • MESHX_SUCCESS: Success
  • MESHX_FAIL: Failed to register provisioning callback

Definition at line 59 of file esp_prov_srv_model.c.

60{
61 if (!uuid)
62 {
63 MESHX_LOGE(MODULE_ID_MODEL_SERVER, "Invalid server configuration");
64 return MESHX_INVALID_ARG;
65 }
66 g_meshx_prov.uuid = uuid;
67
68 return esp_ble_mesh_register_prov_callback((esp_ble_mesh_prov_cb_t)meshx_provisioning_cb);
69}
static void meshx_provisioning_cb(MESHX_PROV_CB_EVT event, const MESHX_PROV_CB_PARAM *param)
Callback function for BLE Mesh provisioning events.
@ MESHX_INVALID_ARG
Definition meshx_err.h:42
#define MESHX_LOGE(module_id, format,...)
Definition meshx_log.h:73
@ MODULE_ID_MODEL_SERVER
Definition module_id.h:30
Here is the call graph for this function:
Here is the caller graph for this function:

◆ meshx_provisioning_cb()

static void meshx_provisioning_cb ( MESHX_PROV_CB_EVT event,
const MESHX_PROV_CB_PARAM * param )
static

Callback function for BLE Mesh provisioning events.

This function is called whenever a BLE Mesh provisioning event occurs.

Parameters
eventThe provisioning event type.
paramPointer to the provisioning event parameters.

Definition at line 31 of file esp_prov_srv_model.c.

33{
34 MESHX_LOGD(MODULE_ID_MODEL_SERVER, "Event 0x%02x", event);
35
36 meshx_prov_srv_param_t prov_srv_param;
37
38 memcpy(&prov_srv_param.param, param, sizeof(meshx_prov_cb_param_t));
39 prov_srv_param.prov_evt = event;
40
42 {
43 MESHX_LOGE(MODULE_ID_MODEL_SERVER, "Failed to notify model event");
44 }
45}
struct meshx_ble_mesh_prov_srv_param meshx_prov_srv_param_t
@ MESHX_SUCCESS
Definition meshx_err.h:40
#define MESHX_LOGD(module_id, format,...)
Definition meshx_log.h:113
meshx_err_t meshx_prov_srv_notify_plat_event(meshx_prov_srv_param_t *param)
Notify the model event to the application.
BLE Mesh Node/Provisioner callback parameters union.
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ g_meshx_prov

MESHX_PROV g_meshx_prov
static

Global provisioning structure.

This structure holds the global provisioning configuration.

Definition at line 21 of file esp_prov_srv_model.c.