SApiMgr:attDevReq: use body||world thread for i/e-devs

We now pass in the correct ComponentThread based on the type of
device that's being attached.
This commit is contained in:
2025-09-15 12:47:37 -04:00
parent 472184bbbc
commit db8f047322
4 changed files with 35 additions and 10 deletions
+6 -9
View File
@@ -51,14 +51,10 @@ static LivoxProto1DllState livoxProto1;
static std::vector<std::shared_ptr<livoxProto1::Device>> g_attachedDevices;
// Callback function declarations
extern "C" int livoxGen1_initializeInd(void);
extern "C" int livoxGen1_finalizeInd(void);
extern "C" void livoxGen1_attachDeviceReq(
const std::shared_ptr<smo::device::DeviceAttachmentSpec>& desc,
smo::sense_api::sal_mlo_attachDeviceReqCbFn cb);
extern "C" void livoxGen1_detachDeviceReq(
const std::shared_ptr<smo::device::DeviceAttachmentSpec>& desc,
smo::sense_api::sal_mlo_detachDeviceReqCbFn cb);
extern "C" sal_mlo_initializeIndFn livoxGen1_initializeInd;
extern "C" sal_mlo_finalizeIndFn livoxGen1_finalizeInd;
extern "C" sal_mlo_attachDeviceReqFn livoxGen1_attachDeviceReq;
extern "C" sal_mlo_detachDeviceReqFn livoxGen1_detachDeviceReq;
// Sense API descriptor
static const SenseApiDesc livoxGen1ApiDesc = {
@@ -155,6 +151,7 @@ extern "C" int livoxGen1_finalizeInd(void)
extern "C" void livoxGen1_attachDeviceReq(
const std::shared_ptr<smo::device::DeviceAttachmentSpec>& desc,
const std::shared_ptr<smo::ComponentThread>& componentThread,
smo::sense_api::sal_mlo_attachDeviceReqCbFn cb
)
{
@@ -249,7 +246,7 @@ extern "C" void livoxGen1_attachDeviceReq(
(*livoxProto1.livoxProto1_getOrCreateDeviceReq)(
desc->deviceSelector, // deviceIdentifier (broadcast code)
smoThreadingModelDesc.componentThread,
componentThread,
handshakeTimeoutMs, retryDelayMs,
smoIp, smoSubnetNbits,
dataPort, cmdPort, imuPort,