merge from master #143

Merged
Livox-SDK merged 5 commits from master into cancle_heartbeat_timeout 2021-09-06 04:56:29 +02:00
5 changed files with 32 additions and 19 deletions
+1 -1
View File
@@ -233,5 +233,5 @@ Here is the example:
# 5 Support
You can get support from Livox with the following methods:
* Send email to dev@livoxtech.com with a clear description of your problem and your setup
* Send email to cs@livoxtech.com with a clear description of your problem and your setup
* Github Issues
+1 -1
View File
@@ -234,5 +234,5 @@ char broadcast_code_list[kMaxLidarCount][kBroadcastCodeSize] = {
# 5 支持
你可以通过以下方式获取 Livox 的技术支持 :
* 发送邮件到 dev@livoxtech.com 描述清楚问题和使用场景
* 发送邮件到 cs@livoxtech.com 描述清楚问题和使用场景
* Github Issues
+1 -1
View File
@@ -643,7 +643,7 @@ typedef struct {
uint8_t month;
uint8_t day;
uint8_t hour;
uint32_t mircrosecond;
uint32_t microsecond;
} LidarSetUtcSyncTimeRequest;
/**
+28 -15
View File
@@ -67,30 +67,43 @@ bool WakeUpPipe::PipeDestroy() {
}
bool WakeUpPipe::PipeCreate() {
bool status = false;
//in filedes[0]
//out filedes[1]
int filedes[2];
int filedes[2]= {};
if (pipe(filedes) == -1) {
return false;
}
do {
int flags = 0;
if ((flags = fcntl(filedes[0], F_GETFD)) == -1) {
break;
}
int flags = 0;
if ((flags = fcntl(filedes[0], F_GETFL|O_NONBLOCK)) == -1) {
return false;
}
flags |= FD_CLOEXEC;
if (fcntl(filedes[0], F_SETFD, flags) == -1) {
break;
}
flags |= FD_CLOEXEC;
if (fcntl(filedes[0], F_SETFL, flags) == -1) {
return false;
}
flags = 0;
if ((flags = fcntl(filedes[1], F_GETFD)) == -1) {
break;
}
flags = 0;
if ((flags = fcntl(filedes[1], F_GETFD)) == -1) {
return false;
}
flags |= FD_CLOEXEC;
if (fcntl(filedes[1], F_SETFD, flags) == -1) {
break;
}
status = true;
} while(0);
flags |= FD_CLOEXEC;
if (fcntl(filedes[1], F_SETFD, flags) == -1) {
if (!status) {
if (filedes[0] > 0) {
close(filedes[0]);
}
if (filedes[1] > 0) {
close(filedes[1]);
}
return false;
}
pipe_out_ = filedes[0];
@@ -209,7 +209,7 @@ bool ParseRmcTime(const char* rmc, uint16_t rmc_len, LidarSetUtcSyncTimeRequest*
}
utc_time_req->hour = hour;
utc_time_req->mircrosecond = (minute * 60 * 1000 + second * 1000) * 1000;
utc_time_req->microsecond = (minute * 60 * 1000 + second * 1000) * 1000;
return true;
}