Difference between revisions of "How to develop a new Device"
Dpalomares (talk | contribs) |
|||
Line 1: | Line 1: | ||
[[File:Work-in-progress.png|50px]] | [[File:Work-in-progress.png|50px]] | ||
− | + | 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 |
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