getRelayOutputs method

Future<List<String>> getRelayOutputs()

Implementation

Future<List<String>> getRelayOutputs() async {
  const String body = '<tds:GetRelayOutputs/>';
  final response = await client.soapRequest(body,
      action: 'http://www.onvif.org/ver10/device/wsdl/GetRelayOutputs');

  final document = XmlDocument.parse(response);
  const tdsNs = 'http://www.onvif.org/ver10/device/wsdl';

  final result = document
      .findAllElements('RelayOutputs', namespace: tdsNs)
      .map((e) => e.getAttribute('token') ?? '')
      .where((token) => token.isNotEmpty)
      .toList(growable: false);

  OnvifLogger.instance.log(
    'GetRelayOutputs count=${result.length} tokens=${result.join(',')}',
    name: _tag,
  );
  return result;
}