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; }
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; }
/** * Flush the outbound data. * Blocks until complete. * * @return Result of operation */ Result flush() { return (Result) mraa_uart_flush(m_uart); }