getSystemDateAndTime method

Future<SystemDateAndTime> getSystemDateAndTime()

This operation gets the device system date and time. The device shall support the return of the daylight saving setting and of the manual system date and time (if applicable) or indication of NTP time (if applicable) through the getSystemDateAndTime command.

A device shall provide the UTC DateTime information.

Access Class: PRE_AUTH

Implementation

Future<SystemDateAndTime> getSystemDateAndTime() async {
  loggy.debug('getSystemDateAndTime');

  final responseEnvelope = await transport.request(
      uri,
      soap.Body(
        request: DeviceManagementRequest.getSystemDateAndTime(),
      ));

  if (responseEnvelope.body.hasFault) {
    throw Exception(responseEnvelope.body.fault.toString());
  }

  return GetSystemDateAndTimeResponse.fromJson(
          responseEnvelope.body.response!)
      .systemDateAndTime;
}