Target-side serial interface module, providing serialized access to all major mesh APIs.
More...
|
| Defines |
| Serial interface defines.
|
|
| Types |
| Serial interface type definitions.
|
|
Target-side serial interface module, providing serialized access to all major mesh APIs.
◆ nrf_mesh_serial_init()
Initialize the serial module and all its related submodules.
The device will initialize the given serial bearer, but NOT send the device started event, indicating that the device is ready for operation.
- Parameters
-
[in] | app_rx_cb | Application command handler function pointer, or NULL if the application commands shouldn't be handled. |
- Return values
-
NRF_SUCCESS | The serial module was successfully initialized. |
NRF_ERROR_INVALID_STATE | The serial module has already been initialized. |
NRF_ERROR_NULL | The p_init_params or one or more of the context lists were NULL. |
◆ nrf_mesh_serial_enable()
uint32_t nrf_mesh_serial_enable |
( |
void |
| ) |
|
Enable the serial connection.
Pushes a device started event across the serial line, notifying the controller that the device is ready for operation.
- Return values
-
NRF_SUCCESS | The serial was successfully enabled. |
NRF_ERROR_INVALID_STATE | The serial module has not been initialized, or has already been enabled. |
NRF_ERROR_INTERNAL | The call failed due to an unexpected error in one of the internal sub modules to the serial module. |
◆ nrf_mesh_serial_state_get()
Get the current state of the serial module.
- Returns
- An enum in nrf_mesh_serial_state_t, indicating the current state of the serial.
◆ nrf_mesh_serial_tx()
uint32_t nrf_mesh_serial_tx |
( |
uint8_t * |
p_data, |
|
|
uint32_t |
length |
|
) |
| |
Transmit a serial packet with the APPLICATION_EVT opcode across the serial.
- Parameters
-
[in] | p_data | The byte array to transmit across the serial. |
[in] | length | Length of the p_data array. May not exceed the maximum length NRF_MESH_SERIAL_PAYLOAD_MAXLEN. |
- Return values
-
NRF_SUCCESS | The packet was successfully scheduled for transmission. |
NRF_ERROR_INVALID_STATE | The serial module has not been initialized and enabled. |
NRF_ERROR_NULL | The p_data pointer was NULL. |
NRF_ERROR_INVALID_LENGTH | The length parameter exceeds the maximum serial packet length, or was 0. |
NRF_ERROR_NO_MEM | The serial TX queue was full, and the packet couldn't be scheduled for transmission. |