Files
salmanoff/commonLibs/livoxProto1/livoxProto1.h
T

61 lines
1.7 KiB
C++
Raw Normal View History

#ifndef LIVOXPROTO1_H
#define LIVOXPROTO1_H
#include <memory>
#include <string>
#include <cstdint>
// Forward declarations
namespace smo {
class ComponentThread;
}
namespace livoxProto1 {
class Device;
}
#ifdef __cplusplus
extern "C" {
#endif
/**
* Initialize the Livox protocol library
* @param componentThread Component thread shared pointer
*/
typedef void livoxProto1_mainFn(
const std::shared_ptr<smo::ComponentThread>& componentThread);
/**
* Cleanup the Livox protocol library
*/
typedef void livoxProto1_exitFn(void);
/**
* Create a new Livox device connection
* @param deviceIdentifier The device identifier (broadcast code)
* @param componentThread Component thread for async operations
* @param handshakeTimeoutMs Handshake timeout in milliseconds (default: 1000)
* @param retryDelayMs Retry delay in milliseconds (default: 3000)
* @param smoIp SMO IP address (empty string for auto-detection)
* @param smoSubnetNbits SMO subnet mask bits (e.g., 24 for /24, 16 for /16)
* @param dataPort Data port for point cloud (default: 56000)
* @param cmdPort Command port (default: 56001)
* @param imuPort IMU port (default: 56002)
* @return Device pointer on success, nullptr on failure
*/
typedef std::shared_ptr<livoxProto1::Device> livoxProto1_getOrCreateDeviceFn(
const std::string& deviceIdentifier,
const std::shared_ptr<smo::ComponentThread>& componentThread,
int handshakeTimeoutMs, int retryDelayMs,
const std::string& smoIp, uint8_t smoSubnetNbits,
uint16_t dataPort, uint16_t cmdPort, uint16_t imuPort);
livoxProto1_mainFn livoxProto1_main;
livoxProto1_exitFn livoxProto1_exit;
livoxProto1_getOrCreateDeviceFn livoxProto1_getOrCreateDevice;
#ifdef __cplusplus
}
#endif
#endif // LIVOXPROTO1_H