25serial_port_t serial_open_readonly(
const char* port_name)
27 serial_port_t port = {.file =
file_open(port_name, O_RDONLY | O_NOCTTY)};
35serial_port_t serial_open_readwrite(
const char* port_name)
37 serial_port_t port = {.file =
file_open(port_name, O_RDWR | O_NOCTTY)};
45 serial_port_t* port = malloc(
sizeof(serial_port_t));
47 *port = serial_open_readwrite(port_name);
ifstream_t file_open(const char *file_name, int flags)
Construct a file input stream : Open the file and allocate the buffer.
bool file_accumulate_infinite(ifstream_t *file, size_t count)
If possible, accumulate count bytes before returning.
Configure and read from serial ports as buffered input streams.
serial_port_t * serial_new_readwrite(const char *port_name)
Allocates a serial port and opens it.