GroveUartExtensions extension

Extension methods for Uart communication in Grove.

on
  • MraaUart

Methods

receive(MraaUartContext context, List<int> bytes, int length, {int timeout = 0}) bool
Receive a specified number of bytes in a specified timeout period. If timeout is 0 the method returns immediately, in practice a timeout should always be supplied. Return of true indicates OK, false is timed out or the receive operation failed.
send(MraaUartContext context, List<int> data, {bool flush = true}) bool
Send bytes with optional UART buffer flushing, defaults to flush. Sends the length of the data list. Returns true if the send succeeded.