|
MeshX 0.4
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.
|
Implementation of the BLE Mesh application API. More...
#include <meshx_api.h>Macros | |
| #define | MESSAGE_BUFF_CLEAR(buff) |
Functions | |
| static meshx_err_t | meshx_api_control_task_handler (const dev_struct_t *pdev, control_task_msg_evt_t evt, const void *params) |
| Control task handler for BLE Mesh application messages. | |
| static meshx_err_t | meshx_prepare_data_message (uint16_t element_id, uint16_t element_type, uint16_t func_id, uint16_t msg_len, const void *msg) |
| Prepares a message to be sent to the BLE Mesh application. | |
| static meshx_err_t | meshx_prepare_ctrl_message (meshx_ctrl_evt_t evt, uint16_t msg_len, const void *msg) |
| Prepares a control message to be sent to the BLE Mesh application. | |
| meshx_err_t | meshx_send_msg_to_app (uint16_t element_id, uint16_t element_type, uint16_t func_id, uint16_t msg_len, const void *msg) |
| Sends a message to the BLE Mesh application. | |
| meshx_err_t | meshx_send_ctrl_msg_to_app (meshx_ctrl_evt_t evt, uint16_t msg_len, const void *msg) |
| Sends a control message to the BLE Mesh application. | |
| meshx_err_t | meshx_send_msg_to_element (uint16_t element_id, uint16_t element_type, uint16_t func_id, uint16_t msg_len, const void *msg) |
| Sends a message to the element. | |
| meshx_err_t | meshx_app_reg_element_callback (meshx_app_data_cb_t cb) |
| Registers the BLE Mesh application callback. | |
| meshx_err_t | meshx_app_reg_system_events_callback (meshx_app_ctrl_cb_t cb) |
| Registers the BLE Mesh application control callback. | |
Variables | |
| struct { | |
| meshx_app_data_cb_t app_data_cb | |
| meshx_app_ctrl_cb_t app_ctrl_cb | |
| meshx_app_api_msg_t msg_buff | |
| } | meshx_api_ctrl |
Implementation of the BLE Mesh application API.
This file contains the implementation of the BLE Mesh application API. It includes functions to send messages to the BLE Mesh application and register the BLE Mesh application callback.
| #define MESSAGE_BUFF_CLEAR | ( | buff | ) |
|
static |
Control task handler for BLE Mesh application messages.
This function handles BLE Mesh application messages.
| [in] | pdev | Pointer to the device structure. |
| [in] | evt | Event type. |
| [in] | params | Pointer to the message parameters. |
| meshx_err_t meshx_app_reg_element_callback | ( | meshx_app_data_cb_t | cb | ) |
Registers the BLE Mesh application callback.
This function registers the BLE Mesh application data path callback.
| [in] | cb | Pointer to the application callback. |
| meshx_err_t meshx_app_reg_system_events_callback | ( | meshx_app_ctrl_cb_t | cb | ) |
Registers the BLE Mesh application control callback.
This function registers the BLE Mesh application control callback.
| [in] | cb | Pointer to the control callback. |
|
static |
Prepares a control message to be sent to the BLE Mesh application.
This function prepares a control message to be sent to the BLE Mesh application.
| [in] | evt | The event ID. |
| [in] | msg_len | The message length. |
| [in] | msg | Pointer to the message. |
|
static |
Prepares a message to be sent to the BLE Mesh application.
This function prepares a message to be sent to the BLE Mesh application.
| [in] | element_id | The element ID. |
| [in] | element_type | The element type. |
| [in] | func_id | The function ID. |
| [in] | msg_len | The message length. |
| [in] | msg | Pointer to the message. |
| meshx_err_t meshx_send_ctrl_msg_to_app | ( | meshx_ctrl_evt_t | evt, |
| uint16_t | msg_len, | ||
| const void * | msg ) |
Sends a control message to the BLE Mesh application.
This function sends a control message to the BLE Mesh application.
| [in] | evt | The event ID. |
| [in] | msg_len | The message length. |
| [in] | msg | Pointer to the message. |
| meshx_err_t meshx_send_msg_to_app | ( | uint16_t | element_id, |
| uint16_t | element_type, | ||
| uint16_t | func_id, | ||
| uint16_t | msg_len, | ||
| const void * | msg ) |
Sends a message to the BLE Mesh application.
This function sends a message to the BLE Mesh application.
| [in] | element_id | The element ID. |
| [in] | element_type | The element type. |
| [in] | func_id | The function ID. |
| [in] | msg_len | The message length. |
| [in] | msg | Pointer to the message. |
| meshx_err_t meshx_send_msg_to_element | ( | uint16_t | element_id, |
| uint16_t | element_type, | ||
| uint16_t | func_id, | ||
| uint16_t | msg_len, | ||
| const void * | msg ) |
Sends a message to the element.
This function sends a message to the element from BLE mesh Application
| [in] | element_id | The element ID. |
| [in] | element_type | The element type. |
| [in] | func_id | The function ID. |
| [in] | msg_len | The message length. |
| [in] | msg | Pointer to the message. |
| meshx_app_ctrl_cb_t app_ctrl_cb |
BLE Mesh application control callback
| meshx_app_data_cb_t app_data_cb |
BLE Mesh application data callback
| struct { ... } meshx_api_ctrl |
| meshx_app_api_msg_t msg_buff |
BLE Mesh application message buffer