upnp_client 0.0.11 upnp_client: ^0.0.11 copied to clipboard
Universal Plug and Play (UPnP) Client Implementation. Will support IGD control as well as DLNA
example/upnp_client_example.dart
import 'dart:io';
import 'package:upnp_client/src/device.dart';
import 'package:upnp_client/upnp_client.dart';
main() {
print("Searching for devices");
searchDevices().then((devices) =>
devices.isEmpty ? print('No devices found') : devices.forEach(print));
}
Future<List<Device>> searchDevices() async {
var deviceDiscover = DeviceDiscoverer();
await deviceDiscover.start(addressTypes: [InternetAddressType.IPv4]);
var devices = await deviceDiscover.getDevices();
deviceDiscover.stop();
return devices;
}