DevMgr: Add DeviceRoles; attachedDevices unrelated to device state now
We've decided to add a separate notion of a DeviceRole to track attached device roles now. We no longer use the collection of deviceSpecs to track which roles have been attached. Rather, this list will simply collate all known deviceAttachment specs which are expected to be maintained in an attached state. SMO can periodically scan through these and cross-reference this collection with the collection of attachedDeviceRoles. Then it can re-try to attach those which aren't currently attached at any given moment. This will give resilience against device attachment failures or device resets/malfunctions, at runtime.
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include <memory>
|
||||
#include <sstream>
|
||||
#include <user/deviceAttachmentSpec.h>
|
||||
#include <deviceManager/deviceRole.h>
|
||||
|
||||
namespace smo {
|
||||
namespace device {
|
||||
@@ -19,16 +20,16 @@ public:
|
||||
{
|
||||
std::ostringstream os;
|
||||
os << "Device Identifier: " << deviceIdentifier
|
||||
<< ", Attachment Specs: " << deviceAttachmentSpecs.size() << std::endl;
|
||||
for (const auto& spec : deviceAttachmentSpecs) {
|
||||
os << " " << spec->stringify();
|
||||
<< ", Device Roles: " << deviceRoles.size() << std::endl;
|
||||
for (const auto& deviceRole : deviceRoles) {
|
||||
os << " " << deviceRole->deviceAttachmentSpec->stringify();
|
||||
}
|
||||
return os.str();
|
||||
}
|
||||
|
||||
public:
|
||||
std::string deviceIdentifier;
|
||||
std::vector<std::shared_ptr<DeviceAttachmentSpec>> deviceAttachmentSpecs;
|
||||
std::vector<std::shared_ptr<DeviceRole>> deviceRoles;
|
||||
};
|
||||
|
||||
} // namespace device
|
||||
|
||||
Reference in New Issue
Block a user