...
Implement an interface for Raspberry Pi. For more information, see the implementation of
DeviceManagerService
for Raspberry Pi.Info icon false title Why is this step required? WSO2 IoTS can have many device types. These device types will be registered on WSO2 CDMF when the OSGI runtime starts. For the new device type to be registered with the CDMF, it needs to have an interface that the OSGI identifies at its runtime. The
DeviceManagementService
interface is implemented for this reason. Therefore, it is important that you implement theDeviceManagementService
interface extended fromorg.wso2.carbon.device.mgt.common.spi
.DeviceManagementService
. You are able to implement methods unique to a device by overriding the methods defined in the interface.Example: Implementing the interface
DeviceManagementService
.Code Block public interface DeviceManagementService extends ApplicationManager { void init() throws DeviceManagementException; String getType(); OperationMonitoringTaskConfig getOperationMonitoringConfig(); DeviceManager getDeviceManager(); ApplicationManager getApplicationManager(); ProvisioningConfig getProvisioningConfig(); PushNotificationConfig getPushNotificationConfig(); PolicyMonitoringManager PushNotificationConfig getPushNotificationConfiggetPolicyMonitoringManager(); }
Expand title Click here to know more about the methods used to create the interface. Panel borderColor #5E90FB bgColor #ffffff borderWidth 1 getType()
Retrieves the name of the device-type.
init()
Custom initialization implementations needs to be included here.-
getOperationMonitoringConfig()
Returns an object, which is an implementation of the interfaceorg.wso2.carbon.device.mgt.common.OperationMonitoringTaskConfig
getDeviceManager()
Returns an object, which is an implementation of the interfaceorg.wso2.carbon.device.mgt.common.DeviceManager.
getApplicationManager()
Returns an object, which is an implementation of the interfaceorg.wso2.carbon.device.mgt.common.app.mgt.ApplicationManager
.
getProvisioningConfig()
Returns the provisioning details, which includes the the name of the tenant domain the device-type needs to be registered to and indicates whether the device-type is to be shared with all the tenants (true
represents that the device-type should be visible to all tenants andfalse
meaning that it is not visible to other tenants.).-
getPolicyMonitoringManager()
Returns an object, which is an implementation of the interface org.wso2.carbon.device.mgt.common.policy.mgt.PolicyMonitoringManager
Implement the
DeviceManager
interface. For more information, see the implementation ofDeviceManager
for Raspberry Pi .Info title Why is this step required? Implement the interface
DeviceManager
for Connected Cup via theorg.wso2.carbon.device.mgt.common.DeviceManager
in order to implement thegetDeviceManager()
method that is shown in step 1. TheDeviceManager
interface will be used for enrolling, disenrolling, activating and deactivating a device.Create a Database Access Object (DAO) on the created
DeviceManager
interface to manage data source connections.Register as an OSGI service.
Example:Code Block ServiceRegistration raspberrypiServiceRegRef = bundleContext.registerService(DeviceManagementService.class.getName(), new RaspberrypiManagerService(), null);
Info RaspberrypiManagerService
is the implementation of the interface showed in step 1.Start the IoT Server.
Code Block cd <IoTS_HOME> ./wso2server.sh
...