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
meshx_prov_srv.h File Reference

Header file for provisioning related definitions and functions. More...

Include dependency graph for meshx_prov_srv.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

meshx_err_t meshx_init_prov (dev_struct_t *p_dev, const meshx_prov_params_t *prov_cfg)
 Initialize provisioning parameters.
 
meshx_err_t meshx_prov_srv_reg_el_client_cb (prov_srv_cb_t cb)
 Register a callback function for provisioning events.
 
meshx_err_t meshx_prov_srv_reg_el_server_cb (prov_srv_cb_t cb)
 Register a callback function for provisioning events.
 

Detailed Description

Header file for provisioning related definitions and functions.

Copyright © 2024 - 2025 MeshX

This file contains the definitions and function declarations for provisioning in the BLE mesh node application.

Author
Pranjal Chanda

Definition in file meshx_prov_srv.h.

Function Documentation

◆ meshx_init_prov()

meshx_err_t meshx_init_prov ( dev_struct_t * p_dev,
const meshx_prov_params_t * prov_cfg )

Initialize provisioning parameters.

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

Parameters
[in]p_devPointer to the device structure.
[in]prov_cfgPointer to the provisioning parameters structure containing the UUID.
Returns
  • MESHX_SUCCESS: Success
  • MESHX_FAIL: Failed to register provisioning callback

Definition at line 313 of file meshx_prov_srv.c.

314{
315 if (!prov_cfg || memcmp(prov_cfg->uuid, MESHX_UUID_EMPTY, sizeof(meshx_uuid_addr_t)) == 0)
316 {
317 MESHX_LOGE(MODULE_ID_MODEL_SERVER, "Invalid server configuration");
318 return MESHX_INVALID_ARG;
319 }
320
322 if (err != MESHX_SUCCESS)
323 {
324 MESHX_LOGE(MODULE_ID_MODEL_SERVER, "Failed to register provisioning callback");
325 return err;
326 }
327
329 if (err != MESHX_SUCCESS)
330 {
331 MESHX_LOGE(MODULE_ID_MODEL_SERVER, "Failed to register provisioning callback");
332 return err;
333 }
334
335 err = meshx_init_freshboot_timer(p_dev, prov_cfg->freshboot_timeout_ms);
336 if (err != MESHX_SUCCESS)
337 {
338 MESHX_LOGE(MODULE_ID_MODEL_SERVER, "Failed to initialize boot timer");
339 return err;
340 }
341
342 return meshx_plat_init_prov(prov_cfg->uuid);
343}
#define MESHX_UUID_EMPTY
uint8_t meshx_uuid_addr_t[MESHX_UUID_ADDR_LEN]
meshx_err_t meshx_plat_init_prov(const uint8_t *uuid)
Initialize provisioning parameters.
meshx_err_t
MeshX Error Codes.
Definition meshx_err.h:39
@ MESHX_SUCCESS
Definition meshx_err.h:40
@ MESHX_INVALID_ARG
Definition meshx_err.h:42
#define MESHX_LOGE(module_id, format,...)
Definition meshx_log.h:73
static meshx_err_t meshx_init_freshboot_timer(dev_struct_t *p_dev, uint16_t timeout_ms)
Initializes the fresh boot timer.
static meshx_err_t meshx_prov_srv_meshx_reg_cb(void)
Register the BLE Mesh provisioning callback for MeshX Layer Internal.
static meshx_err_t meshx_prov_srv_reg_from_ble_cb(void)
Register the BLE Mesh provisioning callback.
@ 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_prov_srv_reg_el_client_cb()

meshx_err_t meshx_prov_srv_reg_el_client_cb ( prov_srv_cb_t cb)

Register a callback function for provisioning events.

This function registers a callback function that will be called when certain provisioning events occur.

Parameters
[in]cbThe callback function to register.
Returns
  • MESHX_SUCCESS: Success
  • MESHX_FAIL: Failed to register the callback

Definition at line 357 of file meshx_prov_srv.c.

358{
362 (prov_srv_cb_t)cb
363 );
364}
control_task_msg_handle_t prov_srv_cb_t
@ CONTROL_TASK_MSG_CODE_PROVISION
meshx_err_t control_task_msg_subscribe(control_task_msg_code_t msg_code, control_task_msg_evt_t evt_bmap, control_task_msg_handle_t callback)
Subscribe to a control task message.
#define MESHX_PROV_SRV_CLIENT_EVENT_BMAP
Here is the call graph for this function:
Here is the caller graph for this function:

◆ meshx_prov_srv_reg_el_server_cb()

meshx_err_t meshx_prov_srv_reg_el_server_cb ( prov_srv_cb_t cb)

Register a callback function for provisioning events.

This function registers a callback function that will be called when certain provisioning events occur.

Parameters
[in]cbThe callback function to register.
Returns
  • MESHX_SUCCESS: Success
  • MESHX_FAIL: Failed to register the callback

Definition at line 378 of file meshx_prov_srv.c.

379{
383 (prov_srv_cb_t)cb
384 );
385}
#define MESHX_PROV_SRV_SERVER_EVENT_BMAP
Here is the call graph for this function:
Here is the caller graph for this function: