| || |
|−|Assuming you already have the protocol, you need a device implementation. There are ( at least) two possible ways. |+|
protocol , a device implementation . are () .
| || |
|−|A) Implement the new device in Java , like the SensorTag. |+|
Java . one in the the DeviceManager.
|−|In this case, you should write one class, inheriting from the base device class (or some more specific class in the hierarchy). | |
|−|Currently, this is included in the DeviceManager of the core, but we are working on moving it out of the core. The target is that you only need to drop a class file | |
| || |
|−|B) Implement the device interface right on the D- Bus, i.e. in whatever language. |+|
|−|This is a bit more complex, but there are examples for Python. |+|
Implement the device the -, . in . .
Latest revision as of 09:06, 6 March 2018
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