Automatically Update Device Information

If there are new devices in range online, there are no more information of these devices except of their device id. With choosing an automatic update policy for bound and unbound devices you can assign different behaviors to the SDK in case that information are missing. There are three possible behaviors implemented:

  • AUTO_UPDATE_DISABLED
    This disables all automatic updates. (default value)
  • AUTO_UPDATE_MISSING_SERIAL_NUMBER
    This will only read the serial number of a device if it is missing.
  • AUTO_UPDATE_ALL_MISSING_DATA
    This policy updates automatically all missing device information.

The methods setBoundAutoUpdatePolicy(AutoUpdatePolicy autoUpdatePolicy) and setUnboundAutoUpdatePolicy(AutoUpdatePolicy autoUpdatePolicy) of the SDK will set the policy of automatic information updates for bound and unbound devices. If the automatic update function is enabled for unbound devices these devices will be temporary bound for reading the missing information. By default the automatic updates are set to AUTO_UPDATE_DISABLED for bound and unbound devices.

// this will probably be a good setting for many health
// applications...
sdk.setBoundAutoUpdatePolicy(
    AutoUpdatePolicy.AUTO_UPDATE_ALL_MISSING_DATA);
sdk.setUnboundAutoUpdatePolicy(
    AutoUpdatePolicy.AUTO_UPDATE_MISSING_SERIAL_NUMBER);

 
SourceForge.net Logo