How to develop a new Device

From AGILE IoT Wiki
Jump to: navigation, search

Work-in-progress.png

To support a specific device (e.g. SensorTag with default TI BLE GATT firmware and characteristics) on top of a generic protocol (e.g. BLE GATT), AGILE requires a device type implementation to be deployed in the system. Device types are deployed in device factories (one factory can implement several device types) and device representations are instantiated by the factory when a device is registered in the system. Device factories and the device registration is managed by the device manager. Once the device is instantiated it is also registered on the D-Bus. Communication with the device implementation is direct and does not involve the device manager after the registration step.

The system currently contains one Java based DeviceFactory only. Other factories (e.g. one in Python) can be added to the system by modifying the DeviceManager.

Implementing a device type in the default DeviceFactory

Implement the new device in the DeviceFactory (part of agile-core) in Java, like the SensorTag. You should write one class implementing the device type, inheriting from the base device class (or some more specific class in the hierarchy). Please follow the example at https://github.com/Agile-IoT/agile-core/pull/45