Tigase IoT Framework is an extended version of Jaxmpp Bot Framework which allows you to take all benefits and use all features provided by Jaxmpp Bot Framework, such as usage of Tigase Kernel as IoC container and so on.
Note
For more detailed information about usage of Jaxmpp Bot Framework please look into documentation of Jaxmpp Bot Framework.
By default Tigase IoT Framework requires you to wrap value read from sensor in a class implementing tigase.iot.framework.devices.IValue
.
This requirement was introduces to bond together timestamp (marking time when value was initially read) with a value and allows
you to add additional
informations as well, ie. temperature can be passed with correct scale, etc.
Currently we provided following implementations for storing following values:
- temperature -
tigase.iot.framework.values.Temperature
- light -
tigase.iot.framework.values.Light
- movement -
tigase.iot.framework.values.Movement
For this classes we provide you with proper serializers and parsers used for transferring this values over XMPP protocol.
Warning
If you decide to add a new class then you will need to implement and provide Tigase IoT Framework with new parser and serializer
(a bean extending AbstractValueFormatter
with a support for your newly created implementation of IValue
interface).
Warning
Additionally you will need to provide proper support for parsing this data in client library as in other case data from your sensor will not be available in UI.
In our framework device type is just a string to make it easy to extend it by adding new device/sensor types. Currently we provide devices with following device types and only this device types are supported by UI:
- movement-sensor
- tv-sensor
- light-dimmer
- light-sensor
- temperature-sensor
To add support for a new device type, you need to override createDevice()
method of Devices
classes from client-library
module and add there support for new device type.
This will add support for a new device type in a client model layer. Additionally you need to add support for this new device
inside DevicesListViewImpl
to add support in a presentation layer.
Note
This separation on a client side is create for a reason. It is done in such a way to make presentation layer separate from model layer and allow reuse of a model layer in other clients with different presentation layer.