59 throw std::invalid_argument(
"Error initialising UART");
74 throw std::invalid_argument(
"Error initialising UART");
89 throw std::invalid_argument(
"Invalid UART context");
149 char* data = (
char*) malloc(
sizeof(
char) * length);
151 throw std::bad_alloc();
155 std::string ret(data, v);
Result
Definition: types.hpp:204
Result setBaudRate(unsigned int baud)
Definition: uart.hpp:224
std::string readStr(int length)
Definition: uart.hpp:147
mraa_uart_parity_t
Definition: types.h:255
Uart(void *uart_context)
Definition: uart.hpp:84
UartParity
Definition: types.hpp:250
int mraa_uart_write(mraa_uart_context dev, const char *buf, size_t length)
int read(char *data, int length)
Definition: uart.hpp:121
bool dataAvailable(unsigned int millis=0)
Definition: uart.hpp:180
Uart(int uart)
Definition: uart.hpp:54
struct _uart * mraa_uart_context
Definition: uart.h:49
Uart(std::string path)
Definition: uart.hpp:69
mraa_result_t mraa_uart_stop(mraa_uart_context dev)
mraa_result_t mraa_uart_sendbreak(mraa_uart_context dev, int duration)
Result flush()
Definition: uart.hpp:195
API to UART (enabling only)
Definition: uart.hpp:45
Result setNonBlocking(bool nonblock)
Definition: uart.hpp:280
mraa_result_t mraa_uart_set_flowcontrol(mraa_uart_context dev, mraa_boolean_t xonxoff, mraa_boolean_t rtscts)
~Uart()
Definition: uart.hpp:95
mraa_result_t mraa_uart_flush(mraa_uart_context dev)
std::string getDevicePath()
Definition: uart.hpp:107
Result setFlowcontrol(bool xonxoff, bool rtscts)
Definition: uart.hpp:253
mraa_uart_context mraa_uart_init_raw(const char *path)
Result setMode(int bytesize, UartParity parity, int stopbits)
Definition: uart.hpp:240
mraa_boolean_t mraa_uart_data_available(mraa_uart_context dev, unsigned int millis)
Result sendBreak(int duration)
Definition: uart.hpp:210
const char * mraa_uart_get_dev_path(mraa_uart_context dev)
int writeStr(std::string data)
Definition: uart.hpp:167
mraa_result_t mraa_uart_set_mode(mraa_uart_context dev, int bytesize, mraa_uart_parity_t parity, int stopbits)
int mraa_uart_read(mraa_uart_context dev, char *buf, size_t length)
mraa_uart_context mraa_uart_init(int uart)
Result setTimeout(int read, int write, int interchar)
Definition: uart.hpp:268
int write(const char *data, int length)
Definition: uart.hpp:134
mraa_result_t mraa_uart_set_non_blocking(mraa_uart_context dev, mraa_boolean_t nonblock)
mraa_result_t mraa_uart_set_timeout(mraa_uart_context dev, int read, int write, int interchar)
mraa_result_t mraa_uart_set_baudrate(mraa_uart_context dev, unsigned int baud)