SenseApis: Make attachDeviceReq async in drivers and SenseApiMgr
Slowly retrogressively making these sequences async
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user