windowsDiscovery method
Implementation
Future<void> windowsDiscovery(Duration duration) async {
final data = calloc<_OnvifDiscoveryData>();
final probeMessageData =
Transport.probe(Uuid().v4()).toXmlString().toNativeUtf8();
final devices = _discovery(data, probeMessageData, duration.inMilliseconds);
for (var index = 0; index < devices; index++) {
var envelope = Envelope.fromXmlString(
Pointer.fromAddress(data.address + index * 8192)
.cast<Utf8>()
.toDartString());
onvifDevices
.addAll(ProbeMatches.fromJson(envelope.body.response!).probeMatches);
}
malloc.free(probeMessageData);
calloc.free(data);
}