com.biocomfort.TO
Class MedicalDeviceTO

java.lang.Object
  extended by com.biocomfort.TO.MedicalDeviceTO
All Implemented Interfaces:
TO, java.io.Serializable, java.lang.Cloneable

public class MedicalDeviceTO
extends java.lang.Object
implements TO, java.io.Serializable, java.lang.Cloneable

Represents a medical device with its address, its states and its information. This class is used in the SDK to pass or to receive information about a specific medical device.

Initially each object of this class only reserves memory to store the address and the states of a medical device. Therefore it can also be used if only the address of this device should be stored or passed. To associate additional information to a MedicalDeviceTO object the specific data objects have to be created and set to the object.

See Also:
Serialized Form

Constructor Summary
MedicalDeviceTO()
          Create a MedicalDeviceTO instance with the initial device id '000.000'.
MedicalDeviceTO(short[] deviceId)
          Create a MedicalDeviceTO instance with the given device id.
 
Method Summary
 java.lang.Object clone()
          Returns a deep clone of this instance of MedicalDeviceTO.
 boolean equalsDeviceId(MedicalDeviceTO otherDevice)
          Returns true if the device id of the given medical device is equals the device id of this MedicalDeviceTO instance.
 java.lang.Object getAddressKey()
          Returns a key object that is equals with another key object if and only if these two medical devices has the same address.
 DeviceBindingState getBindingState()
          Returns the current binding state of this medical device.
 int getBindingStateIntValue()
          This function is used for serialization issues.
 DateTimeTO getDateTime()
          Returns a data object that represents the date time of the medical device.
 short[] getDeviceId()
          Returns the device id of this medical device as a short array of the length 2.
 DeviceStatusTO getDeviceStatus()
          Returns a data object that represents status information of the medical device.
 FirmwareTO getFirmware()
          Returns a data object that represents firmware information of the medical device.
 IeeeAddressTO getIeeeAddress()
          Returns a data object that represents the IEEE MAC-address of the medical device.
 DeviceOnlineState getOnlineState()
          Returns the current online state of this medical device.
 SerialNumberTO getSerialNumber()
          Returns a data object that represents the serial number of the medical device.
 DeviceSpeedState getSpeedState()
          Returns the current speed state of this medical device.
 UserSettingTO getUserSetting()
          Returns a data object that represents user setting information of the medical device.
 void setBindingState(DeviceBindingState bindingState)
          Sets the binding state.
 void setBindingStateIntValue(int value)
          This function is used for serialization issues.
 void setDateTime(DateTimeTO dateTime)
          Set the data object that represents the date time of the medical device.
 void setDeviceId(int deviceId0, int deviceId1)
          Sets the device id of this medical device.
 void setDeviceId(short[] deviceId)
          Sets the device id of this medical device.
 void setDeviceStatus(DeviceStatusTO deviceStatus)
          Sets the data object that represents status information of the medical device.
 void setFirmware(FirmwareTO firmware)
          Sets the data object that represents firmware information of the medical device.
 void setIeeeAddress(IeeeAddressTO ieeeAddress)
          Sets the data object that represents the IEEE MAC-address of the medical device.
 void setOnlineState(DeviceOnlineState onlineState)
          Sets the online state of the medical device.
 void setSerialNumber(SerialNumberTO serialNumber)
          Set the data object that represents the serial number of the medical device.
 void setSpeedState(DeviceSpeedState speedState)
          Sets the speed state of the medical device.
 void setUserSetting(UserSettingTO userSetting)
          Sets the data object that represents user setting information of the medical device.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MedicalDeviceTO

public MedicalDeviceTO()
Create a MedicalDeviceTO instance with the initial device id '000.000'. The binding state and speed state are UNDEFINED and the online state is OFFLINE.


MedicalDeviceTO

public MedicalDeviceTO(short[] deviceId)
Create a MedicalDeviceTO instance with the given device id. The binding state and speed state are UNDEFINED and the online state is OFFLINE.

Parameters:
deviceId - the device id. Must be a short array of the length 2.
Method Detail

getDeviceId

public short[] getDeviceId()
Returns the device id of this medical device as a short array of the length 2.

Returns:
the medical device's id

setDeviceId

public void setDeviceId(short[] deviceId)
Sets the device id of this medical device.

Parameters:
deviceId - the device id. Must be a short array of the length 2.

setDeviceId

public void setDeviceId(int deviceId0,
                        int deviceId1)
Sets the device id of this medical device.

Parameters:
deviceId0 - the device id's first byte
deviceId1 - the device id's second byte

getBindingState

public DeviceBindingState getBindingState()
Returns the current binding state of this medical device.

It is only possible to interact with a medical device or unbind it if its binding state is DeviceBindingState.BOUND. To bind a medical device its binding state must be DeviceBindingState.UNBOUND.

Returns:
the medical device's binding state

setBindingState

public void setBindingState(DeviceBindingState bindingState)
Sets the binding state.

It is only possible to interact with a medical device or unbind it if its binding state is DeviceBindingState.BOUND. To bind a medical device its binding state must be DeviceBindingState.UNBOUND.

Parameters:
bindingState - the new medical device's binding state

getSpeedState

public DeviceSpeedState getSpeedState()
Returns the current speed state of this medical device. The speed state represents the communication speed of this device.

The speed of a medical device should be increased automatically if it communicates with the dongle and should be decreased if some inactive time has elapsed, on unbinding the device or on exiting the SDK. Note that a fast medical device's communication speed will result in a higher power consumption of the battery. Therefore it should be managed automatically.

Returns:
the current medical device's speed state

setSpeedState

public void setSpeedState(DeviceSpeedState speedState)
Sets the speed state of the medical device. The speed state represents the communication speed of this device.

The speed of a medical device should be increased automatically if it communicates with the dongle and should be decreased if some inactive time has elapsed, on unbinding the device or on exiting the SDK. Note that a fast medical device's communication speed will result in a higher power consumption of the battery. Therefore it should be managed automatically.

Parameters:
speedState - the new medical device's speed state

getOnlineState

public DeviceOnlineState getOnlineState()
Returns the current online state of this medical device.

The online state shows the medical device's online status and also its availability. It is not possible to interact with an offline medical device.

Returns:
the current medical device's online speed.

setOnlineState

public void setOnlineState(DeviceOnlineState onlineState)
Sets the online state of the medical device.

The online state shows the medical device's online status and also its availability. It is not possible to interact with an offline medical device.

Parameters:
onlineState - the new medical device's online state.

getDateTime

public DateTimeTO getDateTime()
Returns a data object that represents the date time of the medical device.

Returns:
the medical device's date time

setDateTime

public void setDateTime(DateTimeTO dateTime)
Set the data object that represents the date time of the medical device.

Parameters:
dateTime - the medical device's date time

getSerialNumber

public SerialNumberTO getSerialNumber()
Returns a data object that represents the serial number of the medical device.

Returns:
the medical device's serial number

setSerialNumber

public void setSerialNumber(SerialNumberTO serialNumber)
Set the data object that represents the serial number of the medical device.

Parameters:
serialNumber - the medical device's serial number

getFirmware

public FirmwareTO getFirmware()
Returns a data object that represents firmware information of the medical device.

Returns:
the medical device's firmware information

setFirmware

public void setFirmware(FirmwareTO firmware)
Sets the data object that represents firmware information of the medical device.

Parameters:
firmware - the medical device's firmware information

getUserSetting

public UserSettingTO getUserSetting()
Returns a data object that represents user setting information of the medical device.

Returns:
the medical device's user setting information

setUserSetting

public void setUserSetting(UserSettingTO userSetting)
Sets the data object that represents user setting information of the medical device.

Parameters:
userSetting - the medical device's user setting information

getIeeeAddress

public IeeeAddressTO getIeeeAddress()
Returns a data object that represents the IEEE MAC-address of the medical device.

Returns:
the medical device's IEEE MAC-address

setIeeeAddress

public void setIeeeAddress(IeeeAddressTO ieeeAddress)
Sets the data object that represents the IEEE MAC-address of the medical device.

Parameters:
ieeeAddress - the medical device's IEEE MAC-address

getDeviceStatus

public DeviceStatusTO getDeviceStatus()
Returns a data object that represents status information of the medical device.

Returns:
the medical device's status information

setDeviceStatus

public void setDeviceStatus(DeviceStatusTO deviceStatus)
Sets the data object that represents status information of the medical device.

Parameters:
deviceStatus - the medical device's status information

setBindingStateIntValue

public void setBindingStateIntValue(int value)
This function is used for serialization issues.

Parameters:
value -

getBindingStateIntValue

public int getBindingStateIntValue()
This function is used for serialization issues.

Returns:
The integer value of the device state.

equalsDeviceId

public boolean equalsDeviceId(MedicalDeviceTO otherDevice)
Returns true if the device id of the given medical device is equals the device id of this MedicalDeviceTO instance.

Parameters:
otherDevice - the medical device description that device id should be tested
Returns:
true if the given medical device's id is equals the device id of this medical device, otherwise false

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Returns a deep clone of this instance of MedicalDeviceTO.

Overrides:
clone in class java.lang.Object
Returns:
a deep clone of this instance
Throws:
java.lang.CloneNotSupportedException - if a nested object could not be cloned

getAddressKey

public java.lang.Object getAddressKey()
Returns a key object that is equals with another key object if and only if these two medical devices has the same address.

Returns:
a string object that is unique for different device ids