feature:support for conneting horizon

This commit is contained in:
Livox-SDK
2019-12-19 15:25:48 +08:00
parent 83def61d80
commit da19f31bc4
1442 changed files with 52220 additions and 16430 deletions
+404 -72
View File
@@ -31,9 +31,9 @@
/** Device type. */
typedef enum {
kDeviceTypeHub = 0, /**< Livox Hub. */
kDeviceTypeLidarMid40 = 1, /**< Mid-40. */
kDeviceTypeLidarTele = 2, /**< Tele. */
kDeviceTypeHub = 0, /**< Livox Hub. */
kDeviceTypeLidarMid40 = 1, /**< Mid-40. */
kDeviceTypeLidarTele = 2, /**< Tele. */
kDeviceTypeLidarHorizon = 3 /**< Horizon. */
} DeviceType;
@@ -44,7 +44,7 @@ typedef enum {
kLidarStatePowerSaving = 2, /**< Power-saving state. */
kLidarStateStandBy = 3, /**< Standby state. */
kLidarStateError = 4, /**< Error state. */
kLidarStateUnknown = 5
kLidarStateUnknown = 5 /**< Unknown state. */
} LidarState;
/** Lidar mode. */
@@ -60,21 +60,35 @@ typedef enum {
kLidarFeatureRainFog = 1 /**< Rain and fog feature. */
} LidarFeature;
/** Lidar IP mode. */
typedef enum {
kLidarDynamicIpMode = 0, /**< Dynamic IP. */
kLidarStaticIpMode = 1 /**< Static IP. */
} LidarIpMode;
/** Function return value definition. */
typedef enum {
kStatusSuccess = 0, /**< Success. */
kStatusFailure = 1, /**< Failure. */
kStatusNotConnected = 2, /**< Requested device is not connected. */
kStatusNotSupported = 3, /**< Operation is not supported on this device. */
kStatusTimeout = 4, /**< Operation timeouts. */
kStatusNotEnoughMemory = 5 /**< No enough memory. */
} ResponseStatus;
kStatusSendFailed = -9, /**< Command send failed. */
kStatusHandlerImplNotExist = -8, /**< Handler implementation not exist. */
kStatusInvalidHandle = -7, /**< Device handle invalid. */
kStatusChannelNotExist = -6, /**< Command channel not exist. */
kStatusNotEnoughMemory = -5, /**< No enough memory. */
kStatusTimeout = -4, /**< Operation timeouts. */
kStatusNotSupported = -3, /**< Operation is not supported on this device. */
kStatusNotConnected = -2, /**< Requested device is not connected. */
kStatusFailure = -1, /**< Failure. */
kStatusSuccess = 0 /**< Success. */
} LivoxStatus;
/** Fuction return value defination, refer to \ref LivoxStatus. */
typedef int32_t livox_status;
/** Device update type, indicating the change of device connection or working state. */
typedef enum {
kEventConnect = 0, /**< Device is connected. */
kEventDisconnect = 1, /**< Device is removed. */
kEventStateChange = 2 /**< Device working state changes or an error occurs. */
kEventConnect = 0, /**< Device is connected. */
kEventDisconnect = 1, /**< Device is removed. */
kEventStateChange = 2, /**< Device working state changes or an error occurs. */
kEventHubConnectionChange = 3 /**< Hub is connected or LiDAR unit(s) is/are removed. */
} DeviceEvent;
/** Timestamp sync mode define. */
@@ -87,11 +101,36 @@ typedef enum {
kTimestampTypeUnknown = 5 /**< Unknown mode. */
} TimestampType;
/** Point data type. */
typedef enum {
kCartesian, /**< Cartesian coordinate point cloud. */
kSpherical, /**< Spherical coordinate point cloud. */
kExtendCartesian, /**< Extend cartesian coordinate point cloud. */
kExtendSpherical, /**< Extend spherical coordinate point cloud. */
kDualExtendCartesian, /**< Dual extend cartesian coordinate point cloud. */
kDualExtendSpherical, /**< Dual extend spherical coordinate point cloud. */
kImu, /**< IMU data. */
kMaxPointDataType /**< Max Point Data Type. */
} PointDataType;
/** Point cloud return mode. */
typedef enum {
kFirstReturn, /**< First single return mode . */
kStrongestReturn, /**< Strongest single return mode. */
kDualReturn /**< Dual return mode. */
} PointCloudReturnMode;
/** IMU push frequency. */
typedef enum {
kImuFreq0Hz, /**< IMU push closed. */
kImuFreq200Hz, /**< IMU push frequency 200Hz. */
} ImuFreq;
#pragma pack(1)
#define LIVOX_SDK_MAJOR_VERSION 1
#define LIVOX_SDK_MINOR_VERSION 2
#define LIVOX_SDK_PATCH_VERSION 1
#define LIVOX_SDK_MAJOR_VERSION 2
#define LIVOX_SDK_MINOR_VERSION 0
#define LIVOX_SDK_PATCH_VERSION 0
#define kBroadcastCodeSize 16
@@ -121,29 +160,131 @@ typedef struct {
/** Standard point cloud format */
typedef struct {
float x; /**< X axis, Unit:m */
float y; /**< X axis, Unit:m */
float z; /**< X axis, Unit:m */
float y; /**< Y axis, Unit:m */
float z; /**< Z axis, Unit:m */
uint8_t reflectivity; /**< Reflectivity */
} LivoxPoint;
/** Extend cartesian coordinate format. */
typedef struct {
int32_t x; /**< X axis, Unit:mm */
int32_t y; /**< Y axis, Unit:mm */
int32_t z; /**< Z axis, Unit:mm */
uint8_t reflectivity; /**< Reflectivity */
uint8_t tag; /**< Tag */
} LivoxExtendRawPoint;
/** Extend spherical coordinate format. */
typedef struct {
uint32_t depth; /**< Radial distance, Unit:mm */
uint16_t theta; /**< Polar angle, Unit:0.01rad */
uint16_t phi; /**< Azimuthal angle, Unit:0.01rad */
uint8_t reflectivity; /**< Reflectivity */
uint8_t tag; /**< Tag */
} LivoxExtendSpherPoint;
/** Dual extend cartesian coordinate format. */
typedef struct {
int32_t x1; /**< X axis, Unit:mm */
int32_t y1; /**< Y axis, Unit:mm */
int32_t z1; /**< Z axis, Unit:mm */
uint8_t reflectivity1; /**< Reflectivity */
uint8_t tag1; /**< Tag */
int32_t x2; /**< X axis, Unit:mm */
int32_t y2; /**< Y axis, Unit:mm */
int32_t z2; /**< Z axis, Unit:mm */
uint8_t reflectivity2; /**< Reflectivity */
uint8_t tag2; /**< Tag */
} LivoxDualExtendRawPoint;
/** Dual extend spherical coordinate format. */
typedef struct {
uint16_t theta; /**< Polar angle, Unit:0.01rad */
uint16_t phi; /**< Azimuthal angle, Unit:0.01rad */
uint32_t depth1; /**< Radial distance, Unit:mm */
uint8_t reflectivity1; /**< Reflectivity */
uint8_t tag1; /**< Tag */
uint32_t depth2; /**< Radial distance, Unit:mm */
uint8_t reflectivity2; /**< Reflectivity */
uint8_t tag2; /**< Tag */
} LivoxDualExtendSpherPoint;
/** IMU data format. */
typedef struct {
float gyro_x; /**< Gyroscope X axis, Unit:rad/s */
float gyro_y; /**< Gyroscope Y axis, Unit:rad/s */
float gyro_z; /**< Gyroscope Z axis, Unit:rad/s */
float acc_x; /**< Accelerometer X axis, Unit:g */
float acc_y; /**< Accelerometer Y axis, Unit:g */
float acc_z; /**< Accelerometer Z axis, Unit:g */
} LivoxImuPoint;
/** LiDAR error code. */
typedef struct {
uint32_t temp_status : 2; /**< 0: Temperature in Normal State. 1: High or Low. 2: Extremely High or Extremely Low. */
uint32_t volt_status : 2; /**< 0: Voltage in Normal State. 1: High. 2: Extremely High. */
uint32_t motor_status : 2; /**< 0: Motor in Normal State. 1: Motor in Warning State. 2:Motor in Error State, Unable to Work. */
uint32_t dirty_warn : 2; /**< 0: Not Dirty or Blocked. 1: Dirty or Blocked. */
uint32_t firmware_err : 1; /**< 0: Firmware is OK. 1: Firmware is Abnormal, Need to be Upgraded. */
uint32_t pps_status : 1; /**< 0: No PPS Signal. 1: PPS Signal is OK. */
uint32_t device_status : 1; /**< 0: Normal. 1: Warning for Approaching the End of Service Life. */
uint32_t fan_status : 1; /**< 0: Fan in Normal State. 1: Fan in Warning State. */
uint32_t self_heating : 1; /**< 0: Normal. 1: Low Temperature Self Heating On. */
uint32_t ptp_status : 1; /**< 0: No 1588 Signal. 1: 1588 Signal is OK. */
/** 0: System dose not start time synchronization.
* 1: Using PTP 1588 synchronization.
* 2: Using GPS synchronization.
* 3: Using PPS synchronization.
* 4: System time synchronization is abnormal.(The highest priority synchronization signal is abnormal)
*/
uint32_t time_sync_status : 3;
uint32_t rsvd : 13; /**< Reserved. */
uint32_t system_status : 2; /**< 0: Normal. 1: Warning. 2: Error. */
} LidarErrorCode;
/** Hub error code. */
typedef struct {
/** 0: No synchronization signal.
* 1: 1588 synchronization.
* 2: GPS synchronization.
* 3: System time synchronization is abnormal.(The highest priority synchronization signal is abnormal)
*/
uint32_t sync_status : 2;
uint32_t temp_status : 2; /**< 0: Temperature in Normal State. 1: High or Low. 2: Extremely High or Extremely Low. */
uint32_t lidar_status : 1; /**< 0: LiDAR State is Normal. 1: LiDAR State is Abnormal. */
uint32_t lidar_link_status : 1; /**< 0: LiDAR Connection is Normal. 1: LiDAR Connection is Abnormal. */
uint32_t firmware_err : 1; /**< 0: LiDAR Firmware is OK. 1: LiDAR Firmware is Abnormal, Need to be Upgraded. */
uint32_t rsvd : 23; /**< Reserved. */
uint32_t system_status : 2; /**< 0: Normal. 1: Warning. 2: Error. */
} HubErrorCode;
/**
* Device error message.
*/
typedef union {
uint32_t error_code; /**< Error code. */
LidarErrorCode lidar_error_code; /**< Lidar error code. */
HubErrorCode hub_error_code; /**< Hub error code. */
} ErrorMessage;
/** Point cloud packet. */
typedef struct {
uint8_t version; /**< Packet protocol version. */
uint8_t slot; /**< Slot number used for connecting LiDAR. */
uint8_t id; /**< LiDAR id. */
uint8_t rsvd; /**< Reserved. */
uint8_t version; /**< Packet protocol version. */
uint8_t slot; /**< Slot number used for connecting LiDAR. */
uint8_t id; /**< LiDAR id. */
uint8_t rsvd; /**< Reserved. */
uint32_t err_code; /**< Device error status indicator information. */
uint8_t timestamp_type; /**< Timestamp type. */
/** Point cloud coordinate format, 1 for spherical coordinate data, 0 for cartesian coordinate data. */
uint8_t timestamp_type; /**< Timestamp type. */
/** Point cloud coordinate format, refer to \ref PointDataType . */
uint8_t data_type;
uint8_t timestamp[8]; /**< Nanosecond or UTC format timestamp. */
uint8_t data[1]; /**< Point cloud data. */
uint8_t timestamp[8]; /**< Nanosecond or UTC format timestamp. */
uint8_t data[1]; /**< Point cloud data. */
} LivoxEthPacket;
/** Information of LiDAR work state. */
typedef union {
uint32_t status_code; /**< LiDAR work state status code. */
uint32_t progress; /**< LiDAR work state switching progress. */
uint32_t progress; /**< LiDAR work state switching progress. */
ErrorMessage status_code; /**< LiDAR work state status code. */
} StatusUnion;
/** Information of the connected LiDAR or hub. */
@@ -155,17 +296,19 @@ typedef struct {
uint8_t type; /**< Device type, refer to \ref DeviceType. */
uint16_t data_port; /**< Point cloud data UDP port. */
uint16_t cmd_port; /**< Control command UDP port. */
uint16_t sensor_port; /**< IMU data UDP port. */
char ip[16]; /**< IP address. */
LidarState state; /**< LiDAR state. */
LidarFeature feature; /**< LiDAR feature. */
StatusUnion status; /** LiDAR work state status. */
StatusUnion status; /**< LiDAR work state status. */
} DeviceInfo;
/** The information of broadcast device. */
typedef struct {
char broadcast_code[kBroadcastCodeSize]; /**< Device broadcast code, null-terminated string, 15 characters at most. */
uint8_t dev_type; /**< Device type, refer to \ref DeviceType. */
uint16_t reserved; /**< Reserved. */
uint16_t reserved; /**< Reserved. */
char ip[16]; /**< Device ip. */
} BroadcastDeviceInfo;
/** The information of LiDAR units that are connected to the Livox Hub. */
@@ -180,7 +323,7 @@ typedef struct {
/** LiDAR mode configuration information. */
typedef struct {
char broadcast_code[kBroadcastCodeSize]; /**< Device broadcast code, null-terminated string, 15 characters at most. */
uint8_t state; /**< LiDAR state. */
uint8_t state; /**< LiDAR state, refer to \ref LidarMode. */
} LidarModeRequestItem;
typedef struct {
@@ -197,6 +340,52 @@ typedef struct {
uint8_t feature; /**< Close or open the rain and fog feature. */
} RainFogSuppressRequestItem;
typedef struct {
char broadcast_code[kBroadcastCodeSize]; /**< Device broadcast code. */
uint8_t state; /**< Fan state: 1 for turn on fan, 0 for turn off fan. */
} FanControlRequestItem;
typedef struct {
char broadcast_code[kBroadcastCodeSize]; /**< Device broadcast code. */
} GetFanStateRequestItem;
typedef struct {
uint8_t ret_code; /**< Return code. */
char broadcast_code[kBroadcastCodeSize]; /**< Device broadcast code. */
uint8_t state; /**< Fan state: 1 for fan is on, 0 for fan is off. */
} GetFanStateResponseItem;
typedef struct {
char broadcast_code[kBroadcastCodeSize]; /**< Device broadcast code. */
uint8_t mode; /**< Point cloud return mode, refer to \ref PointCloudReturnMode. */
} SetPointCloudReturnModeRequestItem;
typedef struct {
char broadcast_code[kBroadcastCodeSize]; /**< Device broadcast code. */
} GetPointCloudReturnModeRequestItem;
typedef struct {
uint8_t ret_code; /**< Return code. */
char broadcast_code[kBroadcastCodeSize]; /**< Device broadcast code. */
uint8_t mode; /**< Point cloud return mode, refer to \ref PointCloudReturnMode. */
} GetPointCloudReturnModeResponseItem;
typedef struct {
char broadcast_code[kBroadcastCodeSize]; /**< Device broadcast code. */
uint8_t freq; /**< IMU push frequency, refer to \ref ImuFreq. */
} SetImuPushFrequencyRequestItem;
typedef struct {
char broadcast_code[kBroadcastCodeSize]; /**< Device broadcast code. */
} GetImuPushFrequencyRequestItem;
typedef struct {
uint8_t ret_code; /**< Return code. */
char broadcast_code[kBroadcastCodeSize]; /**< Device broadcast code. */
uint8_t freq; /**< IMU push frequency, refer to \ref ImuFreq. */
} GetImuPushFrequencyResponseItem;
/** LiDAR configuration information. */
typedef struct {
char broadcast_code[kBroadcastCodeSize]; /**< Device broadcast code. */
@@ -224,16 +413,17 @@ typedef struct {
char broadcast_code[kBroadcastCodeSize]; /**< Broadcast code. */
uint8_t state; /**< LiDAR state. */
uint8_t feature; /**< LiDAR feature. */
StatusUnion error_union; /** LiDAR work state. */
StatusUnion error_union; /**< LiDAR work state. */
} LidarStateItem;
/**
* The request body for the command of handshake.
*/
typedef struct {
uint32_t ip_addr; /**< IP address of the device. */
uint16_t data_port; /**< UDP port of the data connection. */
uint16_t cmd_port; /**< UDP port of the command connection. */
uint32_t ip_addr; /**< IP address of the device. */
uint16_t data_port; /**< UDP port of the data connection. */
uint16_t cmd_port; /**< UDP port of the command connection. */
uint16_t sensor_port; /**< UDP port of the sensor connection. */
} HandshakeRequest;
/**
@@ -244,18 +434,11 @@ typedef struct {
uint8_t firmware_version[4]; /**< Firmware version. */
} DeviceInformationResponse;
/**
* The response body of getting device error status.
*/
typedef struct {
uint32_t error_code; /**< Error code. */
} ErrorMessage;
/**
* The request body of the command for setting device's IP mode.
*/
typedef struct {
uint8_t ip_mode; /**< IP address mode: 0 for dynamic IP address, 1 for static IP address. */
uint8_t ip_mode; /**< IP address mode: 0 for dynamic IP address, 1 for static IP address. */
uint32_t ip_addr; /**< IP address. */
} SetDeviceIPModeRequest;
@@ -263,23 +446,34 @@ typedef struct {
* The response body of getting device's IP mode.
*/
typedef struct {
uint8_t ret_code; /**< Return code. */
uint8_t ip_mode; /**< IP address mode: 0 for dynamic IP address, 1 for static IP address. */
uint32_t ip_addr; /**< IP address. */
} GetDeviceIPModeResponse;
uint8_t ret_code; /**< Return code. */
uint8_t ip_mode; /**< IP address mode: 0 for dynamic IP address, 1 for static IP address. */
uint32_t ip_addr; /**< IP address. */
uint32_t net_mask; /**< Subnet mask. */
uint32_t gw_addr; /**< Gateway address. */
} GetDeviceIpModeResponse;
/**
* The request body of the command for setting static device's IP mode.
*/
typedef struct {
uint32_t ip_addr; /**< IP address. */
uint32_t net_mask; /**< Subnet mask. */
uint32_t gw_addr; /**< Gateway address. */
} SetStaticDeviceIpModeRequest;
/**
* The body of heartbeat response.
*/
typedef struct {
uint8_t ret_code; /**< Return code. */
uint8_t state; /**< Working state. */
uint8_t feature; /**< LiDAR feature. */
uint8_t ret_code; /**< Return code. */
uint8_t state; /**< Working state. */
uint8_t feature; /**< LiDAR feature. */
StatusUnion error_union; /**< LiDAR work state. */
} HeartbeatResponse;
/**
* The request body for the command of setting LiDAR's parameters.
* The request body for the command of setting Livox LiDAR's parameters.
*/
typedef struct {
float roll; /**< Roll angle, unit: degree. */
@@ -291,7 +485,7 @@ typedef struct {
} LidarSetExtrinsicParameterRequest;
/**
* The response body of getting LiDAR's parameters.
* The response body of getting Livox LiDAR's parameters.
*/
typedef struct {
uint8_t ret_code;
@@ -303,28 +497,64 @@ typedef struct {
int32_t z; /**< Z translation, unit: mm. */
} LidarGetExtrinsicParameterResponse;
/**
* The response body of getting the Livox LiDAR's fan state.
*/
typedef struct {
uint8_t ret_code; /**< Return code. */
uint8_t state; /**< Fan state: 1 for fan is on, 0 for fan is off. */
} LidarGetFanStateResponse;
/**
* The response body of getting the Livox LiDAR's point cloud return mode.
*/
typedef struct {
uint8_t ret_code; /**< Return code. */
uint8_t mode; /**< Point cloud return mode, refer to \ref PointCloudReturnMode. */
} LidarGetPointCloudReturnModeResponse;
/**
* The response body of getting the Livox LiDAR's IMU push frequency.
*/
typedef struct {
uint8_t ret_code; /**< Return code. */
uint8_t freq; /**< IMU push frequency, refer to \ref ImuFreq. */
} LidarGetImuPushFrequencyResponse;
/**
* The response body of setting the Livox LiDAR's Sync time.
*/
typedef struct {
uint8_t year;
uint8_t month;
uint8_t day;
uint8_t hour;
uint32_t mircrosecond;
} LidarSetUtcSyncTimeRequest;
/**
* The response body of querying the information of LiDAR units connected to the Livox Hub.
*/
typedef struct {
uint8_t ret_code; /**< Return code from device. */
uint8_t ret_code; /**< Return code. */
uint8_t count; /**< Count of device_info_list. */
ConnectedLidarInfo device_info_list[1]; /**< Connected lidars information. */
ConnectedLidarInfo device_info_list[1]; /**< Connected lidars information list. */
} HubQueryLidarInformationResponse;
/**
* The request body of setting LiDAR units working mode.
* The request body of setting Livox Hub's working mode.
*/
typedef struct {
uint8_t count; /**< Number of LiDAR units to set. */
uint8_t count; /**< Count of config_list. */
LidarModeRequestItem config_list[1]; /**< LiDAR mode configuration list. */
} HubSetModeRequest;
/**
* The response of setting LiDAR units working mode.
* The response of setting Livox Hub's working mode.
*/
typedef struct {
uint8_t ret_code; /**< Return code from device. */
uint8_t ret_code; /**< Return code. */
uint8_t count; /**< Count of ret_state_list. */
ReturnCode ret_state_list[1]; /**< Return status list. */
} HubSetModeResponse;
@@ -342,7 +572,7 @@ typedef struct {
*/
typedef struct {
uint8_t count; /**< Count of cfg_param_list. */
ExtrinsicParameterRequestItem parameter_list[1]; /**< Configuration parameter list. */
ExtrinsicParameterRequestItem parameter_list[1]; /**< Extrinsic parameter configuration list. */
} HubSetExtrinsicParameterRequest;
/**
@@ -351,7 +581,7 @@ typedef struct {
typedef struct {
uint8_t ret_code; /**< Return code. */
uint8_t count; /**< Count of ret_code_list. */
ReturnCode ret_code_list[1]; /**< Return code */
ReturnCode ret_code_list[1]; /**< Return code list. */
} HubSetExtrinsicParameterResponse;
/**
@@ -367,44 +597,146 @@ typedef struct {
*/
typedef struct {
uint8_t ret_code; /**< Return code. */
uint8_t count; /**< Number of LiDAR units connected to the Livox Hub. */
ExtrinsicParameterResponseItem parameter_list[1]; /**< Postion parameters of connected LiDAR unit(s). */
uint8_t count; /**< Count of code_list. */
ExtrinsicParameterResponseItem parameter_list[1]; /**< Extrinsic parameter list. */
} HubGetExtrinsicParameterResponse;
/**
* The response body of getting sub LiDAR's state.
* The response body of getting sub LiDAR's state conneted to Hub.
*/
typedef struct {
uint8_t ret_code; /**< Return code. */
uint8_t count; /**< Number of LiDAR connected to the Livox Hub. */
LidarStateItem state_list[1]; /**< Device information of connected LiDAR units. */
uint8_t count; /**< Count of state_list. */
LidarStateItem state_list[1]; /**< LiDAR units state list. */
} HubQueryLidarStatusResponse;
/**
* The request body of toggling the LiDAR units rain and fog mode.
* The request body of toggling the Livox Hub's rain and fog mode.
*/
typedef struct {
uint8_t count; /**< Number of LiDAR units connected to the Livox Hub. */
RainFogSuppressRequestItem lidar_cfg_list[1]; /**< Command data of connected LiDAR units. */
uint8_t count; /**< Count of lidar_cfg_list. */
RainFogSuppressRequestItem lidar_cfg_list[1]; /**< Rain fog suppress configuration list. */
} HubRainFogSuppressRequest;
/**
* The response body of toggling the LiDAR units rain and fog mode.
* The response body of toggling the Livox Hub's rain and fog mode.
*/
typedef struct {
uint8_t ret_code; /**< Return code. */
uint8_t count; /**< Count of ret_state_list. */
ReturnCode ret_state_list[1]; /**< Return code */
ReturnCode ret_state_list[1]; /**< Return state list */
} HubRainFogSuppressResponse;
/**
* The response body of getting hub slots' power state.
* The response body of getting Hub slots' power state.
*/
typedef struct {
uint8_t ret_code; /**< Return code. */
uint16_t slot_power_state; /**< Slot power status. */
} HubQuerySlotPowerStatusResponse;
/**
* The request body of controlling the sub LiDAR's fan state conneted to Hub.
*/
typedef struct {
uint8_t count; /**< Count of lidar_cfg_list. */
FanControlRequestItem lidar_cfg_list[1]; /**< Fan control configuration list. */
} HubFanControlRequest;
/**
* The response body of controlling the sub LiDAR's fan state conneted to Hub.
*/
typedef struct {
uint8_t ret_code; /**< Return code. */
uint8_t count; /**< Count of return_list. */
ReturnCode return_list[1]; /**< Return list */
} HubFanControlResponse;
/**
* The request body of getting the sub LiDAR's fan state conneted to Hub.
*/
typedef struct {
uint8_t count; /**< Count of lidar_cfg_list. */
GetFanStateRequestItem lidar_cfg_list[1]; /**< Get Fan state list. */
} HubGetFanStateRequest;
/**
* The response body of getting the sub LiDAR's fan state conneted to Hub.
*/
typedef struct {
uint8_t ret_code; /**< Return code. */
uint8_t count; /**< Count of return_list. */
GetFanStateResponseItem return_list[1]; /**< Fan state list. */
} HubGetFanStateResponse;
/**
* The request body of setting point cloud return mode of sub LiDAR conneted to Hub.
*/
typedef struct {
uint8_t count; /**< Count of lidar_cfg_list. */
SetPointCloudReturnModeRequestItem lidar_cfg_list[1]; /**< Point cloud return mode configuration list. */
} HubSetPointCloudReturnModeRequest;
/**
* The response body of setting point cloud return mode of sub LiDAR conneted to Hub.
*/
typedef struct {
uint8_t ret_code; /**< Return code. */
uint8_t count; /**< Count of return_list. */
ReturnCode return_list[1]; /**< Return list. */
} HubSetPointCloudReturnModeResponse;
/**
* The request body of getting sub LiDAR's point cloud return mode conneted to Hub.
*/
typedef struct {
uint8_t count; /**< Count of lidar_cfg_list. */
GetPointCloudReturnModeRequestItem lidar_cfg_list[1]; /**< Get point cloud return mode list. */
} HubGetPointCloudReturnModeRequest;
/**
* The response body of getting sub LiDAR's point cloud return mode conneted to Hub.
*/
typedef struct {
uint8_t ret_code; /**< Return code. */
uint8_t count; /**< Count of return_list. */
GetPointCloudReturnModeResponseItem return_list[1]; /**< Point cloud return mode list. */
} HubGetPointCloudReturnModeResponse;
/**
* The request body of setting IMU push frequency of sub LiDAR conneted to Hub.
*/
typedef struct {
uint8_t count; /**< Count of lidar_cfg_list. */
SetImuPushFrequencyRequestItem lidar_cfg_list[1]; /**< IMU push frequency configuration list. */
} HubSetImuPushFrequencyRequest;
/**
* The response body of setting IMU push frequency of sub LiDAR conneted to Hub.
*/
typedef struct {
uint8_t ret_code; /**< Return code. */
uint8_t count; /**< Count of return_list. */
ReturnCode return_list[1]; /**< Return list. */
} HubSetImuPushFrequencyResponse;
/**
* The request body of getting sub LiDAR's IMU push frequency conneted to Hub.
*/
typedef struct {
uint8_t count; /**< Count of lidar_cfg_list. */
GetImuPushFrequencyRequestItem lidar_cfg_list[1]; /**< Get IMU push frequency list. */
} HubGetImuPushFrequencyRequest;
/**
* The response body of getting sub LiDAR's IMU push frequency conneted to Hub.
*/
typedef struct {
uint8_t ret_code; /**< Return code. */
uint8_t count; /**< Count of return_list. */
GetImuPushFrequencyResponseItem return_list[1]; /**< IMU push frequency list. */
} HubGetImuPushFrequencyResponse;
#pragma pack()
#endif // LIVOX_DEF_H_
+438 -98
View File
@@ -101,36 +101,36 @@ void SetDeviceStateUpdateCallback(DeviceStateUpdateCallback cb);
* @param broadcast_code device's broadcast code.
* @param handle device handle. For Livox Hub, the handle is always 31; for LiDAR units connected to the Livox Hub,
* the corresponding handle is (slot-1)*3+id-1.
* @return kStatusSuccess on successful return, see \ref ResponseStatus for other error code.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
uint8_t AddHubToConnect(const char *broadcast_code, uint8_t *handle);
livox_status AddHubToConnect(const char *broadcast_code, uint8_t *handle);
/**
* Add a broadcast code to the connecting list and only devices with broadcast code in this list will be connected. The
* broadcast code is unique for every device.
* @param broadcast_code device's broadcast code.
* @param handle device handle. The handle is the same as the order calling AddLidarToConnect starting from 0.
* @return kStatusSuccess on successful return, see \ref ResponseStatus for other error code.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
uint8_t AddLidarToConnect(const char *broadcast_code, uint8_t *handle);
livox_status AddLidarToConnect(const char *broadcast_code, uint8_t *handle);
/**
* Get all connected devices' information.
* @param devices list of connected devices' information.
* @param size number of devices connected.
* @return kStatusSuccess on successful return, see \ref ResponseStatus for other error code.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
uint8_t GetConnectedDevices(DeviceInfo *devices, uint8_t *size);
livox_status GetConnectedDevices(DeviceInfo *devices, uint8_t *size);
/**
* Function type of callback that queries device's information.
* @param status kStatusSuccess on successful return, kStatusTimeout on timeout, see \ref ResponseStatus for other
* @param status kStatusSuccess on successful return, kStatusTimeout on timeout, see \ref LivoxStatus for other
* error code.
* @param handle device handle.
* @param response response from the device.
* @param client_data user data associated with the command.
*/
typedef void (*DeviceInformationCallback)(uint8_t status,
typedef void (*DeviceInformationCallback)(livox_status status,
uint8_t handle,
DeviceInformationResponse *response,
void *client_data);
@@ -140,9 +140,9 @@ typedef void (*DeviceInformationCallback)(uint8_t status,
* @param handle device handle.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref ResponseStatus for other error code.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
uint8_t QueryDeviceInformation(uint8_t handle, DeviceInformationCallback cb, void *client_data);
livox_status QueryDeviceInformation(uint8_t handle, DeviceInformationCallback cb, void *client_data);
/**
* Callback function for receiving point cloud data.
@@ -164,29 +164,29 @@ void SetDataCallback(uint8_t handle, DataCallback cb, void *client_data);
/**
* Function type of callback with 1 byte of response.
* @param status kStatusSuccess on successful return, kStatusTimeout on timeout, see \ref ResponseStatus for other
* @param status kStatusSuccess on successful return, kStatusTimeout on timeout, see \ref LivoxStatus for other
* error code.
* @param handle device handle.
* @param response response from the device.
* @param client_data user data associated with the command.
*/
typedef void (*CommonCommandCallback)(uint8_t status, uint8_t handle, uint8_t response, void *client_data);
typedef void (*CommonCommandCallback)(livox_status status, uint8_t handle, uint8_t response, void *client_data);
/**
* Start hub sampling.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref ResponseStatus for other error code.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
uint8_t HubStartSampling(CommonCommandCallback cb, void *client_data);
livox_status HubStartSampling(CommonCommandCallback cb, void *client_data);
/**
* Stop the Livox Hub's sampling.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref ResponseStatus for other error code.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
uint8_t HubStopSampling(CommonCommandCallback cb, void *client_data);
livox_status HubStopSampling(CommonCommandCallback cb, void *client_data);
/**
* Get the LiDAR unit handle used in the Livox Hub data callback function from slot and id.
@@ -194,85 +194,133 @@ uint8_t HubStopSampling(CommonCommandCallback cb, void *client_data);
* @param id Livox Hub's id.
* @return LiDAR unit handle.
*/
uint8_t HubGetLidarHandle(uint8_t slot, uint8_t id);
livox_status HubGetLidarHandle(uint8_t slot, uint8_t id);
/**
* Command to change point cloud coordinate system to cartesian coordinate.
* Disconnect divice.
* @param handle device handle.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref ResponseStatus for other error code.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
uint8_t SetCartesianCoordinate(uint8_t handle, CommonCommandCallback cb, void *client_data);
livox_status DisconnectDevice(uint8_t handle, CommonCommandCallback cb, void *client_data);
/**
* Change point cloud coordinate system to cartesian coordinate.
* @param handle device handle.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
livox_status SetCartesianCoordinate(uint8_t handle, CommonCommandCallback cb, void *client_data);
/**
* Change point cloud coordinate system to spherical coordinate.
* @param handle device handle.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref ResponseStatus for other error code.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
uint8_t SetSphericalCoordinate(uint8_t handle, CommonCommandCallback cb, void *client_data);
livox_status SetSphericalCoordinate(uint8_t handle, CommonCommandCallback cb, void *client_data);
/**
* Callback of the error status message.
* kStatusSuccess on successful return, see \ref LivoxStatus for other
* @param handle device handle.
* @param response response from the device.
*/
typedef void (*ErrorMessageCallback)(uint8_t handle, ErrorMessage *message);
typedef void (*ErrorMessageCallback)(livox_status status, uint8_t handle, ErrorMessage *message);
/**
* Add error status callback for the device.
* error code.
* @param handle device handle.
* @param cb callback for the command.
* @return kStatusSuccess on successful return, see \ref ResponseStatus for other error code.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
uint8_t SetErrorMessageCallback(uint8_t handle, ErrorMessageCallback cb);
livox_status SetErrorMessageCallback(uint8_t handle, ErrorMessageCallback cb);
/**
* Set device's IP mode.
* @note \ref SetStaticDynamicIP only supports setting Hub or Mid40/100's IP mode.
* If you want to set Horizon or Tele's IP mode, see \ref SetStaticIp and \ref SetDynamicIp.
* @param handle device handle.
* @param req request sent to device.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref ResponseStatus for other error code.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
uint8_t SetStaticDynamicIP(uint8_t handle,
SetDeviceIPModeRequest *req,
CommonCommandCallback cb,
void *client_data);
livox_status SetStaticDynamicIP(uint8_t handle,
SetDeviceIPModeRequest *req,
CommonCommandCallback cb,
void *client_data);
/**
* Set device's static IP mode.
* @note Mid40/100 is not supported to set subnet mask and gateway address.
* \ref SetStaticDeviceIpModeRequest's setting: net_mask and gw_addr will not take effect on Mid40/100.
* @param handle device handle.
* @param req request sent to device.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
livox_status SetStaticIp(uint8_t handle,
SetStaticDeviceIpModeRequest *req,
CommonCommandCallback cb,
void *client_data);
/**
* Set device's dynamic IP mode.
* @param handle device handle.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
livox_status SetDynamicIp(uint8_t handle,
CommonCommandCallback cb,
void *client_data);
/**
* Callback function that gets device's IP information.
* @param status kStatusSuccess on successful return, kStatusTimeout on timeout, see \ref ResponseStatus for other
* @param status kStatusSuccess on successful return, kStatusTimeout on timeout, see \ref LivoxStatus for other
* error code.
* @param handle device handle.
* @param response response from the device.
* @param client_data user data associated with the command.
*/
typedef void (*GetDeviceIPInformationCallback)(uint8_t status,
uint8_t handle,
GetDeviceIPModeResponse *response,
void *client_data);
typedef void (*GetDeviceIpInformationCallback)(livox_status status,
uint8_t handle,
GetDeviceIpModeResponse *response,
void *client_data);
/**
* Get device's IP mode.
* @param handle device handle.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref ResponseStatus for other error code.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
uint8_t GetDeviceIPInformation(uint8_t handle, GetDeviceIPInformationCallback cb, void *client_data);
livox_status GetDeviceIpInformation(uint8_t handle, GetDeviceIpInformationCallback cb, void *client_data);
/**
* Reboot device.
* @note \ref RebootDevice is not supported for Mid40/100
* @param handle device handle.
* @param timeout reboot device after [timeout] ms.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
livox_status RebootDevice(uint8_t handle, uint16_t timeout, CommonCommandCallback cb, void * client_data);
/**
* @c HubQueryLidarInformation response callback function.
* @param status kStatusSuccess on successful return, kStatusTimeout on timeout, see \ref ResponseStatus for other
* @param status kStatusSuccess on successful return, kStatusTimeout on timeout, see \ref LivoxStatus for other
* error code.
* @param handle device handle.
* @param response response from the device.
* @param client_data user data associated with the command.
*/
typedef void (*HubQueryLidarInformationCallback)(uint8_t status,
typedef void (*HubQueryLidarInformationCallback)(livox_status status,
uint8_t handle,
HubQueryLidarInformationResponse *response,
void *client_data);
@@ -281,19 +329,19 @@ typedef void (*HubQueryLidarInformationCallback)(uint8_t status,
* Query the information of LiDARs connected to the hub.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref ResponseStatus for other error code.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
uint8_t HubQueryLidarInformation(HubQueryLidarInformationCallback cb, void *client_data);
livox_status HubQueryLidarInformation(HubQueryLidarInformationCallback cb, void *client_data);
/**
* @c HubSetMode response callback function.
* @param status kStatusSuccess on successful return, kStatusTimeout on timeout, see \ref ResponseStatus for other
* @param status kStatusSuccess on successful return, kStatusTimeout on timeout, see \ref LivoxStatus for other
* error code.
* @param handle device handle.
* @param response response from the device.
* @param client_data user data associated with the command.
*/
typedef void (*HubSetModeCallback)(uint8_t status, uint8_t handle, HubSetModeResponse *response, void *client_data);
typedef void (*HubSetModeCallback)(livox_status status, uint8_t handle, HubSetModeResponse *response, void *client_data);
/**
* Set the mode of LiDAR unit connected to the Livox Hub.
@@ -301,47 +349,46 @@ typedef void (*HubSetModeCallback)(uint8_t status, uint8_t handle, HubSetModeRes
* @param length length of req.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref ResponseStatus for other error code.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
uint8_t HubSetMode(HubSetModeRequest *req, uint16_t length, HubSetModeCallback cb, void *client_data);
livox_status HubSetMode(HubSetModeRequest *req, uint16_t length, HubSetModeCallback cb, void *client_data);
/**
* @c HubQueryLidarStatus response callback function.
* @param status kStatusSuccess on successful return, kStatusTimeout on timeout, see \ref ResponseStatus for other
* @param status kStatusSuccess on successful return, kStatusTimeout on timeout, see \ref LivoxStatus for other
* error code.
* @param handle device handle.
* @param response response from the device.
* @param client_data user data associated with the command.
*/
typedef void (*HubQueryLidarStatusCallback)(uint8_t status, uint8_t handle, HubQueryLidarStatusResponse *response, void *client_data);
typedef void (*HubQueryLidarStatusCallback)(livox_status status, uint8_t handle, HubQueryLidarStatusResponse *response, void *client_data);
/**
* Get the state of LiDAR units connected to the Livox Hub.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref ResponseStatus for other error code.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
uint8_t HubQueryLidarStatus(HubQueryLidarStatusCallback cb, void *client_data);
livox_status HubQueryLidarStatus(HubQueryLidarStatusCallback cb, void *client_data);
/**
* Toggle the power supply of designated slots.
* @param req request whether to enable or disable the power of designated slots.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref ResponseStatus for other error code.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
uint8_t HubControlSlotPower(HubControlSlotPowerRequest *req, CommonCommandCallback cb, void *client_data);
livox_status HubControlSlotPower(HubControlSlotPowerRequest *req, CommonCommandCallback cb, void *client_data);
/**
* @c HubSetExtrinsicParameter response callback function.
* @param status kStatusSuccess on successful return, kStatusTimeout on timeout, see \ref ResponseStatus for other
* @param status kStatusSuccess on successful return, kStatusTimeout on timeout, see \ref LivoxStatus for other
* error code.
* @param handle device handle.
* @param response response from the device.
* @param client_data user data associated with the command.
*/
typedef void (*HubSetExtrinsicParameterCallback)(uint8_t status,
typedef void (*HubSetExtrinsicParameterCallback)(livox_status status,
uint8_t handle,
HubSetExtrinsicParameterResponse *response,
void *client_data);
@@ -352,22 +399,22 @@ typedef void (*HubSetExtrinsicParameterCallback)(uint8_t status,
* @param length the request's length.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref ResponseStatus for other error code.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
uint8_t HubSetExtrinsicParameter(HubSetExtrinsicParameterRequest *req,
uint16_t length,
HubSetExtrinsicParameterCallback cb,
void *client_data);
livox_status HubSetExtrinsicParameter(HubSetExtrinsicParameterRequest *req,
uint16_t length,
HubSetExtrinsicParameterCallback cb,
void *client_data);
/**
* @c HubGetExtrinsicParameter response callback function.
* @param status kStatusSuccess on successful return, kStatusTimeout on timeout, see \ref ResponseStatus for other
* @param status kStatusSuccess on successful return, kStatusTimeout on timeout, see \ref LivoxStatus for other
* error code.
* @param handle device handle.
* @param response response from the device.
* @param client_data user data associated with the command.
*/
typedef void (*HubGetExtrinsicParameterCallback)(uint8_t status,
typedef void (*HubGetExtrinsicParameterCallback)(livox_status status,
uint8_t handle,
HubGetExtrinsicParameterResponse *response,
void *client_data);
@@ -376,29 +423,28 @@ typedef void (*HubGetExtrinsicParameterCallback)(uint8_t status,
* Get extrinsic parameters of LiDAR units connected to the Livox Hub.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref ResponseStatus for other error code.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
uint8_t HubGetExtrinsicParameter(HubGetExtrinsicParameterCallback cb, void *client_data);
livox_status HubGetExtrinsicParameter(HubGetExtrinsicParameterCallback cb, void *client_data);
/**
* Turn on or off the calculation of extrinsic parameters.
* @param enable the request whether enable or disable calculating the extrinsic parameters.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref ResponseStatus for other error code.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
uint8_t HubExtrinsicParameterCalculation(bool enable, CommonCommandCallback cb, void *client_data);
livox_status HubExtrinsicParameterCalculation(bool enable, CommonCommandCallback cb, void *client_data);
/**
* @c HubRainFogSuppress response callback function.
* @param status kStatusSuccess on successful return, kStatusTimeout on timeout, see \ref ResponseStatus for other
* @param status kStatusSuccess on successful return, kStatusTimeout on timeout, see \ref LivoxStatus for other
* error code.
* @param handle device handle.
* @param response response from the device.
* @param client_data user data associated with the command.
*/
typedef void (*HubRainFogSuppressCallback)(uint8_t status,
typedef void (*HubRainFogSuppressCallback)(livox_status status,
uint8_t handle,
HubRainFogSuppressResponse *response,
void *client_data);
@@ -409,48 +455,201 @@ typedef void (*HubRainFogSuppressCallback)(uint8_t status,
* @param length the request's length.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref ResponseStatus for other error code.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
uint8_t HubRainFogSuppress(HubRainFogSuppressRequest *req,
uint16_t length,
HubRainFogSuppressCallback cb,
void *client_data);
livox_status HubRainFogSuppress(HubRainFogSuppressRequest *req,
uint16_t length,
HubRainFogSuppressCallback cb,
void *client_data);
/**
* @c HubQuerySlotPowerStatus response callback function.
* @param status kStatusSuccess on successful return, kStatusTimeout on timeout, see \ref ResponseStatus for other
* @param status kStatusSuccess on successful return, kStatusTimeout on timeout, see \ref LivoxStatus for other
* error code.
* @param handle device handle.
* @param response response from the device.
* @param client_data user data associated with the command.
*/
typedef void(*HubQuerySlotPowerStatusCallback)(uint8_t status, uint8_t handle, HubQuerySlotPowerStatusResponse *response, void *client_data);
typedef void(*HubQuerySlotPowerStatusCallback)(livox_status status, uint8_t handle, HubQuerySlotPowerStatusResponse *response, void *client_data);
/**
* Get the power supply state of each hub slot.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref ResponseStatus for other error code.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
uint8_t HubQuerySlotPowerStatus(HubQuerySlotPowerStatusCallback cb, void *client_data);
livox_status HubQuerySlotPowerStatus(HubQuerySlotPowerStatusCallback cb, void *client_data);
/**
* @c HubFanControl response callback function.
* @param status kStatusSuccess on successful return, kStatusTimeout on timeout, see \ref LivoxStatus for other
* error code.
* @param handle device handle.
* @param response response from the device.
* @param client_data user data associated with the command.
*/
typedef void (*HubFanControlCallback)(livox_status status,
uint8_t handle,
HubFanControlResponse *response,
void *client_data);
/**
* Turn on or off the fan of LiDAR unit connected to the Livox Hub.
* @param req Fan control of LiDAR units.
* @param length length of req.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
livox_status HubFanControl(HubFanControlRequest *req, uint16_t length, HubFanControlCallback cb, void *client_data);
/**
* @c HubGetFanControl response callback function.
* @param status kStatusSuccess on successful return, kStatusTimeout on timeout, see \ref LivoxStatus for other
* error code.
* @param handle device handle.
* @param response response from the device.
* @param client_data user data associated with the command.
*/
typedef void (*HubGetFanStateCallback)(livox_status status,
uint8_t handle,
HubGetFanStateResponse *response,
void *client_data);
/**
* Get fan state of LiDAR unit connected to the Livox Hub.
* @param req Get fan state of LiDAR units.
* @param length length of req.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
livox_status HubGetFanState(HubGetFanStateRequest *req,
uint16_t length,
HubGetFanStateCallback cb,
void *client_data);
/**
* @c HubSetPointCloudReturnMode response callback function.
* @param status kStatusSuccess on successful return, kStatusTimeout on timeout, see \ref LivoxStatus for other
* error code.
* @param handle device handle.
* @param response response from the device.
* @param client_data user data associated with the command.
*/
typedef void (*HubSetPointCloudReturnModeCallback)(livox_status status,
uint8_t handle,
HubSetPointCloudReturnModeResponse *response,
void *client_data);
/**
* Set point cloud return mode of LiDAR units connected to the Livox Hub.
* @param req set point cloud return mode of LiDAR units.
* @param length the request's length.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
livox_status HubSetPointCloudReturnMode(HubSetPointCloudReturnModeRequest *req,
uint16_t length,
HubSetPointCloudReturnModeCallback cb,
void *client_data);
/**
* @c HubGetPointCloudReturnMode response callback function.
* @param status kStatusSuccess on successful return, kStatusTimeout on timeout, see \ref LivoxStatus for other
* error code.
* @param handle device handle.
* @param response response from the device.
* @param client_data user data associated with the command.
*/
typedef void (*HubGetPointCloudReturnModeCallback)(livox_status status,
uint8_t handle,
HubGetPointCloudReturnModeResponse *response,
void *client_data);
/**
* Get point cloud return mode of LiDAR unit connected to the Livox Hub.
* @param req Get point cloud return mode of LiDAR units.
* @param length length of req.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
livox_status HubGetPointCloudReturnMode(HubGetPointCloudReturnModeRequest *req,
uint16_t length,
HubGetPointCloudReturnModeCallback cb,
void *client_data);
/**
* @c HubSetImuPushFrequency response callback function.
* @param status kStatusSuccess on successful return, kStatusTimeout on timeout, see \ref LivoxStatus for other
* error code.
* @param handle device handle.
* @param response response from the device.
* @param client_data user data associated with the command.
*/
typedef void (*HubSetImuPushFrequencyCallback)(livox_status status,
uint8_t handle,
HubSetImuPushFrequencyResponse *response,
void *client_data);
/**
* Set IMU push frequency of LiDAR units connected to the Livox Hub.
* @param req set IMU push frequency of LiDAR units.
* @param length the request's length.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
livox_status HubSetImuPushFrequency(HubSetImuPushFrequencyRequest *req,
uint16_t length,
HubSetImuPushFrequencyCallback cb,
void *client_data);
/**
* @c HubGetImuPushFrequency response callback function.
* @param status kStatusSuccess on successful return, kStatusTimeout on timeout, see \ref LivoxStatus for other
* error code.
* @param handle device handle.
* @param response response from the device.
* @param client_data user data associated with the command.
*/
typedef void (*HubGetImuPushFrequencyCallback)(livox_status status,
uint8_t handle,
HubGetImuPushFrequencyResponse *response,
void *client_data);
/**
* Get IMU push frequency of LiDAR units connected to the Livox Hub.
* @param req get IMU push frequency of LiDAR units.
* @param length the request's length.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
livox_status HubGetImuPushFrequency(HubGetImuPushFrequencyRequest *req,
uint16_t length,
HubGetImuPushFrequencyCallback cb,
void *client_data);
/**
* Start LiDAR sampling.
* @param handle device handle.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref ResponseStatus for other error code.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
uint8_t LidarStartSampling(uint8_t handle, CommonCommandCallback cb, void *client_data);
livox_status LidarStartSampling(uint8_t handle, CommonCommandCallback cb, void *client_data);
/**
* Stop LiDAR sampling.
* @param handle device handle.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref ResponseStatus for other error code.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
uint8_t LidarStopSampling(uint8_t handle, CommonCommandCallback cb, void *client_data);
livox_status LidarStopSampling(uint8_t handle, CommonCommandCallback cb, void *client_data);
/**
* Set LiDAR mode.
@@ -460,53 +659,194 @@ uint8_t LidarStopSampling(uint8_t handle, CommonCommandCallback cb, void *client
* @param mode the mode to change.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref ResponseStatus for other error code.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
uint8_t LidarSetMode(uint8_t handle, LidarMode mode, CommonCommandCallback cb, void *client_data);
livox_status LidarSetMode(uint8_t handle, LidarMode mode, CommonCommandCallback cb, void *client_data);
/**
* Set LiDAR extrinsic parameters.
* @param handle device handle.
* @param param the parameters to write.
* @param req the parameters to write.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref ResponseStatus for other error code.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
uint8_t LidarSetExtrinsicParameter(uint8_t handle,
LidarSetExtrinsicParameterRequest *req,
CommonCommandCallback cb,
void *client_data);
livox_status LidarSetExtrinsicParameter(uint8_t handle,
LidarSetExtrinsicParameterRequest *req,
CommonCommandCallback cb,
void *client_data);
/**
* @c LidarGetExtrinsicParameter response callback function.
* @param status kStatusSuccess on successful return, kStatusTimeout on timeout, see \ref ResponseStatus for other
* @param status kStatusSuccess on successful return, kStatusTimeout on timeout, see \ref LivoxStatus for other
* error code.
* @param handle device handle.
* @param response response from the device.
* @param client_data user data associated with the command.
*/
typedef void (*LidarGetExtrinsicParameterCallback)(uint8_t status,
uint8_t handle,
LidarGetExtrinsicParameterResponse *response,
void *client_data);
typedef void (*LidarGetExtrinsicParameterCallback)(livox_status status,
uint8_t handle,
LidarGetExtrinsicParameterResponse *response,
void *client_data);
/**
* Get LiDAR extrinsic parameters.
* @param handle device handle.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref ResponseStatus for other error code.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
uint8_t LidarGetExtrinsicParameter(uint8_t handle, LidarGetExtrinsicParameterCallback cb, void *client_data);
livox_status LidarGetExtrinsicParameter(uint8_t handle, LidarGetExtrinsicParameterCallback cb, void *client_data);
/**
* Enable and disable the rain/fog suppression.
* @note \ref LidarRainFogSuppress only support for Mid40/100.
* @param handle device handle.
* @param enable enable and disable the rain/fog suppression.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
livox_status LidarRainFogSuppress(uint8_t handle, bool enable, CommonCommandCallback cb, void *client_data);
/**
* Turn off the fan.
* @note \ref LidarTurnOffFan is not supported for Mid40/100.
* @param handle device handle.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref ResponseStatus for other error code.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
uint8_t LidarRainFogSuppress(uint8_t handle, bool enable, CommonCommandCallback cb, void *client_data);
livox_status LidarTurnOffFan(uint8_t handle, CommonCommandCallback cb, void *client_data);
/**
* Turn on the fan.
* @note \ref LidarTurnOnFan is not supported for Mid40/100.
* @param handle device handle.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
livox_status LidarTurnOnFan(uint8_t handle, CommonCommandCallback cb, void *client_data);
/**
* @c LidarGetFanState response callback function.
* @param status kStatusSuccess on successful return, kStatusTimeout on timeout, see \ref LivoxStatus for other
* error code.
* @param handle device handle.
* @param response response from the device.
* @param client_data user data associated with the command.
*/
typedef void (*LidarGetFanStateCallback)(livox_status status,
uint8_t handle,
LidarGetFanStateResponse *response,
void *client_data);
/**
* Get state of the fan.
* @note \ref LidarGetFanState is not supported for Mid40/100.
* @param handle device handle.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
livox_status LidarGetFanState(uint8_t handle, LidarGetFanStateCallback cb, void * client_data) ;
/**
* Set point cloud return mode.
* @note \ref LidarSetPointCloudReturnMode is not supported for Mid40/100.
* @param handle device handle.
* @param mode point cloud return mode.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
livox_status LidarSetPointCloudReturnMode(uint8_t handle, PointCloudReturnMode mode, CommonCommandCallback cb, void * client_data);
/**
* @c LidaGetPointCloudReturnMode response callback function.
* @param status kStatusSuccess on successful return, kStatusTimeout on timeout, see \ref LivoxStatus for other
* error code.
* @param handle device handle.
* @param response response from the device.
* @param client_data user data associated with the command.
*/
typedef void (*LidarGetPointCloudReturnModeCallback)(livox_status status,
uint8_t handle,
LidarGetPointCloudReturnModeResponse *response,
void *client_data);
/**
* Get point cloud return mode.
* @note \ref LidarGetPointCloudReturnMode is not supported for Mid40/100.
* @param handle device handle.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
livox_status LidarGetPointCloudReturnMode(uint8_t handle, LidarGetPointCloudReturnModeCallback cb, void * client_data);
/**
* Set IMU push frequency.
* @note \ref LidarSetImuPushFrequency is not supported for Mid40/100.
* @param handle device handle.
* @param freq IMU push frequency.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
livox_status LidarSetImuPushFrequency(uint8_t handle, ImuFreq freq, CommonCommandCallback cb, void * client_data);
/**
* @c LidaGetImuPushFrequency response callback function.
* @param status kStatusSuccess on successful return, kStatusTimeout on timeout, see \ref LivoxStatus for other
* error code.
* @param handle device handle.
* @param response response from the device.
* @param client_data user data associated with the command.
*/
typedef void (*LidarGetImuPushFrequencyCallback)(livox_status status,
uint8_t handle,
LidarGetImuPushFrequencyResponse *response,
void *client_data);
/**
* Get IMU push frequency.
* @note \ref LidarGetImuPushFrequency is not supported for Mid40/100.
* @param handle device handle.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
livox_status LidarGetImuPushFrequency(uint8_t handle, LidarGetImuPushFrequencyCallback cb, void * client_data);
/**
* Set GPRMC formate synchronization time.
* @param handle device handle.
* @param rmc GPRMC\GNRMC format data.
* @param rmc_length lenth of gprmc.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
livox_status LidarSetRmcSyncTime(uint8_t handle,
const char* rmc,
uint16_t rmc_length,
CommonCommandCallback cb,
void *client_data);
/**
* Set UTC formate synchronization time.
* @param handle device handle.
* @param req UTC format data.
* @param cb callback for the command.
* @param client_data user data associated with the command.
* @return kStatusSuccess on successful return, see \ref LivoxStatus for other error code.
*/
livox_status LidarSetUtcSyncTime(uint8_t handle,
LidarSetUtcSyncTimeRequest* req,
CommonCommandCallback cb,
void *client_data);
#ifdef __cplusplus
}