Functions | |
void | serial_bearer_init (void) |
Initializes the serial interface. | |
uint32_t | serial_bearer_packet_buffer_get (uint16_t packet_len, serial_packet_t **pp_packet) |
Allocates a serial packet from the serial_bearer buffer. More... | |
uint32_t | serial_bearer_blocking_buffer_get (uint16_t packet_len, serial_packet_t **pp_packet) |
Allocates a serial packet from the serial_bearer buffer. More... | |
void | serial_bearer_tx (const serial_packet_t *p_packet) |
Transmits a serial packet. More... | |
bool | serial_bearer_rx_get (serial_packet_t *p_packet) |
Get a packet from the RX queue. More... | |
bool | serial_bearer_rx_pending (void) |
Check if any serial packets have been received from the peer. More... | |
uint32_t serial_bearer_packet_buffer_get | ( | uint16_t | packet_len, |
serial_packet_t ** | pp_packet | ||
) |
Allocates a serial packet from the serial_bearer buffer.
[in] | packet_len | The value of the packet length field for the serial packet. |
[out] | pp_packet | The allocated packet pointer. |
NRF_SUCCESS | The packet is reserved successfully, and pp_packet points to a valid packet pointer. |
NRF_ERROR_NO_MEM | The packet buffer does not have enough available memory. |
NRF_ERROR_INVALID_LENGTH | The length of the packet requested cannot be 0 or greater than the maximum available packet size. |
uint32_t serial_bearer_blocking_buffer_get | ( | uint16_t | packet_len, |
serial_packet_t ** | pp_packet | ||
) |
Allocates a serial packet from the serial_bearer buffer.
This call will not return until a buffer is available.
[in] | packet_len | The value of the packet length field for the serial packet. |
[out] | pp_packet | The allocated packet pointer. |
NRF_SUCCESS | The packet is reserved successfully, and pp_packet points to a valid packet pointer. |
NRF_ERROR_INVALID_LENGTH | The length of the packet requested cannot be 0 or greater than the maximum available packet size. |
void serial_bearer_tx | ( | const serial_packet_t * | p_packet | ) |
Transmits a serial packet.
[in] | p_packet | The pointer to the serial packet that shall be transmitted |
bool serial_bearer_rx_get | ( | serial_packet_t * | p_packet | ) |
Get a packet from the RX queue.
[in,out] | p_packet | Pointer to a packet structure to copy the packet into. |
bool serial_bearer_rx_pending | ( | void | ) |
Check if any serial packets have been received from the peer.