#include <user_uart.h>
Public Member Functions | |
int | Close () |
bool | IsOpen () |
int | Open (const char *filename) |
ssize_t | Read (char *buffer, size_t size) |
int | Setup (uint8_t baudrate_index, uint8_t parity) |
UserUart (uint8_t baudrate_index, uint8_t parity) | |
ssize_t | Write (const char *buffer, size_t size) |
~UserUart () | |
Private Attributes | |
uint8_t | baudrate_ |
int | fd_ |
volatile bool | is_open_ |
uint8_t | parity_ |
Definition at line 68 of file user_uart.h.
Definition at line 36 of file user_uart.cpp.
livox_ros::UserUart::~UserUart | ( | ) |
first we flush the port
Definition at line 42 of file user_uart.cpp.
int livox_ros::UserUart::Close | ( | ) |
first we flush the port
Definition at line 74 of file user_uart.cpp.
|
inline |
Definition at line 78 of file user_uart.h.
int livox_ros::UserUart::Open | ( | const char * | filename | ) |
set baudrate and parity,etc.
Definition at line 53 of file user_uart.cpp.
ssize_t livox_ros::UserUart::Read | ( | char * | buffer, |
size_t | size | ||
) |
Definition at line 186 of file user_uart.cpp.
sets up the port parameters
clear old setting completely,must add here for CDC serial
Enable the receiver and set local mode...
Disable hardware flow
Disable software flow
set boadrate
No parity (8N1)
Even parity (7E1)
Odd parity (7O1)
Space parity is setup the same as no parity (7S1)
now we setup the values in port's termios
Enable non-canonical
Time to wait for data
Minimum number of characters to read
flush the port
send new config to the port
Definition at line 87 of file user_uart.cpp.
ssize_t livox_ros::UserUart::Write | ( | const char * | buffer, |
size_t | size | ||
) |
Definition at line 178 of file user_uart.cpp.
|
private |
Definition at line 84 of file user_uart.h.
|
private |
Definition at line 78 of file user_uart.h.
|
private |
Definition at line 82 of file user_uart.h.
|
private |
Definition at line 85 of file user_uart.h.