upnped 1.1.1
upnped: ^1.1.1 copied to clipboard
A Dart library for discovering and controlling UPnP devices.
upnped #
A Dart library for discovering and controlling UPnP devices.
Installation #
Install from pub with:
flutter pub add upnped
or by adding upnped as a dependency in pubspec.yaml:
dependencies:
upnped: <latest_version>
Usage #
Discover devices #
final server = Server.getInstance();
server.devices.listen((UPnPDevice event) {
print('Discovered a device: ${event}');
});
await server.listen(Options{
locale: 'en',
});
await server.search();
Invoke actions #
final control = ControlPoint.getInstance();
UPnPDevice device = getDevice();
ServiceAction action = selectAction(device);
Map<String, dynamic> actionArgs = collectArgs();
action.invoke(control, actionArgs);us
Monitor UPnP Events #
UPnPObserver.networkEvents.listen(print);