Macros | |
#define | SERIAL_API_VERSION 10 |
Serial API version. More... | |
Functions | |
uint32_t | serial_init (void) |
Initializes the serial interface abstraction layer. More... | |
uint32_t | serial_start (void) |
Starts the serial interface by sending a device started event to the host. More... | |
uint32_t | serial_packet_buffer_get (uint16_t packet_len, serial_packet_t **pp_packet) |
Returns a serial packet buffer of the requested length. More... | |
void | serial_tx (const serial_packet_t *p_packet) |
Queues a packet for transmission on the serial interface. More... | |
void | serial_process (void) |
Schedule processing for serial RX/TX. | |
uint8_t | serial_translate_error (uint32_t status) |
Translates an NRF_* error code into an ACI error code. More... | |
nrf_mesh_serial_state_t | serial_state_get (void) |
Get current state of the serial module. More... | |
void | serial_cmd_rsp_send (uint8_t opcode, uint8_t status, const uint8_t *p_data, uint16_t length) |
Send a simple command response to the given opcode, with the given serial status. More... | |
uint32_t serial_init | ( | void | ) |
Initializes the serial interface abstraction layer.
NRF_SUCCESS | The serial interface was successfully initialized. |
NRF_ERROR_INVALID_STATE | The serial module has already been initialized. |
uint32_t serial_start | ( | void | ) |
Starts the serial interface by sending a device started event to the host.
NRF_SUCCESS | The serial interface was successfully started. |
NRF_ERROR_INVALID_STATE | The serial interface has not been initialized, or has been started before. |
NRF_ERROR_NO_MEM | The packet queue is full. |
uint32_t serial_packet_buffer_get | ( | uint16_t | packet_len, |
serial_packet_t ** | pp_packet | ||
) |
Returns a serial packet buffer of the requested length.
[in] | packet_len | The serial packet length (excludes the length field of the packet). |
[out] | pp_packet | The serial packet instance pointer, returns the allocated buffer. |
NRF_SUCCESS | The packet is reserved successfully, and pp_packet points to a valid packet pointer. |
NRF_ERROR_INVALID_STATE | The serial module has not been started. |
NRF_ERROR_INVALID_LENGTH | The length of the packet requested cannot be 0 or greater than the maximum available packet size |
void serial_tx | ( | const serial_packet_t * | p_packet | ) |
Queues a packet for transmission on the serial interface.
[in] | p_packet | Pointer to the packet to transmit. |
uint8_t serial_translate_error | ( | uint32_t | status | ) |
Translates an NRF_* error code into an ACI error code.
status | the status code to translate. |
nrf_mesh_serial_state_t serial_state_get | ( | void | ) |
Get current state of the serial module.
void serial_cmd_rsp_send | ( | uint8_t | opcode, |
uint8_t | status, | ||
const uint8_t * | p_data, | ||
uint16_t | length | ||
) |
Send a simple command response to the given opcode, with the given serial status.
[in] | opcode | Opcode to reply to. |
[in] | status | Reply status code. |
[in] | p_data | Additional data to be added to the reply (optional). |
[in] | length | Length of additional data. |