Previous Topic

Next Topic

Book Contents

Book Index

DeviceClassObjectSpi

The DeviceClassObjectSpi com.prosyst.mbs.services.hdm.spi.DeviceClassObjectSpi, represents the device functionalities. The DeviceClassObjectSpi aims to present each device functionality to Device Access in a universal way. These functionalities are represented either by a Device Class or a Functional Item.

Below we will demonstrate a simple implementation of DeviceClassObjectSpi which is related to Functional Item Management specification. You can find more information on how to implement a Functional Item in the Functional Item Management Developer Guide – Defining Functional Items section. We will also demonstrate a basic implementation of a device item. More information on implementing your own device class objects using DeviceClassObjectSpi can be found in the Home Device Manager Developer Guide (deprecated).

The DeviceClassObjectSpi provided by the protocol adapter is marked as a Device Item in the following cases:

The Device Item is a java interface that has a set of properties, operations and events that are generated if properties are changed. For detailed information refer to the Property Cache section. Each Device Item returned by the adapter must implement DeviceClassObjectSpi interface and also some functional interface.

When you implement an adapter you must follow a set of rules related to the implementation of the Device Item:

The following methods are not invoked at all by Device Access and the adapter does not need to implement them:

The following methods are invoked only initially when device is added. Their values are used as initial values for device items accessed by applications:

The DeviceClassObjectSpi type (getType()) is added to device item tags accessed by applications. It is better that adapters implement the method FunctionalItem.getTags() rather than getType().

In the Device Access Protocol Adapter Demo we create an abstract class, which implements DeviceClassObjectSpi and does not extend FunctionalItem interface, but provides default implementation of the FunctionalItem methods.

For more information refer to the Device Access Protocol Adapter Demo – com.prosyst.mbs.da.adapter-demo.

The full list of demos is in Device Access Demos.