libosmocore 1.11.0.26-c59d.202505072026
Osmocom core library
|
Osmocom serial port helpers. More...
Files | |
file | serial.h |
Osmocom serial port helpers. | |
file | serial.c |
Utility functions to deal with serial ports. | |
Macros | |
#define | dbg_perror(x) do { } while (0) |
Functions | |
int | osmo_serial_init (const char *dev, speed_t baudrate) |
Open serial device and does base init. | |
int | osmo_serial_set_baudrate (int fd, speed_t baudrate) |
Change current baudrate. | |
int | osmo_serial_set_custom_baudrate (int fd, int baudrate) |
Change current baudrate to a custom one using OS specific method. | |
int | osmo_serial_clear_custom_baudrate (int fd) |
Clear any custom baudrate. | |
int | osmo_serial_speed_t (unsigned int baudrate, speed_t *speed) |
Convert unsigned integer value to speed_t. | |
static int | _osmo_serial_set_baudrate (int fd, speed_t baudrate) |
Osmocom serial port helpers.
References dbg_perror, and subsys.
Referenced by osmo_serial_set_baudrate(), and osmo_serial_set_custom_baudrate().
Clear any custom baudrate.
[in] | fd | File descriptor of the open device |
This function might not work on all OS or with all type of serial adapters
References dbg_perror, and subsys.
Referenced by osmo_serial_set_baudrate().
Open serial device and does base init.
[in] | dev | Path to the device node to open |
[in] | baudrate | Baudrate constant (speed_t: B9600, B...) |
References dbg_perror, flags, and subsys.
Change current baudrate.
[in] | fd | File descriptor of the open device |
[in] | baudrate | Baudrate constant (speed_t: B9600, B...) |
References _osmo_serial_set_baudrate(), osmo_serial_clear_custom_baudrate(), and subsys.
Change current baudrate to a custom one using OS specific method.
[in] | fd | File descriptor of the open device |
[in] | baudrate | Baudrate as integer |
This function might not work on all OS or with all type of serial adapters
References _osmo_serial_set_baudrate(), dbg_perror, and subsys.
Convert unsigned integer value to speed_t.
[in] | baudrate | integer value containing the desired standard baudrate |
[out] | speed | the standrd baudrate requested in speed_t format |
References subsys.