tryReregisterDevice method

Future<void> tryReregisterDevice(
  1. DeviceConfiguration<DeviceRegistration> device
)

Tries to re-register the device with the deployment service. This entails trying to unregister the device and then trying to register it again.

Implementation

Future<void> tryReregisterDevice(DeviceConfiguration device) async {
  await tryUnregisterDisconnectedDevice(device);
  // Wait for a few seconds before trying to register the device again,
  // to give the deployment service some time to process the un-registration.
  Future.delayed(
    Duration(seconds: 5),
    () async => await tryRegisterConnectedDevice(device),
  );
}