示例#1
0
int rn2903_write(const rn2903_context dev, const char *buffer, size_t len)
{
    assert(dev != NULL);

    int rv = mraa_uart_write(dev->uart, buffer, len);
    mraa_uart_flush(dev->uart);

    return rv;
}
示例#2
0
mrb_value mrb_mraa_uart_flush(mrb_state *mrb, mrb_value self) {
  mraa_uart_context uart;
  mraa_result_t result;

  uart = (mraa_uart_context)mrb_data_get_ptr(mrb, self, &mrb_mraa_uart_ctx_type);

  result = mraa_uart_flush(uart);
  if (result != MRAA_SUCCESS) {
    mrb_raise(mrb, E_RUNTIME_ERROR, "Could not flush port");
  }
  return self;
}
示例#3
0
文件: uart.hpp 项目: emutex/mraa
 /**
  * Flush the outbound data.
  * Blocks until complete.
  *
  * @return Result of operation
  */
 Result
 flush()
 {
     return (Result) mraa_uart_flush(m_uart);
 }