Target-side serial interface module, providing serialized access to all major mesh APIs. More...
Functions | |
| uint32_t | nrf_mesh_serial_init (nrf_mesh_serial_app_rx_cb_t app_rx_cb) |
| Initialize the serial module and all its related submodules. More... | |
| uint32_t | nrf_mesh_serial_enable (void) |
| Enable the serial connection. More... | |
| nrf_mesh_serial_state_t | nrf_mesh_serial_state_get (void) |
| Get the current state of the serial module. More... | |
| 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. More... | |
Detailed Description
Target-side serial interface module, providing serialized access to all major mesh APIs.
Function Documentation
◆ nrf_mesh_serial_init()
| uint32_t nrf_mesh_serial_init | ( | nrf_mesh_serial_app_rx_cb_t | app_rx_cb | ) |
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()
| nrf_mesh_serial_state_t nrf_mesh_serial_state_get | ( | void | ) |
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_dataarray. 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_datapointer 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.