Accessing the Device Setting Categories

Last modified: Jul 5, 2019 @ 06:41

The following examples show how to access the device setting categories.

From a DeviceRegisterRequest:

SettingCategory simpleSettingCategory = deviceRegisterRequest.getSettingCategory("SimpleSettingCategory");
if(simpleSettingCategory != null) {
  String setting1Value = simpleSettingCategory.getSettingValue("Setting1");
}

From a DeviceRegistration:

DeviceRegistration deviceRegistration = gateway.getDeviceRegistry().getRegistrationByEndpoint(endpoint);
SettingCategory simpleSettingCategory = deviceRegistration.getSettingCategory("SimpleSettingCategory");
if(simpleSettingCategory != null) {
  String setting1Value = simpleSettingCategory.getSettingValue("Setting1");
}