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.
|
Implementation of the BLE Mesh application API. More...
#include <meshx_api.h>
Go to the source code of this file.
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. | |
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_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.
Definition in file meshx_api.c.
#define MESSAGE_BUFF_CLEAR | ( | buff | ) |
Definition at line 13 of file meshx_api.c.
|
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. |
Definition at line 33 of file meshx_api.c.
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. |
Definition at line 148 of file meshx_api.c.
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. |
Definition at line 176 of file meshx_api.c.
|
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. |
Definition at line 66 of file meshx_api.c.
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. |
Definition at line 96 of file meshx_api.c.
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. |
Definition at line 124 of file meshx_api.c.
meshx_app_ctrl_cb_t app_ctrl_cb |
BLE Mesh application control callback
Definition at line 18 of file meshx_api.c.
meshx_app_data_cb_t app_data_cb |
BLE Mesh application data callback
Definition at line 17 of file meshx_api.c.
struct { ... } meshx_api_ctrl |
meshx_app_api_msg_t msg_buff |
BLE Mesh application message buffer
Definition at line 19 of file meshx_api.c.