SenseApiDesc: SAL_MLO: attach/detachDeviceReq: return parsed DA spec

This commit is contained in:
2025-09-10 18:09:06 -04:00
parent 428a32a950
commit 81842e4571
3 changed files with 12 additions and 10 deletions
+4 -2
View File
@@ -34,8 +34,10 @@ struct SmoThreadingModelDesc
std::shared_ptr<ComponentThread> componentThread; std::shared_ptr<ComponentThread> componentThread;
}; };
typedef std::function<void(bool)> sal_mlo_attachDeviceReqCbFn; typedef std::function<void(bool, std::shared_ptr<device::DeviceAttachmentSpec>)>
typedef std::function<void(bool)> sal_mlo_detachDeviceReqCbFn; sal_mlo_attachDeviceReqCbFn;
typedef std::function<void(bool, std::shared_ptr<device::DeviceAttachmentSpec>)>
sal_mlo_detachDeviceReqCbFn;
typedef int (sal_mlo_initializeIndFn)(void); typedef int (sal_mlo_initializeIndFn)(void);
typedef int (sal_mlo_finalizeIndFn)(void); typedef int (sal_mlo_finalizeIndFn)(void);
+5 -5
View File
@@ -260,7 +260,7 @@ extern "C" void livoxGen1_attachDeviceReq(
{ {
std::cerr << __func__ << ": Failed to create Livox device: " std::cerr << __func__ << ": Failed to create Livox device: "
<< desc->deviceSelector << std::endl; << desc->deviceSelector << std::endl;
cb(false); cb(false, desc);
return; return;
} }
@@ -272,7 +272,7 @@ extern "C" void livoxGen1_attachDeviceReq(
<< desc->deviceIdentifier << ")\n"; << desc->deviceIdentifier << ")\n";
} }
cb(success); cb(success, desc);
} }
); );
} }
@@ -319,7 +319,7 @@ extern "C" void livoxGen1_detachDeviceReq(
{ {
std::cerr << __func__ << ": Failed to destroy Livox device: " std::cerr << __func__ << ": Failed to destroy Livox device: "
<< desc->deviceIdentifier << "\n"; << desc->deviceIdentifier << "\n";
cb(false); cb(false, desc);
return; return;
} }
@@ -341,7 +341,7 @@ extern "C" void livoxGen1_detachDeviceReq(
std::cerr << __func__ << ": Race condition: device not found " std::cerr << __func__ << ": Race condition: device not found "
"in g_attachedDevices for detachment: " "in g_attachedDevices for detachment: "
<< desc->deviceIdentifier << "\n"; << desc->deviceIdentifier << "\n";
cb(false); cb(false, desc);
return; return;
} }
@@ -349,7 +349,7 @@ extern "C" void livoxGen1_detachDeviceReq(
std::cout << __func__ << ": Successfully detached Livox device: " std::cout << __func__ << ": Successfully detached Livox device: "
<< desc->deviceIdentifier << "\n"; << desc->deviceIdentifier << "\n";
cb(success); cb(success, desc);
} }
); );
} }
+3 -3
View File
@@ -285,7 +285,7 @@ static void xcbWindow_attachDeviceReq(
<< g_attachedWindows.back()->stringify() << g_attachedWindows.back()->stringify()
<< "\n"; << "\n";
cb(true); cb(true, desc);
} }
static void xcbWindow_detachDeviceReq( static void xcbWindow_detachDeviceReq(
@@ -304,7 +304,7 @@ static void xcbWindow_detachDeviceReq(
std::cerr << __func__ << ": Device not found for detachment:\n" std::cerr << __func__ << ": Device not found for detachment:\n"
<< spec->stringify() << "\n"; << spec->stringify() << "\n";
cb(false); cb(false, spec);
return; return;
} }
@@ -312,7 +312,7 @@ static void xcbWindow_detachDeviceReq(
std::cout << __func__ << ": Detached X11 window device:\n" std::cout << __func__ << ": Detached X11 window device:\n"
<< spec->stringify() << "\n"; << spec->stringify() << "\n";
cb(true); cb(true, spec);
} }
// SenseApi descriptor // SenseApi descriptor