Device States

All devices that are managed by the SDK have three different states: a binding state, an online state and a speed state. The values of theses states are stored in the data class MedicalDeviceTO that represents a single device.

The Device Binding States

The binding state of a device shows it binding and also its availability. The method getDeviceBindingState() of the class MedicalDeviceTO will return the enumeration type DeviceBindingState that represents this state. An interaction with a bound device is only possible if its binding state is DeviceBindingState.BOUND. Only for the methods bindDevice(MedicalDeviceTO medicalDevice), bindDevices(List medicalDevices) or bindAllUnboundDevices() the binding state has to be DeviceBindingState.UNBOUND. All other states are temporary and indicate that the device is not available at the moment. If a binding state of a device changes the event onDeviceBindingStateChanges of the listener SDKDevicesListener is fired. The illustration 2 shows the state machine of the device binding states whereas dotted edges represent transitions that are automatically initiated by the SDK and solid edges stand for transitions that are caused by method calls of the SDK.

device binding states

Illustration 2 - State machine of the device binding states

The Device Online States

The online state of a device shows its online status and also its availability. It is not possible to interact with an offline device. The only values for this state are online or offline.

device online states

Illustration 3 - State machine of the device online states

The Device Speed States

This state represents the device communication speed. The communication speed of a device is increased automatically if it communicates with the dongle and is decreased if some inactive time has elapsed, on unbinding the device or on exiting the sdk. Note that a fast device speed will result in a higher power consumption of the battery. Therefore it is managed automatically.

device speed states

Illustration 4 - State machine of the speed states

 
SourceForge.net Logo