
0
Under review
DeviceConnectivity for late joiners?
I'm (still) writing an ICE app that detects when devices turn on and off.
So far, the app Subscribes to HeartBeat and DeviceIdentity.
We've found this doesn't seem to be sufficient to detect whether the device is on or off.
Now I've added a subscription to DeviceConnectivity, and am planning to consider a device "on" only if the app has received a DeviceIdentity (to know about the device), and DeviceConnectivity (to know when the device is in the Connected state).
It seems that DeviceIdentity is emitted by a device adapter only when its connection state changes. Given that, it seems that a late joiner app cannot know the DeviceConnectivity state (without provoking the Device Adapter in a way I don't yet know).
This leads me to ask two questions:
1) is there a simple method that I've missed, for detecting whether a given Medical Device is on or off?
2) (failing that) how should a late joiner app find whether the Devices it receives HeartBeat data from are on or off (connected or not connected)?
Thanks,
Brad
So far, the app Subscribes to HeartBeat and DeviceIdentity.
We've found this doesn't seem to be sufficient to detect whether the device is on or off.
Now I've added a subscription to DeviceConnectivity, and am planning to consider a device "on" only if the app has received a DeviceIdentity (to know about the device), and DeviceConnectivity (to know when the device is in the Connected state).
It seems that DeviceIdentity is emitted by a device adapter only when its connection state changes. Given that, it seems that a late joiner app cannot know the DeviceConnectivity state (without provoking the Device Adapter in a way I don't yet know).
This leads me to ask two questions:
1) is there a simple method that I've missed, for detecting whether a given Medical Device is on or off?
2) (failing that) how should a late joiner app find whether the Devices it receives HeartBeat data from are on or off (connected or not connected)?
Thanks,
Brad
Customer support service by UserEcho
Now we've really come to the basic question of How to infer/calculate whether a device is on or off.
Thanks,
Brad
2.) Again I'd refer you to the DeviceListModelImpl and accessory classes thereof. In the Supervisory UI devices with live HeartBeats are admitted to the UI for display. If their DeviceConnectivity doesn't exist (so far unreported) or is NOT in the Connected state they are represented with a circle/slash indicating that the device is unavailable.
But this is a great discussion and we should continue to discuss the edge cases.
Thank you
Jeff
Thanks for the pointer to DeviceListModelImpl - I'll have a read. It's good to hear we're in the ballpark of the right way to detect what we want.
Thanks again,
Brad
Can you say anything about how to detect "ALIVE" state of a Device's HeartBeat from an application? I'm unclear on which classes that DeviceListModelImpl depends on are part of the base OpenICE library vs. parts that are intended only for Device Adapters, or parts that were written solely for the OpenICE Supervisor. For example, I see TimeManager isn't part of the library available to HelloICE, but DeviceConnectivityInstanceModel is.
Peeling the onion,
Brad
It's not just the onion tears obscuring what's at work here. You are right that TimeManager is somewhat monolithic. It's a place where a lot of the magic lives to keep it safe. I'll try to explain some of the magic .. specifically how TimeManager tracks the liveliness of HeartBeat instances. But first to clarify Participants contain Subscribers (1:n) and Subscribers contain DataReaders (1:n). In DDS most of the "action" happens at the DataReader level. A Subscribers biggest job is to contain DataReaders. One other important job is that all the DataReaders inherit their "partition" from the containing Subscriber. There's a picture of it in RTI's documentation.
DDS tracks "liveliness" of data instances in accordance with the Liveliness QoS policy. Currently in OpenICE readers of the HeartBeat topic should use the "heartbeat" named QoS profile. In the code use of this profile looks like this:
and the profile specifies a 5 second lease duration (instances are marked "NOT ALIVE" when no new samples have arrived or the writer of the instance hasn't responded before the lease times out). The next line creates a ReadCondition which can be added to a WaitSet to get notified whenever an unread sample state exists in the reader.
That condition is registered in the event loop with a handler.
The handler then reads from the DataReader when the collection is active
and checks the SampleInfo.instance_state flag for the current liveliness state of an instance. So if the HeartBeat is no longer alive
Or if the Heartbeat instance is alive
different action can be taken.
In this way the current "live" and "not alive" instances of HeartBeat can be tracked. DDS is stateful so you could also do this without events periodically with calls to read_next_instance but somehow the API there gets even more obtuse.
Cheers!
Jeff Plourde