Livox SDK API  V2.2.0
livox_sdk.h File Reference
#include <stdbool.h>
#include <stdint.h>
#include "livox_def.h"

Go to the source code of this file.

Typedefs

typedef void(* DeviceBroadcastCallback) (const BroadcastDeviceInfo *info)
 
typedef void(* DeviceStateUpdateCallback) (const DeviceInfo *device, DeviceEvent type)
 
typedef void(* DeviceInformationCallback) (livox_status status, uint8_t handle, DeviceInformationResponse *response, void *client_data)
 
typedef void(* DataCallback) (uint8_t handle, LivoxEthPacket *data, uint32_t data_num, void *client_data)
 
typedef void(* CommonCommandCallback) (livox_status status, uint8_t handle, uint8_t response, void *client_data)
 
typedef void(* ErrorMessageCallback) (livox_status status, uint8_t handle, ErrorMessage *message)
 
typedef void(* GetDeviceIpInformationCallback) (livox_status status, uint8_t handle, GetDeviceIpModeResponse *response, void *client_data)
 
typedef void(* SetDeviceParametersCallback) (livox_status status, uint8_t handle, DeviceParameterResponse *response, void *client_data)
 
typedef void(* GetDeviceParametersCallback) (livox_status status, uint8_t handle, GetDeviceParameterResponse *response, void *client_data)
 
typedef void(* DeviceResetParametersCallback) (livox_status status, uint8_t handle, DeviceParameterResponse *response, void *client_data)
 
typedef void(* HubQueryLidarInformationCallback) (livox_status status, uint8_t handle, HubQueryLidarInformationResponse *response, void *client_data)
 
typedef void(* HubSetModeCallback) (livox_status status, uint8_t handle, HubSetModeResponse *response, void *client_data)
 
typedef void(* HubQueryLidarStatusCallback) (livox_status status, uint8_t handle, HubQueryLidarStatusResponse *response, void *client_data)
 
typedef void(* HubSetExtrinsicParameterCallback) (livox_status status, uint8_t handle, HubSetExtrinsicParameterResponse *response, void *client_data)
 
typedef void(* HubGetExtrinsicParameterCallback) (livox_status status, uint8_t handle, HubGetExtrinsicParameterResponse *response, void *client_data)
 
typedef void(* HubRainFogSuppressCallback) (livox_status status, uint8_t handle, HubRainFogSuppressResponse *response, void *client_data)
 
typedef void(* HubQuerySlotPowerStatusCallback) (livox_status status, uint8_t handle, HubQuerySlotPowerStatusResponse *response, void *client_data)
 
typedef void(* HubFanControlCallback) (livox_status status, uint8_t handle, HubFanControlResponse *response, void *client_data)
 
typedef void(* HubGetFanStateCallback) (livox_status status, uint8_t handle, HubGetFanStateResponse *response, void *client_data)
 
typedef void(* HubSetPointCloudReturnModeCallback) (livox_status status, uint8_t handle, HubSetPointCloudReturnModeResponse *response, void *client_data)
 
typedef void(* HubGetPointCloudReturnModeCallback) (livox_status status, uint8_t handle, HubGetPointCloudReturnModeResponse *response, void *client_data)
 
typedef void(* HubSetImuPushFrequencyCallback) (livox_status status, uint8_t handle, HubSetImuPushFrequencyResponse *response, void *client_data)
 
typedef void(* HubGetImuPushFrequencyCallback) (livox_status status, uint8_t handle, HubGetImuPushFrequencyResponse *response, void *client_data)
 
typedef void(* LidarGetExtrinsicParameterCallback) (livox_status status, uint8_t handle, LidarGetExtrinsicParameterResponse *response, void *client_data)
 
typedef void(* LidarGetFanStateCallback) (livox_status status, uint8_t handle, LidarGetFanStateResponse *response, void *client_data)
 
typedef void(* LidarGetPointCloudReturnModeCallback) (livox_status status, uint8_t handle, LidarGetPointCloudReturnModeResponse *response, void *client_data)
 
typedef void(* LidarGetImuPushFrequencyCallback) (livox_status status, uint8_t handle, LidarGetImuPushFrequencyResponse *response, void *client_data)
 

Functions

void GetLivoxSdkVersion (LivoxSdkVersion *version)
 
void DisableConsoleLogger ()
 
bool Init ()
 
bool Start ()
 
void Uninit ()
 
void SaveLoggerFile ()
 
void SetBroadcastCallback (DeviceBroadcastCallback cb)
 
void SetDeviceStateUpdateCallback (DeviceStateUpdateCallback cb)
 Add a callback for device connection or working state changing event. More...
 
livox_status AddHubToConnect (const char *broadcast_code, uint8_t *handle)
 
livox_status AddLidarToConnect (const char *broadcast_code, uint8_t *handle)
 
livox_status GetConnectedDevices (DeviceInfo *devices, uint8_t *size)
 
livox_status QueryDeviceInformation (uint8_t handle, DeviceInformationCallback cb, void *client_data)
 
void SetDataCallback (uint8_t handle, DataCallback cb, void *client_data)
 
livox_status HubStartSampling (CommonCommandCallback cb, void *client_data)
 
livox_status HubStopSampling (CommonCommandCallback cb, void *client_data)
 
livox_status HubGetLidarHandle (uint8_t slot, uint8_t id)
 
livox_status DisconnectDevice (uint8_t handle, CommonCommandCallback cb, void *client_data)
 
livox_status SetCartesianCoordinate (uint8_t handle, CommonCommandCallback cb, void *client_data)
 
livox_status SetSphericalCoordinate (uint8_t handle, CommonCommandCallback cb, void *client_data)
 
livox_status SetErrorMessageCallback (uint8_t handle, ErrorMessageCallback cb)
 
livox_status SetStaticDynamicIP (uint8_t handle, SetDeviceIPModeRequest *req, CommonCommandCallback cb, void *client_data)
 
livox_status SetStaticIp (uint8_t handle, SetStaticDeviceIpModeRequest *req, CommonCommandCallback cb, void *client_data)
 
livox_status SetDynamicIp (uint8_t handle, CommonCommandCallback cb, void *client_data)
 
livox_status GetDeviceIpInformation (uint8_t handle, GetDeviceIpInformationCallback cb, void *client_data)
 
livox_status RebootDevice (uint8_t handle, uint16_t timeout, CommonCommandCallback cb, void *client_data)
 
livox_status LidarEnableHighSensitivity (uint8_t handle, SetDeviceParametersCallback cb, void *client_data)
 
livox_status LidarDisableHighSensitivity (uint8_t handle, SetDeviceParametersCallback cb, void *client_data)
 
livox_status LidarGetHighSensitivityState (uint8_t handle, GetDeviceParametersCallback cb, void *client_data)
 
livox_status LidarSetScanPattern (uint8_t handle, LidarScanPattern pattern, SetDeviceParametersCallback cb, void *client_data)
 
livox_status LidarGetScanPattern (uint8_t handle, GetDeviceParametersCallback cb, void *client_data)
 
livox_status LidarSetSlotNum (uint8_t handle, uint8_t slot, SetDeviceParametersCallback cb, void *client_data)
 
livox_status LidarGetSlotNum (uint8_t handle, GetDeviceParametersCallback cb, void *client_data)
 
livox_status DeviceResetAllParameters (uint8_t handle, DeviceResetParametersCallback cb, void *client_data)
 
livox_status DeviceResetParameters (uint8_t handle, DeviceParamKeyName *keys, uint8_t num, DeviceResetParametersCallback cb, void *client_data)
 
livox_status HubQueryLidarInformation (HubQueryLidarInformationCallback cb, void *client_data)
 
livox_status HubSetMode (HubSetModeRequest *req, uint16_t length, HubSetModeCallback cb, void *client_data)
 
livox_status HubQueryLidarStatus (HubQueryLidarStatusCallback cb, void *client_data)
 
livox_status HubControlSlotPower (HubControlSlotPowerRequest *req, CommonCommandCallback cb, void *client_data)
 
livox_status HubSetExtrinsicParameter (HubSetExtrinsicParameterRequest *req, uint16_t length, HubSetExtrinsicParameterCallback cb, void *client_data)
 
livox_status HubGetExtrinsicParameter (HubGetExtrinsicParameterCallback cb, void *client_data)
 
livox_status HubExtrinsicParameterCalculation (bool enable, CommonCommandCallback cb, void *client_data)
 
livox_status HubRainFogSuppress (HubRainFogSuppressRequest *req, uint16_t length, HubRainFogSuppressCallback cb, void *client_data)
 
livox_status HubQuerySlotPowerStatus (HubQuerySlotPowerStatusCallback cb, void *client_data)
 
livox_status HubFanControl (HubFanControlRequest *req, uint16_t length, HubFanControlCallback cb, void *client_data)
 
livox_status HubGetFanState (HubGetFanStateRequest *req, uint16_t length, HubGetFanStateCallback cb, void *client_data)
 
livox_status HubSetPointCloudReturnMode (HubSetPointCloudReturnModeRequest *req, uint16_t length, HubSetPointCloudReturnModeCallback cb, void *client_data)
 
livox_status HubGetPointCloudReturnMode (HubGetPointCloudReturnModeRequest *req, uint16_t length, HubGetPointCloudReturnModeCallback cb, void *client_data)
 
livox_status HubSetImuPushFrequency (HubSetImuPushFrequencyRequest *req, uint16_t length, HubSetImuPushFrequencyCallback cb, void *client_data)
 
livox_status HubGetImuPushFrequency (HubGetImuPushFrequencyRequest *req, uint16_t length, HubGetImuPushFrequencyCallback cb, void *client_data)
 
livox_status LidarStartSampling (uint8_t handle, CommonCommandCallback cb, void *client_data)
 
livox_status LidarStopSampling (uint8_t handle, CommonCommandCallback cb, void *client_data)
 
livox_status LidarSetMode (uint8_t handle, LidarMode mode, CommonCommandCallback cb, void *client_data)
 
livox_status LidarSetExtrinsicParameter (uint8_t handle, LidarSetExtrinsicParameterRequest *req, CommonCommandCallback cb, void *client_data)
 
livox_status LidarGetExtrinsicParameter (uint8_t handle, LidarGetExtrinsicParameterCallback cb, void *client_data)
 
livox_status LidarRainFogSuppress (uint8_t handle, bool enable, CommonCommandCallback cb, void *client_data)
 
livox_status LidarTurnOffFan (uint8_t handle, CommonCommandCallback cb, void *client_data)
 
livox_status LidarTurnOnFan (uint8_t handle, CommonCommandCallback cb, void *client_data)
 
livox_status LidarGetFanState (uint8_t handle, LidarGetFanStateCallback cb, void *client_data)
 
livox_status LidarSetPointCloudReturnMode (uint8_t handle, PointCloudReturnMode mode, CommonCommandCallback cb, void *client_data)
 
livox_status LidarGetPointCloudReturnMode (uint8_t handle, LidarGetPointCloudReturnModeCallback cb, void *client_data)
 
livox_status LidarSetImuPushFrequency (uint8_t handle, ImuFreq freq, CommonCommandCallback cb, void *client_data)
 
livox_status LidarGetImuPushFrequency (uint8_t handle, LidarGetImuPushFrequencyCallback cb, void *client_data)
 
livox_status LidarSetRmcSyncTime (uint8_t handle, const char *rmc, uint16_t rmc_length, CommonCommandCallback cb, void *client_data)
 
livox_status LidarSetUtcSyncTime (uint8_t handle, LidarSetUtcSyncTimeRequest *req, CommonCommandCallback cb, void *client_data)
 

Typedef Documentation

typedef void(* CommonCommandCallback) (livox_status status, uint8_t handle, uint8_t response, void *client_data)

Function type of callback with 1 byte of response.

Parameters
statuskStatusSuccess on successful return, kStatusTimeout on timeout, see LivoxStatus for other error code.
handledevice handle.
responseresponse from the device.
client_datauser data associated with the command.

Definition at line 183 of file livox_sdk.h.

typedef void(* DataCallback) (uint8_t handle, LivoxEthPacket *data, uint32_t data_num, void *client_data)

Callback function for receiving point cloud data.

Parameters
handledevice handle.
datadevice's data.
data_numnumber of points in data.
client_datauser data associated with the command.

Definition at line 159 of file livox_sdk.h.

typedef void(* DeviceBroadcastCallback) (const BroadcastDeviceInfo *info)

SetBroadcastCallback response callback function.

Parameters
infoinformation of the broadcast device, becomes invalid after the function returns.

Definition at line 73 of file livox_sdk.h.

typedef void(* DeviceInformationCallback) (livox_status status, uint8_t handle, DeviceInformationResponse *response, void *client_data)

Function type of callback that queries device's information.

Parameters
statuskStatusSuccess on successful return, kStatusTimeout on timeout, see LivoxStatus for other error code.
handledevice handle.
responseresponse from the device.
client_datauser data associated with the command.

Definition at line 138 of file livox_sdk.h.

typedef void(* DeviceResetParametersCallback) (livox_status status, uint8_t handle, DeviceParameterResponse *response, void *client_data)

DeviceResetParameters' response callback function.

Parameters
statuskStatusSuccess on successful return, kStatusTimeout on timeout, see LivoxStatus for other error code.
handledevice handle.
responseresponse from the device.
client_datauser data associated with the command.

Definition at line 431 of file livox_sdk.h.

typedef void(* DeviceStateUpdateCallback) (const DeviceInfo *device, DeviceEvent type)

SetDeviceStateUpdateCallback response callback function.

Parameters
deviceinformation of the connected device.
typethe update type that indicates connection/disconnection of the device or change of working state.

Definition at line 87 of file livox_sdk.h.

typedef void(* ErrorMessageCallback) (livox_status status, uint8_t handle, ErrorMessage *message)

Callback of the error status message. kStatusSuccess on successful return, see LivoxStatus for other

Parameters
handledevice handle.
responseresponse from the device.

Definition at line 242 of file livox_sdk.h.

typedef void(* GetDeviceIpInformationCallback) (livox_status status, uint8_t handle, GetDeviceIpModeResponse *response, void *client_data)

Callback function that gets device's IP information.

Parameters
statuskStatusSuccess on successful return, kStatusTimeout on timeout, see LivoxStatus for other error code.
handledevice handle.
responseresponse from the device.
client_datauser data associated with the command.

Definition at line 300 of file livox_sdk.h.

typedef void(* GetDeviceParametersCallback) (livox_status status, uint8_t handle, GetDeviceParameterResponse *response, void *client_data)

GetDeviceParameters' response callback function.

Parameters
statuskStatusSuccess on successful return, kStatusTimeout on timeout, see LivoxStatus for other error code.
handledevice handle.
responseresponse from the device.
client_datauser data associated with the command.

Definition at line 366 of file livox_sdk.h.

typedef void(* HubFanControlCallback) (livox_status status, uint8_t handle, HubFanControlResponse *response, void *client_data)

HubFanControl response callback function.

Parameters
statuskStatusSuccess on successful return, kStatusTimeout on timeout, see LivoxStatus for other error code.
handledevice handle.
responseresponse from the device.
client_datauser data associated with the command.

Definition at line 633 of file livox_sdk.h.

typedef void(* HubGetExtrinsicParameterCallback) (livox_status status, uint8_t handle, HubGetExtrinsicParameterResponse *response, void *client_data)

HubGetExtrinsicParameter response callback function.

Parameters
statuskStatusSuccess on successful return, kStatusTimeout on timeout, see LivoxStatus for other error code.
handledevice handle.
responseresponse from the device.
client_datauser data associated with the command.

Definition at line 559 of file livox_sdk.h.

typedef void(* HubGetFanStateCallback) (livox_status status, uint8_t handle, HubGetFanStateResponse *response, void *client_data)

HubGetFanControl response callback function.

Parameters
statuskStatusSuccess on successful return, kStatusTimeout on timeout, see LivoxStatus for other error code.
handledevice handle.
responseresponse from the device.
client_datauser data associated with the command.

Definition at line 656 of file livox_sdk.h.

typedef void(* HubGetImuPushFrequencyCallback) (livox_status status, uint8_t handle, HubGetImuPushFrequencyResponse *response, void *client_data)

HubGetImuPushFrequency response callback function.

Parameters
statuskStatusSuccess on successful return, kStatusTimeout on timeout, see LivoxStatus for other error code.
handledevice handle.
responseresponse from the device.
client_datauser data associated with the command.

Definition at line 760 of file livox_sdk.h.

typedef void(* HubGetPointCloudReturnModeCallback) (livox_status status, uint8_t handle, HubGetPointCloudReturnModeResponse *response, void *client_data)

HubGetPointCloudReturnMode response callback function.

Parameters
statuskStatusSuccess on successful return, kStatusTimeout on timeout, see LivoxStatus for other error code.
handledevice handle.
responseresponse from the device.
client_datauser data associated with the command.

Definition at line 708 of file livox_sdk.h.

typedef void(* HubQueryLidarInformationCallback) (livox_status status, uint8_t handle, HubQueryLidarInformationResponse *response, void *client_data)

HubQueryLidarInformation response callback function.

Parameters
statuskStatusSuccess on successful return, kStatusTimeout on timeout, see LivoxStatus for other error code.
handledevice handle.
responseresponse from the device.
client_datauser data associated with the command.

Definition at line 465 of file livox_sdk.h.

typedef void(* HubQueryLidarStatusCallback) (livox_status status, uint8_t handle, HubQueryLidarStatusResponse *response, void *client_data)

HubQueryLidarStatus response callback function.

Parameters
statuskStatusSuccess on successful return, kStatusTimeout on timeout, see LivoxStatus for other error code.
handledevice handle.
responseresponse from the device.
client_datauser data associated with the command.

Definition at line 506 of file livox_sdk.h.

typedef void(* HubQuerySlotPowerStatusCallback) (livox_status status, uint8_t handle, HubQuerySlotPowerStatusResponse *response, void *client_data)

HubQuerySlotPowerStatus response callback function.

Parameters
statuskStatusSuccess on successful return, kStatusTimeout on timeout, see LivoxStatus for other error code.
handledevice handle.
responseresponse from the device.
client_datauser data associated with the command.

Definition at line 615 of file livox_sdk.h.

typedef void(* HubRainFogSuppressCallback) (livox_status status, uint8_t handle, HubRainFogSuppressResponse *response, void *client_data)

HubRainFogSuppress response callback function.

Parameters
statuskStatusSuccess on successful return, kStatusTimeout on timeout, see LivoxStatus for other error code.
handledevice handle.
responseresponse from the device.
client_datauser data associated with the command.

Definition at line 589 of file livox_sdk.h.

typedef void(* HubSetExtrinsicParameterCallback) (livox_status status, uint8_t handle, HubSetExtrinsicParameterResponse *response, void *client_data)

HubSetExtrinsicParameter response callback function.

Parameters
statuskStatusSuccess on successful return, kStatusTimeout on timeout, see LivoxStatus for other error code.
handledevice handle.
responseresponse from the device.
client_datauser data associated with the command.

Definition at line 533 of file livox_sdk.h.

typedef void(* HubSetImuPushFrequencyCallback) (livox_status status, uint8_t handle, HubSetImuPushFrequencyResponse *response, void *client_data)

HubSetImuPushFrequency response callback function.

Parameters
statuskStatusSuccess on successful return, kStatusTimeout on timeout, see LivoxStatus for other error code.
handledevice handle.
responseresponse from the device.
client_datauser data associated with the command.

Definition at line 734 of file livox_sdk.h.

typedef void(* HubSetModeCallback) (livox_status status, uint8_t handle, HubSetModeResponse *response, void *client_data)

HubSetMode response callback function.

Parameters
statuskStatusSuccess on successful return, kStatusTimeout on timeout, see LivoxStatus for other error code.
handledevice handle.
responseresponse from the device.
client_datauser data associated with the command.

Definition at line 486 of file livox_sdk.h.

typedef void(* HubSetPointCloudReturnModeCallback) (livox_status status, uint8_t handle, HubSetPointCloudReturnModeResponse *response, void *client_data)

HubSetPointCloudReturnMode response callback function.

Parameters
statuskStatusSuccess on successful return, kStatusTimeout on timeout, see LivoxStatus for other error code.
handledevice handle.
responseresponse from the device.
client_datauser data associated with the command.

Definition at line 682 of file livox_sdk.h.

typedef void(* LidarGetExtrinsicParameterCallback) (livox_status status, uint8_t handle, LidarGetExtrinsicParameterResponse *response, void *client_data)

LidarGetExtrinsicParameter response callback function.

Parameters
statuskStatusSuccess on successful return, kStatusTimeout on timeout, see LivoxStatus for other error code.
handledevice handle.
responseresponse from the device.
client_datauser data associated with the command.

Definition at line 829 of file livox_sdk.h.

typedef void(* LidarGetFanStateCallback) (livox_status status, uint8_t handle, LidarGetFanStateResponse *response, void *client_data)

LidarGetFanState response callback function.

Parameters
statuskStatusSuccess on successful return, kStatusTimeout on timeout, see LivoxStatus for other error code.
handledevice handle.
responseresponse from the device.
client_datauser data associated with the command.

Definition at line 882 of file livox_sdk.h.

typedef void(* LidarGetImuPushFrequencyCallback) (livox_status status, uint8_t handle, LidarGetImuPushFrequencyResponse *response, void *client_data)

LidaGetImuPushFrequency response callback function.

Parameters
statuskStatusSuccess on successful return, kStatusTimeout on timeout, see LivoxStatus for other error code.
handledevice handle.
responseresponse from the device.
client_datauser data associated with the command.

Definition at line 950 of file livox_sdk.h.

typedef void(* LidarGetPointCloudReturnModeCallback) (livox_status status, uint8_t handle, LidarGetPointCloudReturnModeResponse *response, void *client_data)

LidaGetPointCloudReturnMode response callback function.

Parameters
statuskStatusSuccess on successful return, kStatusTimeout on timeout, see LivoxStatus for other error code.
handledevice handle.
responseresponse from the device.
client_datauser data associated with the command.

Definition at line 916 of file livox_sdk.h.

typedef void(* SetDeviceParametersCallback) (livox_status status, uint8_t handle, DeviceParameterResponse *response, void *client_data)

SetDeviceParameters' response callback function.

Parameters
statuskStatusSuccess on successful return, kStatusTimeout on timeout, see LivoxStatus for other error code.
handledevice handle.
responseresponse from the device.
client_datauser data associated with the command.

Definition at line 333 of file livox_sdk.h.

Function Documentation

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.

Parameters
broadcast_codedevice's broadcast code.
handledevice 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.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status AddLidarToConnect ( 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.

Parameters
broadcast_codedevice's broadcast code.
handledevice handle. The handle is the same as the order calling AddLidarToConnect starting from 0.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status DeviceResetAllParameters ( uint8_t  handle,
DeviceResetParametersCallback  cb,
void *  client_data 
)

Reset LiDAR/Hub's All Parameters, see DeviceParamKeyName for all parameters.

Parameters
handledevice handle.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status DeviceResetParameters ( uint8_t  handle,
DeviceParamKeyName keys,
uint8_t  num,
DeviceResetParametersCallback  cb,
void *  client_data 
)

Reset LiDAR/Hub's Parameters, see DeviceParamKeyName for all parameters.

Parameters
handledevice handle.
keyskeys to reset, see DeviceParamKeyName for all parameters.
numnum of keys to reset.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
void DisableConsoleLogger ( )

Disable console log output.

livox_status DisconnectDevice ( uint8_t  handle,
CommonCommandCallback  cb,
void *  client_data 
)

Disconnect divice.

Parameters
handledevice handle.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status GetConnectedDevices ( DeviceInfo devices,
uint8_t *  size 
)

Get all connected devices' information.

Parameters
deviceslist of connected devices' information.
sizenumber of devices connected.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status GetDeviceIpInformation ( uint8_t  handle,
GetDeviceIpInformationCallback  cb,
void *  client_data 
)

Get device's IP mode.

Parameters
handledevice handle.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
void GetLivoxSdkVersion ( LivoxSdkVersion version)

Return SDK's version information in a numeric form.

Parameters
versionPointer to a version structure for returning the version information.
livox_status HubControlSlotPower ( HubControlSlotPowerRequest req,
CommonCommandCallback  cb,
void *  client_data 
)

Toggle the power supply of designated slots.

Parameters
reqrequest whether to enable or disable the power of designated slots.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status HubExtrinsicParameterCalculation ( bool  enable,
CommonCommandCallback  cb,
void *  client_data 
)

Turn on or off the calculation of extrinsic parameters.

Parameters
enablethe request whether enable or disable calculating the extrinsic parameters.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status HubFanControl ( HubFanControlRequest req,
uint16_t  length,
HubFanControlCallback  cb,
void *  client_data 
)

Turn on or off the fan of LiDAR unit connected to the Livox Hub.

Parameters
reqFan control of LiDAR units.
lengthlength of req.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status HubGetExtrinsicParameter ( HubGetExtrinsicParameterCallback  cb,
void *  client_data 
)

Get extrinsic parameters of LiDAR units connected to the Livox Hub.

Parameters
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status HubGetFanState ( HubGetFanStateRequest req,
uint16_t  length,
HubGetFanStateCallback  cb,
void *  client_data 
)

Get fan state of LiDAR unit connected to the Livox Hub.

Parameters
reqGet fan state of LiDAR units.
lengthlength of req.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status HubGetImuPushFrequency ( HubGetImuPushFrequencyRequest req,
uint16_t  length,
HubGetImuPushFrequencyCallback  cb,
void *  client_data 
)

Get IMU push frequency of LiDAR units connected to the Livox Hub.

Parameters
reqget IMU push frequency of LiDAR units.
lengththe request's length.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status HubGetLidarHandle ( uint8_t  slot,
uint8_t  id 
)

Get the LiDAR unit handle used in the Livox Hub data callback function from slot and id.

Parameters
slotLivox Hub's slot.
idLivox Hub's id.
Returns
LiDAR unit handle.
livox_status HubGetPointCloudReturnMode ( HubGetPointCloudReturnModeRequest req,
uint16_t  length,
HubGetPointCloudReturnModeCallback  cb,
void *  client_data 
)

Get point cloud return mode of LiDAR unit connected to the Livox Hub.

Parameters
reqGet point cloud return mode of LiDAR units.
lengthlength of req.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status HubQueryLidarInformation ( HubQueryLidarInformationCallback  cb,
void *  client_data 
)

Query the information of LiDARs connected to the hub.

Parameters
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status HubQueryLidarStatus ( HubQueryLidarStatusCallback  cb,
void *  client_data 
)

Get the state of LiDAR units connected to the Livox Hub.

Parameters
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status HubQuerySlotPowerStatus ( HubQuerySlotPowerStatusCallback  cb,
void *  client_data 
)

Get the power supply state of each hub slot.

Parameters
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status HubRainFogSuppress ( HubRainFogSuppressRequest req,
uint16_t  length,
HubRainFogSuppressCallback  cb,
void *  client_data 
)

Toggling the rain and fog mode for lidars connected to the hub.

Parameters
reqthe request whether open or close the rain and fog mode.
lengththe request's length.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status HubSetExtrinsicParameter ( HubSetExtrinsicParameterRequest req,
uint16_t  length,
HubSetExtrinsicParameterCallback  cb,
void *  client_data 
)

Set extrinsic parameters of LiDAR units connected to the Livox Hub.

Parameters
reqthe parameters to write.
lengththe request's length.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status HubSetImuPushFrequency ( HubSetImuPushFrequencyRequest req,
uint16_t  length,
HubSetImuPushFrequencyCallback  cb,
void *  client_data 
)

Set IMU push frequency of LiDAR units connected to the Livox Hub.

Parameters
reqset IMU push frequency of LiDAR units.
lengththe request's length.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status HubSetMode ( HubSetModeRequest req,
uint16_t  length,
HubSetModeCallback  cb,
void *  client_data 
)

Set the mode of LiDAR unit connected to the Livox Hub.

Parameters
reqmode configuration of LiDAR units.
lengthlength of req.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status HubSetPointCloudReturnMode ( HubSetPointCloudReturnModeRequest req,
uint16_t  length,
HubSetPointCloudReturnModeCallback  cb,
void *  client_data 
)

Set point cloud return mode of LiDAR units connected to the Livox Hub.

Parameters
reqset point cloud return mode of LiDAR units.
lengththe request's length.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status HubStartSampling ( CommonCommandCallback  cb,
void *  client_data 
)

Start hub sampling.

Parameters
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status HubStopSampling ( CommonCommandCallback  cb,
void *  client_data 
)

Stop the Livox Hub's sampling.

Parameters
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
bool Init ( )

Initialize the SDK.

Returns
true if successfully initialized, otherwise false.
livox_status LidarDisableHighSensitivity ( uint8_t  handle,
SetDeviceParametersCallback  cb,
void *  client_data 
)

LiDAR Disable HighSensitivity.

Note
LidarDisableHighSensitivity only support for Tele/Avia.
Parameters
handledevice handle.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status LidarEnableHighSensitivity ( uint8_t  handle,
SetDeviceParametersCallback  cb,
void *  client_data 
)

LiDAR Enable HighSensitivity.

Note
LidarEnableHighSensitivity only support for Tele/Avia.
Parameters
handledevice handle.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status LidarGetExtrinsicParameter ( uint8_t  handle,
LidarGetExtrinsicParameterCallback  cb,
void *  client_data 
)

Get LiDAR extrinsic parameters.

Parameters
handledevice handle.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status LidarGetFanState ( uint8_t  handle,
LidarGetFanStateCallback  cb,
void *  client_data 
)

Get state of the fan.

Note
LidarGetFanState is not supported for Mid40/100.
Parameters
handledevice handle.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status LidarGetHighSensitivityState ( uint8_t  handle,
GetDeviceParametersCallback  cb,
void *  client_data 
)

LiDAR Get HighSensitivity State.

Note
LidarGetHighSensitivityState only support for Tele/Avia.
Parameters
handledevice handle.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status LidarGetImuPushFrequency ( uint8_t  handle,
LidarGetImuPushFrequencyCallback  cb,
void *  client_data 
)

Get IMU push frequency.

Note
LidarGetImuPushFrequency is not supported for Mid40/100.
Parameters
handledevice handle.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status LidarGetPointCloudReturnMode ( uint8_t  handle,
LidarGetPointCloudReturnModeCallback  cb,
void *  client_data 
)

Get point cloud return mode.

Note
LidarGetPointCloudReturnMode is not supported for Mid40/100.
Parameters
handledevice handle.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status LidarGetScanPattern ( uint8_t  handle,
GetDeviceParametersCallback  cb,
void *  client_data 
)

LiDAR Get Scan Pattern.

Note
LidarGetScanPattern only support for Avia.
Parameters
handledevice handle.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status LidarGetSlotNum ( uint8_t  handle,
GetDeviceParametersCallback  cb,
void *  client_data 
)

LiDAR Get Slot Number.

Note
LidarGetSlotNum only support for Mid70/Avia.
Parameters
handledevice handle.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status LidarRainFogSuppress ( uint8_t  handle,
bool  enable,
CommonCommandCallback  cb,
void *  client_data 
)

Enable and disable the rain/fog suppression.

Note
LidarRainFogSuppress only support for Mid40/100.
Parameters
handledevice handle.
enableenable and disable the rain/fog suppression.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status LidarSetExtrinsicParameter ( uint8_t  handle,
LidarSetExtrinsicParameterRequest req,
CommonCommandCallback  cb,
void *  client_data 
)

Set LiDAR extrinsic parameters.

Parameters
handledevice handle.
reqthe parameters to write.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status LidarSetImuPushFrequency ( uint8_t  handle,
ImuFreq  freq,
CommonCommandCallback  cb,
void *  client_data 
)

Set IMU push frequency.

Note
LidarSetImuPushFrequency is not supported for Mid40/100.
Parameters
handledevice handle.
freqIMU push frequency.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status LidarSetMode ( uint8_t  handle,
LidarMode  mode,
CommonCommandCallback  cb,
void *  client_data 
)

Set LiDAR mode.

Note
Successful callback function status only means LiDAR successfully starting the changing process of mode. You need to observe the actually change of mode in DeviceStateUpdateCallback function.
Parameters
handledevice handle.
modethe mode to change.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status LidarSetPointCloudReturnMode ( uint8_t  handle,
PointCloudReturnMode  mode,
CommonCommandCallback  cb,
void *  client_data 
)

Set point cloud return mode.

Note
LidarSetPointCloudReturnMode is not supported for Mid40/100.
Parameters
handledevice handle.
modepoint cloud return mode.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status LidarSetRmcSyncTime ( uint8_t  handle,
const char *  rmc,
uint16_t  rmc_length,
CommonCommandCallback  cb,
void *  client_data 
)

Set GPRMC formate synchronization time.

Note
LidarSetRmcSyncTime is not supported for Mid40/100 firmware version < 03.07.0000.
Parameters
handledevice handle.
rmcGPRMC/GNRMC format data.
rmc_lengthlenth of gprmc.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status LidarSetScanPattern ( uint8_t  handle,
LidarScanPattern  pattern,
SetDeviceParametersCallback  cb,
void *  client_data 
)

LiDAR Set Scan Pattern.

Note
LidarSetScanPattern only support for Avia.
Parameters
handledevice handle.
patternscan pattern of LiDAR, see LidarScanPattern for detail.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status LidarSetSlotNum ( uint8_t  handle,
uint8_t  slot,
SetDeviceParametersCallback  cb,
void *  client_data 
)

LiDAR Set Slot Number.

Note
LidarSetSlotNum only support for Mid70/Avia.
Parameters
handledevice handle.
slotslot number of LiDAR, range from 1 to 9.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status LidarSetUtcSyncTime ( uint8_t  handle,
LidarSetUtcSyncTimeRequest req,
CommonCommandCallback  cb,
void *  client_data 
)

Set UTC formate synchronization time.

Note
LidarSetUtcSyncTime is not supported for Mid40/100 firmware version < 03.07.0000.
Parameters
handledevice handle.
reqUTC format data.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status LidarStartSampling ( uint8_t  handle,
CommonCommandCallback  cb,
void *  client_data 
)

Start LiDAR sampling.

Parameters
handledevice handle.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status LidarStopSampling ( uint8_t  handle,
CommonCommandCallback  cb,
void *  client_data 
)

Stop LiDAR sampling.

Parameters
handledevice handle.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status LidarTurnOffFan ( uint8_t  handle,
CommonCommandCallback  cb,
void *  client_data 
)

Turn off the fan.

Note
LidarTurnOffFan is not supported for Mid40/100.
Parameters
handledevice handle.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status LidarTurnOnFan ( uint8_t  handle,
CommonCommandCallback  cb,
void *  client_data 
)

Turn on the fan.

Note
LidarTurnOnFan is not supported for Mid40/100.
Parameters
handledevice handle.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status QueryDeviceInformation ( uint8_t  handle,
DeviceInformationCallback  cb,
void *  client_data 
)

Command to query device's information.

Parameters
handledevice handle.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status RebootDevice ( uint8_t  handle,
uint16_t  timeout,
CommonCommandCallback  cb,
void *  client_data 
)

Reboot device.

Note
RebootDevice is not supported for Mid40/100 firmware version < 03.07.0000.
Parameters
handledevice handle.
timeoutreboot device after [timeout] ms.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
void SaveLoggerFile ( )

Save the log file.

void SetBroadcastCallback ( DeviceBroadcastCallback  cb)

Set the callback of listening device broadcast message. When broadcast message is received from Livox Hub/LiDAR, cb is called.

Parameters
cbcallback for device broadcast.
livox_status SetCartesianCoordinate ( uint8_t  handle,
CommonCommandCallback  cb,
void *  client_data 
)

Change point cloud coordinate system to cartesian coordinate.

Parameters
handledevice handle.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
void SetDataCallback ( uint8_t  handle,
DataCallback  cb,
void *  client_data 
)

Set the callback to receive point cloud data. Only one callback is supported for a specific device. Set the point cloud data callback before beginning sampling.

Parameters
handledevice handle.
cbcallback to receive point cloud data.
Note
1: Don't do any blocking operations in callback function, it will affects further data's receiving; 2: For different device handle, callback to receive point cloud data will run on its own thread. If you bind different handle to same callback function, please make sure that operations in callback function are thread-safe; 3: callback function's data pointer will be invalid after callback fuction returns. It's recommended to copy all data_num of point cloud every time callback is triggered.
Parameters
client_datauser data associated with the command.
void SetDeviceStateUpdateCallback ( DeviceStateUpdateCallback  cb)

Add a callback for device connection or working state changing event.

Note
Livox SDK supports two hardware connection modes. 1: Directly connecting to the LiDAR device; 2. Connecting to the LiDAR device(s) via the Livox Hub. In the first mode, connection/disconnection of every LiDAR unit is reported by this callback. In the second mode, only connection/disconnection of the Livox Hub is reported by this callback. If you want to get information of the LiDAR unit(s) connected to hub, see HubQueryLidarInformation.
3 conditions can trigger this callback:
  1. Connection and disconnection of device.
  2. A change of device working state.
  3. An error occurs.
Parameters
cbcallback for device connection/disconnection.
livox_status SetDynamicIp ( uint8_t  handle,
CommonCommandCallback  cb,
void *  client_data 
)

Set device's dynamic IP mode.

Parameters
handledevice handle.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status SetErrorMessageCallback ( uint8_t  handle,
ErrorMessageCallback  cb 
)

Add error status callback for the device. error code.

Parameters
handledevice handle.
cbcallback for the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status SetSphericalCoordinate ( uint8_t  handle,
CommonCommandCallback  cb,
void *  client_data 
)

Change point cloud coordinate system to spherical coordinate.

Parameters
handledevice handle.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status SetStaticDynamicIP ( uint8_t  handle,
SetDeviceIPModeRequest req,
CommonCommandCallback  cb,
void *  client_data 
)

Set device's IP mode.

Note
SetStaticDynamicIP only supports setting Hub or Mid40/100's IP mode. If you want to set Horizon or Tele's IP mode, see SetStaticIp and SetDynamicIp.
Parameters
handledevice handle.
reqrequest sent to device.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
livox_status SetStaticIp ( uint8_t  handle,
SetStaticDeviceIpModeRequest 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. SetStaticDeviceIpModeRequest's setting: net_mask and gw_addr will not take effect on Mid40/100.
Parameters
handledevice handle.
reqrequest sent to device.
cbcallback for the command.
client_datauser data associated with the command.
Returns
kStatusSuccess on successful return, see LivoxStatus for other error code.
bool Start ( )

Start the device scanning routine which runs on a separate thread.

Returns
true if successfully started, otherwise false.
void Uninit ( )

Uninitialize the SDK.