This module includes the platform abstraction for UART communication.

Functions

otError otPlatUartEnable (void)
 Enable the UART.
 
otError otPlatUartDisable (void)
 Disable the UART.
 
otError otPlatUartSend (const uint8_t *aBuf, uint16_t aBufLength)
 Send bytes over the UART.
 
otError otPlatUartFlush (void)
 Flush the outgoing transmit buffer and wait for the data to be sent.
 
void otPlatUartSendDone (void)
 The UART driver calls this method to notify OpenThread that the requested bytes have been sent.
 
void otPlatUartReceived (const uint8_t *aBuf, uint16_t aBufLength)
 The UART driver calls this method to notify OpenThread that bytes have been received.

Detailed Description

This module includes the platform abstraction for UART communication.

Function Documentation

◆ otPlatUartDisable()

otError otPlatUartDisable ( void  )

Disable the UART.

Return values
OT_ERROR_NONESuccessfully disabled the UART.
OT_ERROR_FAILEDFailed to disable the UART.

◆ otPlatUartEnable()

otError otPlatUartEnable ( void  )

Enable the UART.

Return values
OT_ERROR_NONESuccessfully enabled the UART.
OT_ERROR_FAILEDFailed to enabled the UART.

◆ otPlatUartFlush()

otError otPlatUartFlush ( void  )

Flush the outgoing transmit buffer and wait for the data to be sent.

This is called when the CLI UART interface has a full buffer but still wishes to send more data.

Return values
OT_ERROR_NONEFlush succeeded, we can proceed to write more data to the buffer.
OT_ERROR_NOT_IMPLEMENTEDDriver does not support synchronous flush.
OT_ERROR_INVALID_STATEDriver has no data to flush.

◆ otPlatUartReceived()

void otPlatUartReceived ( const uint8_t *  aBuf,
uint16_t  aBufLength 
)

The UART driver calls this method to notify OpenThread that bytes have been received.

Parameters
[in]aBufA pointer to the received bytes.
[in]aBufLengthThe number of bytes received.

◆ otPlatUartSend()

otError otPlatUartSend ( const uint8_t *  aBuf,
uint16_t  aBufLength 
)

Send bytes over the UART.

Parameters
[in]aBufA pointer to the data buffer.
[in]aBufLengthNumber of bytes to transmit.
Return values
OT_ERROR_NONESuccessfully started transmission.
OT_ERROR_FAILEDFailed to start the transmission.