Public Member Functions | Private Attributes | List of all members
livox_ros::UserUart Class Reference

#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_
 

Detailed Description

Definition at line 68 of file user_uart.h.

Constructor & Destructor Documentation

livox_ros::UserUart::UserUart ( uint8_t  baudrate_index,
uint8_t  parity 
)

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.

Member Function Documentation

int livox_ros::UserUart::Close ( )

first we flush the port

Definition at line 74 of file user_uart.cpp.

bool livox_ros::UserUart::IsOpen ( )
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.

int livox_ros::UserUart::Setup ( uint8_t  baudrate_index,
uint8_t  parity 
)

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.

Member Data Documentation

uint8_t livox_ros::UserUart::baudrate_
private

Definition at line 84 of file user_uart.h.

int livox_ros::UserUart::fd_
private

Definition at line 78 of file user_uart.h.

volatile bool livox_ros::UserUart::is_open_
private

Definition at line 82 of file user_uart.h.

uint8_t livox_ros::UserUart::parity_
private

Definition at line 85 of file user_uart.h.


The documentation for this class was generated from the following files:


livox_ros_driver
Author(s): Livox Dev Team
autogenerated on Mon Mar 15 2021 02:40:46