DevMgr: call newDevAttSpecInd & not attDevReq in body:initReq
This performs a more complete device initialization and attachment sequence. We'll do the corresponding teardown in the shutdown sequence later. We might probably do it as deviceRoleGoneAwayInd()
This commit is contained in:
@@ -106,7 +106,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create DeviceRole and add it to both DeviceManager's and Device's collections
|
// Create DeviceRole and add it to both DeviceManager's and Device's collections
|
||||||
auto deviceRole = std::make_shared<DeviceRole>(spec);
|
auto deviceRole = std::make_shared<DeviceRole>(*device, spec);
|
||||||
attachedDeviceRoles.push_back(deviceRole);
|
attachedDeviceRoles.push_back(deviceRole);
|
||||||
device->deviceRoles.push_back(deviceRole);
|
device->deviceRoles.push_back(deviceRole);
|
||||||
|
|
||||||
@@ -357,19 +357,21 @@ public:
|
|||||||
{
|
{
|
||||||
for (const auto& spec : DeviceManager::deviceAttachmentSpecs)
|
for (const auto& spec : DeviceManager::deviceAttachmentSpecs)
|
||||||
{
|
{
|
||||||
DeviceManager::getInstance().attachSenseDeviceReq(
|
DeviceManager::getInstance().newDeviceAttachmentSpecInd(
|
||||||
spec,
|
spec,
|
||||||
{context, std::bind(
|
{context, std::bind(
|
||||||
&AttachAllSenseDevicesFromSpecsReq::attachAllSenseDevicesFromSpecsReq2,
|
&AttachAllSenseDevicesFromSpecsReq::attachAllSenseDevicesFromSpecsReq2,
|
||||||
context.get(), context,
|
context.get(), context,
|
||||||
std::placeholders::_1, std::placeholders::_2)});
|
std::placeholders::_1, std::placeholders::_2,
|
||||||
|
std::placeholders::_3)});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Callback methods for the attachment sequence
|
// Callback methods for the attachment sequence
|
||||||
void attachAllSenseDevicesFromSpecsReq2(
|
void attachAllSenseDevicesFromSpecsReq2(
|
||||||
std::shared_ptr<AttachAllSenseDevicesFromSpecsReq> context,
|
std::shared_ptr<AttachAllSenseDevicesFromSpecsReq> context,
|
||||||
bool success, std::shared_ptr<DeviceAttachmentSpec> spec
|
bool success, std::shared_ptr<DeviceRole> deviceRole,
|
||||||
|
std::shared_ptr<DeviceAttachmentSpec> spec
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (!success)
|
if (!success)
|
||||||
|
|||||||
@@ -7,13 +7,18 @@
|
|||||||
namespace smo {
|
namespace smo {
|
||||||
namespace device {
|
namespace device {
|
||||||
|
|
||||||
|
class Device; // Forward declaration
|
||||||
|
|
||||||
class DeviceRole
|
class DeviceRole
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DeviceRole(std::shared_ptr<DeviceAttachmentSpec> spec)
|
DeviceRole(
|
||||||
: deviceAttachmentSpec(spec)
|
Device& parentDevice,
|
||||||
|
std::shared_ptr<DeviceAttachmentSpec>& spec)
|
||||||
|
: parentDevice(parentDevice), deviceAttachmentSpec(spec)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
Device& parentDevice;
|
||||||
std::shared_ptr<DeviceAttachmentSpec> deviceAttachmentSpec;
|
std::shared_ptr<DeviceAttachmentSpec> deviceAttachmentSpec;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user