9#ifndef __MESHX_SERIAL_H__
10#define __MESHX_SERIAL_H__
22#define MXSP_PAYLOAD_MAX_SIZE 255
165 const uint8_t *response, uint8_t response_len);
This file contains the API definitions for the MeshX application.
union meshx_data_payload meshx_data_payload_t
Structure for the BLE Mesh application control message.
union meshx_ctrl_payload meshx_ctrl_payload_t
Structure defines the payload for meshx_ctrl_payload.
struct meshx_ctrl_msg_header meshx_ctrl_msg_header_t
Structure for the BLE Mesh application control message header.
struct meshx_app_element_msg_header meshx_app_element_msg_header_t
Structure for the BLE Mesh application element message header.
Common application definitions and includes for BLE Mesh Node.
meshx_err_t
MeshX Error Codes.
Definition meshx_err.h:43
meshx_err_t meshx_serial_init(void)
Initialize the MeshX Serial Protocol handler.
Definition meshx_serial.c:517
mxsp_gpio_cmd_t
GPIO Command Types (Host -> Engine).
Definition meshx_serial.h:53
@ MXSP_GPIO_CMD_SET_PWM_FREQ
Definition meshx_serial.h:58
@ MXSP_GPIO_CMD_GET_CONFIG
Definition meshx_serial.h:61
@ MXSP_GPIO_CMD_GET_STATE
Definition meshx_serial.h:62
@ MXSP_GPIO_CMD_INTR_ENABLE
Definition meshx_serial.h:59
@ MXSP_GPIO_CMD_TOGGLE
Definition meshx_serial.h:56
@ MXSP_GPIO_CMD_SET_LEVEL
Definition meshx_serial.h:54
@ MXSP_GPIO_CMD_GET_LEVEL
Definition meshx_serial.h:55
@ MXSP_GPIO_CMD_INTR_DISABLE
Definition meshx_serial.h:60
@ MXSP_GPIO_CMD_SET_PWM_DUTY
Definition meshx_serial.h:57
void meshx_serial_set_hosted_mode(bool enabled)
Set the hosted mode state.
Definition meshx_serial.c:444
mxsp_msg_type_t
Definition meshx_serial.h:24
@ MXSP_MSG_TYPE_GPIO_EVT
Definition meshx_serial.h:33
@ MXSP_MSG_TYPE_SYS_EVT_NOTIFY
Definition meshx_serial.h:25
@ MXSP_MSG_TYPE_GPIO_CMD
Definition meshx_serial.h:31
@ MXSP_MSG_TYPE_DATA_EVT_NOTIFY
Definition meshx_serial.h:26
@ MXSP_MSG_TYPE_SYS_CMD_SEND
Definition meshx_serial.h:28
@ MXSP_MSG_TYPE_EL_CMD_SEND
Definition meshx_serial.h:27
@ MXSP_MSG_TYPE_GPIO_RSP
Definition meshx_serial.h:32
@ MXSP_MSG_TYPE_HOSTED_MODE
Definition meshx_serial.h:29
meshx_err_t mxsp_send_gpio_rsp(uint8_t cmd, uint8_t logical_pin, uint8_t status, const uint8_t *response, uint8_t response_len)
Send GPIO response via MXSP.
Definition meshx_serial.c:153
mxsp_gpio_evt_t
GPIO Event Types (Engine -> Host, async).
Definition meshx_serial.h:68
@ MXSP_GPIO_EVT_MODE_CHANGE
Definition meshx_serial.h:71
@ MXSP_GPIO_EVT_INTERRUPT
Definition meshx_serial.h:70
@ MXSP_GPIO_EVT_ERROR
Definition meshx_serial.h:72
@ MXSP_GPIO_EVT_LEVEL_CHANGE
Definition meshx_serial.h:69
void meshx_serial_parse_byte(uint8_t data)
Parse incoming byte stream for MXSP frames.
Definition meshx_serial.c:362
meshx_err_t mxsp_send_ctrl_event(const meshx_ctrl_msg_header_t *evt_header, const meshx_ctrl_payload_t *payload)
Send a control event via MXSP.
Definition meshx_serial.c:118
meshx_err_t mxsp_send_gpio_evt(uint8_t event_type, uint8_t logical_pin, uint8_t value)
Send GPIO async event via MXSP.
Definition meshx_serial.c:174
#define MXSP_PAYLOAD_MAX_SIZE
Definition meshx_serial.h:22
meshx_err_t mxsp_send_data_event(const meshx_app_element_msg_header_t *msg_hdr, const meshx_data_payload_t *payload)
Send data event via MXSP.
Definition meshx_serial.c:136
bool meshx_serial_is_hosted_mode_enabled(void)
Check if hosted mode is enabled.
Definition meshx_serial.c:454
MXSP Frame structure.
Definition meshx_serial.h:113
uint8_t eof
Definition meshx_serial.h:119
uint8_t type
Definition meshx_serial.h:116
uint8_t checksum
Definition meshx_serial.h:118
uint8_t sof
Definition meshx_serial.h:114
uint8_t len
Definition meshx_serial.h:115
uint8_t payload[255]
Definition meshx_serial.h:117
GPIO Command Payload (Host -> Engine).
Definition meshx_serial.h:79
uint8_t cmd
Definition meshx_serial.h:80
uint8_t logical_pin
Definition meshx_serial.h:81
uint8_t payload[8]
Definition meshx_serial.h:84
uint8_t payload_len
Definition meshx_serial.h:83
uint8_t reserved
Definition meshx_serial.h:82
GPIO Event Payload (Engine -> Host, async).
Definition meshx_serial.h:101
uint8_t event_type
Definition meshx_serial.h:102
uint8_t logical_pin
Definition meshx_serial.h:103
uint32_t timestamp
Definition meshx_serial.h:106
uint8_t value
Definition meshx_serial.h:104
uint8_t reserved
Definition meshx_serial.h:105
GPIO Response Payload (Engine -> Host).
Definition meshx_serial.h:90
uint8_t response[8]
Definition meshx_serial.h:95
uint8_t status
Definition meshx_serial.h:93
uint8_t logical_pin
Definition meshx_serial.h:92
uint8_t cmd
Definition meshx_serial.h:91
uint8_t response_len
Definition meshx_serial.h:94