SenseApis: Make attachDeviceReq async in drivers and SenseApiMgr

Slowly retrogressively making these sequences async
This commit is contained in:
2025-09-10 06:51:55 -04:00
parent 5b5a701c69
commit 1b6b12256d
9 changed files with 282 additions and 116 deletions
@@ -30,13 +30,13 @@ public:
static const std::string stringifyDeviceSpecs(void);
// New async function for device attachment
void newDeviceAttachmentSpecInd(
typedef std::function<void(
bool success, std::shared_ptr<Device> device,
std::shared_ptr<DeviceAttachmentSpec> deviceSpec)>
deviceAttachmentSpecIndCbFn;
void newDeviceAttachmentSpecInd(
std::shared_ptr<DeviceAttachmentSpec> spec,
std::function<
void(
bool success, std::shared_ptr<Device> device,
std::shared_ptr<DeviceAttachmentSpec> deviceSpec)>
callback);
deviceAttachmentSpecIndCbFn callback);
private:
DeviceManager() = default;
+15 -6
View File
@@ -43,12 +43,18 @@ public:
void initializeAllSenseApiLibs(void);
void finalizeAllSenseApiLibs(void);
void attachAllSenseDevicesFromSpecs(void);
void attachSenseDevice(
const std::shared_ptr<device::DeviceAttachmentSpec>& spec);
void detachSenseDevice(
const std::shared_ptr<device::DeviceAttachmentSpec>& spec);
void detachAllSenseDevices(void);
typedef sal_mlo_attachDeviceReqCbFn attachSenseDeviceReqCbFn;
typedef sal_mlo_detachDeviceReqCbFn detachSenseDeviceReqCbFn;
void attachSenseDeviceReq(
const std::shared_ptr<device::DeviceAttachmentSpec>& spec,
attachSenseDeviceReqCbFn cb);
void detachSenseDeviceReq(
const std::shared_ptr<device::DeviceAttachmentSpec>& spec,
detachSenseDeviceReqCbFn cb);
void attachAllSenseDevicesFromSpecs(void);
void detachAllSenseDevices(void);
void detachAllSenseDevicesReq(void);
std::string stringifyLibs() const;
@@ -61,6 +67,9 @@ private:
std::vector<std::shared_ptr<SenseApiLib>> senseApiLibs;
class AttachSenseDeviceReq;
class DetachSenseDeviceReq;
public:
static std::optional<std::string> searchForLibInSmoSearchPaths(
const std::string& libraryPath);