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.
|
This file contains the API definitions for the MeshX application. More...
Go to the source code of this file.
Data Structures | |
struct | meshx_api_relay_server_evt |
Structure defines the payload for MESHX_ELEMENT_TYPE_RELAY_SERVER. More... | |
struct | meshx_api_light_cwww_server_evt |
Structure defines the payload for MESHX_ELEMENT_TYPE_LIGHT_CWWW_SERVER. More... | |
struct | meshx_api_relay_client_state |
Structure defines the payload for MESHX_ELEMENT_TYPE_RELAY_CLIENT. More... | |
struct | meshx_api_light_cwww_client_evt |
Structure defines the payload for MESHX_ELEMENT_TYPE_LIGHT_CWWW_CLIENT. More... | |
union | meshx_data_payload |
Structure for the BLE Mesh application control message. More... | |
union | meshx_ctrl_payload |
Structure defines the payload for meshx_ctrl_payload. More... | |
struct | meshx_app_element_msg_header |
Structure for the BLE Mesh application element message header. More... | |
struct | meshx_ctrl_msg_header |
Structure for the BLE Mesh application control message header. More... | |
struct | meshx_app_api_msg |
Structure for the BLE Mesh application API message. More... | |
Macros | |
#define | MESHX_APP_API_MSG_MAX_SIZE sizeof(meshx_data_payload_t) |
#define | MESHX_ELEMENT_FUNC_ID_RELAY_SERVER_ONN_OFF 0x00 |
#define | MESHX_ELEMENT_FUNC_ID_LIGHT_CWWW_SERVER_ONN_OFF 0x00 |
#define | MESHX_ELEMENT_FUNC_ID_LIGHT_CWWW_SERVER_CTL 0x01 |
#define | MESHX_ELEMENT_FUNC_ID_LIGHT_CWWW_CLIENT_ONN_OFF 0x00 |
#define | MESHX_ELEMENT_FUNC_ID_LIGHT_CWWW_CLIENT_CTL 0x01 |
Typedefs | |
typedef enum meshx_api_type | meshx_api_type_t |
Enumeration of BLE Mesh application API message types. | |
typedef enum meshx_element_type | meshx_element_type_t |
Enumeration of BLE Mesh application API message types. | |
typedef struct meshx_api_relay_server_evt | meshx_api_relay_server_evt_t |
Structure defines the payload for MESHX_ELEMENT_TYPE_RELAY_SERVER. | |
typedef struct meshx_api_light_cwww_server_evt | meshx_api_light_cwww_server_evt_t |
Structure defines the payload for MESHX_ELEMENT_TYPE_LIGHT_CWWW_SERVER. | |
typedef struct meshx_api_relay_client_state | meshx_api_relay_client_evt_t |
Structure defines the payload for MESHX_ELEMENT_TYPE_RELAY_CLIENT. | |
typedef struct meshx_api_light_cwww_client_evt | meshx_api_light_cwww_client_evt_t |
Structure defines the payload for MESHX_ELEMENT_TYPE_LIGHT_CWWW_CLIENT. | |
typedef union meshx_data_payload | meshx_data_payload_t |
Structure for the BLE Mesh application control message. | |
typedef union meshx_ctrl_payload | meshx_ctrl_payload_t |
Structure defines the payload for meshx_ctrl_payload. | |
typedef struct meshx_app_element_msg_header | meshx_app_element_msg_header_t |
Structure for the BLE Mesh application element message header. | |
typedef struct meshx_ctrl_msg_header | meshx_ctrl_msg_header_t |
Structure for the BLE Mesh application control message header. | |
typedef struct meshx_app_api_msg | meshx_app_api_msg_t |
Structure for the BLE Mesh application API message. | |
typedef meshx_err_t(* | meshx_app_data_cb_t) (const meshx_app_element_msg_header_t *msg_hdr, const meshx_data_payload_t *msg) |
BLE Mesh application callback function. | |
typedef meshx_err_t(* | meshx_app_ctrl_cb_t) (const meshx_ctrl_msg_header_t *msg_hdr, const meshx_ctrl_payload_t *msg) |
BLE Mesh application control callback function. | |
Enumerations | |
enum | meshx_api_type { MESHX_API_TYPE_DATA = CONTROL_TASK_MSG_EVT_DATA , MESHX_API_TYPE_CTRL = CONTROL_TASK_MSG_EVT_CTRL } |
Enumeration of BLE Mesh application API message types. More... | |
enum | meshx_element_type { MESHX_ELEMENT_TYPE_RELAY_SERVER , MESHX_ELEMENT_TYPE_RELAY_CLIENT , MESHX_ELEMENT_TYPE_LIGHT_CWWW_SERVER , MESHX_ELEMENT_TYPE_LIGHT_CWWW_CLIENT , MESHX_ELEMENT_TYPE_MAX } |
Enumeration of BLE Mesh application API message types. More... | |
Functions | |
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. | |
This file contains the API definitions for the MeshX application.
The MeshX API provides functions and structures to interact with the BLE Mesh application. It includes message types, payload structures, and callback function definitions.
Definition in file meshx_api.h.
#define MESHX_APP_API_MSG_MAX_SIZE sizeof(meshx_data_payload_t) |
Definition at line 18 of file meshx_api.h.
#define MESHX_ELEMENT_FUNC_ID_LIGHT_CWWW_CLIENT_CTL 0x01 |
Definition at line 29 of file meshx_api.h.
#define MESHX_ELEMENT_FUNC_ID_LIGHT_CWWW_CLIENT_ONN_OFF 0x00 |
Definition at line 28 of file meshx_api.h.
#define MESHX_ELEMENT_FUNC_ID_LIGHT_CWWW_SERVER_CTL 0x01 |
Definition at line 25 of file meshx_api.h.
#define MESHX_ELEMENT_FUNC_ID_LIGHT_CWWW_SERVER_ONN_OFF 0x00 |
Definition at line 24 of file meshx_api.h.
#define MESHX_ELEMENT_FUNC_ID_RELAY_SERVER_ONN_OFF 0x00 |
Definition at line 21 of file meshx_api.h.
typedef struct meshx_api_light_cwww_client_evt meshx_api_light_cwww_client_evt_t |
Structure defines the payload for MESHX_ELEMENT_TYPE_LIGHT_CWWW_CLIENT.
typedef struct meshx_api_light_cwww_server_evt meshx_api_light_cwww_server_evt_t |
Structure defines the payload for MESHX_ELEMENT_TYPE_LIGHT_CWWW_SERVER.
typedef struct meshx_api_relay_client_state meshx_api_relay_client_evt_t |
Structure defines the payload for MESHX_ELEMENT_TYPE_RELAY_CLIENT.
typedef struct meshx_api_relay_server_evt meshx_api_relay_server_evt_t |
Structure defines the payload for MESHX_ELEMENT_TYPE_RELAY_SERVER.
typedef enum meshx_api_type meshx_api_type_t |
Enumeration of BLE Mesh application API message types.
typedef struct meshx_app_api_msg meshx_app_api_msg_t |
Structure for the BLE Mesh application API message.
This structure defines the BLE Mesh application API message.
typedef meshx_err_t(* meshx_app_ctrl_cb_t) (const meshx_ctrl_msg_header_t *msg_hdr, const meshx_ctrl_payload_t *msg) |
BLE Mesh application control callback function.
This function is the BLE Mesh application control callback function.
[in] | msg_hdr | Pointer to the BLE Mesh application control message header. |
[in] | msg | Pointer to the message. |
Definition at line 199 of file meshx_api.h.
typedef meshx_err_t(* meshx_app_data_cb_t) (const meshx_app_element_msg_header_t *msg_hdr, const meshx_data_payload_t *msg) |
BLE Mesh application callback function.
This function is the BLE Mesh application callback function.
[in] | msg_hdr | Pointer to the BLE Mesh application message header. |
[in] | msg | Pointer to the message. |
Definition at line 187 of file meshx_api.h.
typedef struct meshx_app_element_msg_header meshx_app_element_msg_header_t |
Structure for the BLE Mesh application element message header.
This structure defines the header for BLE Mesh application element messages.
typedef struct meshx_ctrl_msg_header meshx_ctrl_msg_header_t |
Structure for the BLE Mesh application control message header.
This structure defines the header for BLE Mesh application control messages.
typedef union meshx_ctrl_payload meshx_ctrl_payload_t |
Structure defines the payload for meshx_ctrl_payload.
typedef union meshx_data_payload meshx_data_payload_t |
Structure for the BLE Mesh application control message.
This structure defines the BLE Mesh application control payloads.
typedef enum meshx_element_type meshx_element_type_t |
Enumeration of BLE Mesh application API message types.
enum meshx_api_type |
Enumeration of BLE Mesh application API message types.
Definition at line 33 of file meshx_api.h.
enum meshx_element_type |
Enumeration of BLE Mesh application API message types.
Enumerator | |
---|---|
MESHX_ELEMENT_TYPE_RELAY_SERVER | |
MESHX_ELEMENT_TYPE_RELAY_CLIENT | |
MESHX_ELEMENT_TYPE_LIGHT_CWWW_SERVER | |
MESHX_ELEMENT_TYPE_LIGHT_CWWW_CLIENT | |
MESHX_ELEMENT_TYPE_MAX |
Definition at line 42 of file meshx_api.h.
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.
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.