38 : exit_poll_state_(false),
39 start_poll_state_(false),
40 exit_poll_data_(false),
41 start_poll_data_(false) {
62 printf(
"Uart parameter error, please check the configuration file!\n");
66 printf(
"Device type not supported, now only uart is supported!\n");
121 std::this_thread::sleep_for(std::chrono::milliseconds(50));
136 read_data_size =
uart_->
Read((
char *)cache_buf, get_buf_size);
137 if (read_data_size) {
141 memset(&packet, 0,
sizeof(packet));
150 std::this_thread::sleep_for(std::chrono::milliseconds(50));
173 chrono::steady_clock::time_point t = chrono::steady_clock::now();
174 chrono::milliseconds time_gap =
177 if (time_gap.count() > 3000) {
184 static chrono::steady_clock::time_point t1 = chrono::steady_clock::now();
186 chrono::steady_clock::time_point t2 = chrono::steady_clock::now();
187 chrono::milliseconds time_gap =
188 chrono::duration_cast<chrono::milliseconds>(t2 - t1);
190 if (time_gap.count() > 2000) {
194 printf(
"Uart is disconnected, close it\n");
int32_t InitTimeSync(const TimeSyncConfig &config)
void FsmTransferState(uint8_t new_state)
volatile bool exit_poll_data_
union livox_ros::CommDevConfig::@0 config
std::shared_ptr< std::thread > t_poll_state_
volatile uint8_t fsm_state_
std::chrono::steady_clock::time_point transfer_time_
ProtocolConfig protocol_config
int Open(const char *filename)
uint8_t * FetchCacheFreeSpace(uint32_t *o_len)
volatile uint32_t rx_bytes_
std::shared_ptr< std::thread > t_poll_data_
volatile bool start_poll_state_
ssize_t Read(char *buffer, size_t size)
int32_t UpdateCacheWrIdx(uint32_t used_size)
volatile bool exit_poll_state_
char name[kDevNameLengthMax]
int32_t ParseCommStream(CommPacket *o_pack)
volatile bool start_poll_data_
FnReceiveSyncTimeCb fn_cb_