livox: rename handshakeTimeoutMs=>commandTimeoutMs

This commit is contained in:
2025-11-01 02:45:24 -04:00
parent 58e9b09995
commit c8474edad7
8 changed files with 38 additions and 33 deletions
+2 -2
View File
@@ -129,7 +129,7 @@ public:
void DeviceManager::getOrCreateDeviceReq(
const std::string &deviceIdentifier,
const std::shared_ptr<smo::ComponentThread>& componentThread,
int handshakeTimeoutMs, int retryDelayMs,
int commandTimeoutMs, int retryDelayMs,
const std::string& smoIp, uint8_t smoSubnetNbits,
uint16_t dataPort, uint16_t cmdPort, uint16_t imuPort,
smo::Callback<livoxProto1_getOrCreateDeviceReqCbFn> callback)
@@ -163,7 +163,7 @@ void DeviceManager::getOrCreateDeviceReq(
// Device doesn't exist, create a new one but don't add it to collection yet
auto newDevice = std::make_shared<Device>(
deviceIdentifier, componentThread,
handshakeTimeoutMs, retryDelayMs,
commandTimeoutMs, retryDelayMs,
smoIp, smoSubnetNbits,
dataPort, cmdPort, imuPort);
+1 -1
View File
@@ -26,7 +26,7 @@ public:
void getOrCreateDeviceReq(
const std::string &deviceIdentifier,
const std::shared_ptr<smo::ComponentThread>& componentThread,
int handshakeTimeoutMs, int retryDelayMs,
int commandTimeoutMs, int retryDelayMs,
const std::string& smoIp, uint8_t smoSubnetNbits,
uint16_t dataPort, uint16_t cmdPort, uint16_t imuPort,
smo::Callback<livoxProto1_getOrCreateDeviceReqCbFn> callback);
+7 -7
View File
@@ -90,7 +90,7 @@ std::string DiscoveredDevice::getDeviceTypeName(void) const
Device::Device(const std::string &deviceIdentifier,
const std::shared_ptr<smo::ComponentThread>& componentThread,
int handshakeTimeoutMs, int retryDelayMs,
int commandTimeoutMs, int retryDelayMs,
const std::string& smoIp, uint8_t smoSubnetNbits,
uint16_t dataPort, uint16_t cmdPort, uint16_t imuPort)
: discoveredDevice(
@@ -99,7 +99,7 @@ Device::Device(const std::string &deviceIdentifier,
""),
nAttachedStimBuffs(0),
componentThread(componentThread),
handshakeTimeoutMs(handshakeTimeoutMs), retryDelayMs(retryDelayMs),
commandTimeoutMs(commandTimeoutMs), retryDelayMs(retryDelayMs),
smoIp(smoIp), detectedSmoListeningIp(""), smoSubnetNbits(smoSubnetNbits),
dataPort(dataPort), cmdPort(cmdPort), imuPort(imuPort),
heartbeatActive(false),
@@ -572,7 +572,7 @@ private:
* we will consider the handshake to have failed.
*/
timeoutTimer.expires_from_now(
boost::posix_time::milliseconds(device.handshakeTimeoutMs));
boost::posix_time::milliseconds(device.commandTimeoutMs));
timeoutTimer.async_wait(
std::bind(
@@ -651,7 +651,7 @@ private:
if (finalTimerFired
&& finalSocketState == SocketState::SOCKET_STILL_WAITING)
{
std::cerr << __func__ << ": Handshake timeout with "
std::cerr << __func__ << ": Command timeout with "
<< deviceIP << "(" << device.discoveredDevice.deviceIdentifier
<< ")" << std::endl;
@@ -1389,7 +1389,7 @@ protected:
{
// Setup timeout timer
timeoutTimer.expires_from_now(
boost::posix_time::milliseconds(device.handshakeTimeoutMs));
boost::posix_time::milliseconds(device.commandTimeoutMs));
timeoutTimer.async_wait(
std::bind(
@@ -1998,7 +1998,7 @@ public:
{
// Set up timeout timer
timeoutTimer.expires_from_now(boost::posix_time::milliseconds(
device.handshakeTimeoutMs));
device.commandTimeoutMs));
timeoutTimer.async_wait(
std::bind(&SetReturnModeReq::setReturnModeReq1_1,
this, request,
@@ -2245,7 +2245,7 @@ public:
{
// Set up timeout timer
timeoutTimer.expires_from_now(boost::posix_time::milliseconds(
device.handshakeTimeoutMs));
device.commandTimeoutMs));
timeoutTimer.async_wait(
std::bind(&GetReturnModeReq::getReturnModeReq1_1,
+2 -2
View File
@@ -74,7 +74,7 @@ class Device
public:
Device(const std::string &deviceIdentifier,
const std::shared_ptr<smo::ComponentThread>& componentThread,
int handshakeTimeoutMs, int retryDelayMs,
int commandTimeoutMs, int retryDelayMs,
const std::string& smoIp, uint8_t smoSubnetNbits,
uint16_t dataPort, uint16_t cmdPort, uint16_t imuPort);
~Device();
@@ -152,7 +152,7 @@ public:
// Configuration
std::shared_ptr<smo::ComponentThread> componentThread;
int handshakeTimeoutMs, retryDelayMs;
int commandTimeoutMs, retryDelayMs;
std::string smoIp;
std::string detectedSmoListeningIp;
uint8_t smoSubnetNbits;
+2 -2
View File
@@ -10,7 +10,7 @@ extern "C" {
void livoxProto1_getOrCreateDeviceReq(
const std::string& deviceIdentifier,
const std::shared_ptr<smo::ComponentThread>& componentThread,
int handshakeTimeoutMs, int retryDelayMs,
int commandTimeoutMs, int retryDelayMs,
const std::string& smoIp, uint8_t smoSubnetNbits,
uint16_t dataPort, uint16_t cmdPort, uint16_t imuPort,
smo::Callback<livoxProto1_getOrCreateDeviceReqCbFn> callback
@@ -28,7 +28,7 @@ void livoxProto1_getOrCreateDeviceReq(
// Delegate to DeviceManager
protoState.deviceManager->getOrCreateDeviceReq(
deviceIdentifier, componentThread,
handshakeTimeoutMs, retryDelayMs,
commandTimeoutMs, retryDelayMs,
smoIp, smoSubnetNbits,
dataPort, cmdPort, imuPort,
callback);
+2 -2
View File
@@ -41,7 +41,7 @@ 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 commandTimeoutMs Command 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)
@@ -57,7 +57,7 @@ typedef std::function<
typedef void livoxProto1_getOrCreateDeviceReqFn(
const std::string& deviceIdentifier,
const std::shared_ptr<smo::ComponentThread>& componentThread,
int handshakeTimeoutMs, int retryDelayMs,
int commandTimeoutMs, int retryDelayMs,
const std::string& smoIp, uint8_t smoSubnetNbits,
uint16_t dataPort, uint16_t cmdPort, uint16_t imuPort,
smo::Callback<livoxProto1_getOrCreateDeviceReqCbFn> callback);