el_set_tty_dev¶
NAME¶
el_set_tty_dev - sets and enables output to TTY device (like serial console).
SYNOPSIS¶
#include <embedlog.h>
int el_set_tty_dev(const char *dev, unsigned speed);
int el_oset_tty_dev(struct el *el, const char *dev, unsigned speed);
DESCRIPTION¶
Tells embedlog to use dev serial device configured to speed. Serial device will also be configured to transmit in 8 bits of data, without parity and one stop bit (8N1). Logger uses only transmit pin (TX) and will translate all LF into CR-LF. If speed is configured to B0, serial port settings will not be altered, library will simply open port and will happily work on current serial settings.
EXAMPLES¶
el_set_tty_dev("/dev/ttyS0", B115200);
el_print("this goes to /dev/ttyS0");
RETURN VALUE¶
0 on succes, or -1 and set errno on failure.
ERRORS¶
- ERRORS
Function can return errors from open, tcgetattr, cfsetispeed and tcsetattr.