- Discovery
- Device Information
- Services
- Actions
- Host Support
- DIAL API
- Router API
spinlocklabs / upnp.dart Goto Github PK
View Code? Open in Web Editor NEWUPnP Client for Dart
License: MIT License
UPnP Client for Dart
License: MIT License
I have found that both
https://pub.dev/packages/ssdp
and
https://pub.dev/packages/upnp
link to this repo.
ssdp looks like it is no longer maintained and I guess that it is now part of upnp package.
But ssdp is missing the discontinued label and the deprecation notice in Readme.
Here is an example from the connectivity package
....
RROR: FormatException: ERROR: Failed to parse device description. FormatException: Missing extension byte (at offset 460) - http://192.168.0.1:5000/rootDesc.xml
#0 DiscoveredClient.getDevice
lib/src/discovery.dart:367
#1 main.
bin/upnp.dart:10
#2 _RootZone.runUnaryGuarded (dart:async/zone.dart:1384:10)
#3 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:357:11)
#4 _DelayedData.perform (dart:async/stream_impl.dart:611:14)
#5 _StreamImplEvents.handleNext (dart:async/stream_impl.dart:730:11)
#6 _PendingEvents.schedule. (dart:async/stream_impl.dart:687:7)
#7 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#8 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#9 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
#10 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:169:5)
This problem can be fixed by changing the utf8 decoder to allow malformed utf8 codes.
try {
Utf8Decoder decoder = Utf8Decoder(allowMalformed: true);
var content = await response.cast<List>().transform(decoder).join();
doc = xml.parse(content);
} on Exception catch (e) {
throw new FormatException("ERROR: Failed to parse device"
" description. ${e}");
}
return new Device()..loadFromXml(location, doc.rootElement);
}
Hey !
I am having a hard time getting the Action SetAVTransportURI
to work properly with MetaData. The URI gets passed correctly but the MEtaData somehow is not being passed at all, it is like it is getting deleted somehow.
I tried many other UPnP Controls and they worked fine. I couldn't figure out if my MetaData is not written correctly or not, but after trying what is supposed to be a sure-to-work example it still didn't pass the MetaData. So I resolved to be an issue with this package.
Here is the code I am using, as you can see it is standard :
service.invokeAction("SetAVTransportURI", {
"InstanceID":"0",
"CurrentURI":uri??"",
"CurrentURIMetaData":'<DIDL-Lite xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sec="http://www.sec.co.kr/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/">'
'<item id="0" parentID="-1" restricted="false">'
'<upnp:class>object.item.audioItem.musicTrack</upnp:class>'
'<dc:title>Some Movie Title</dc:title>'
'<dc:creator>John Doe</dc:creator>'
'<dc:genre>Rock</dc:genre>'
'<dc:abstract>Rock Abstract</dc:abstract>'
'<upnp:region>REGION US</upnp:region>'
'<res protocolInfo="http-get:*:audio/mpeg:*">http://192.168.1.229:8090/AT1983/LOST%20LOVE%20IN%20THE%20RAIN.mp3</res>'
'</item>'
'</DIDL-Lite>'
});
I did inspect the final XML body of the request and it did include the correct XML with the data I added in the XML above.
I am using Kodi 18 to be my renderer, it maybe a fault in there but I doubt it. Please tell me what you think and if a solution is possible.
this is the request to add null safety to this package. as we all know the packages are keep on migrating to null safety, we also should migrate to null safety
I was wondering if this package or part of it can get converted to native dart and thus work on all platforms, can get executed from the server-side as well?.
What part of this library requires the flutter framework and what part of it only required native dart code.
Hello, can someone provide documentation or explicit and commented example for utilisation ?
I'm working on an application that has to manage perfume diffusers. The diffuser can connect to wifi. Everything works well when the application is also connected to the same wifi but now I would like users to be able to automate the diffusion from outside or using mobile data. I know that by forwarding a port on the diffuser and using the public address this can be done.
While googling I came across this upnp package but reading the examples I'm not sure how to use it.
E/flutter ( 616): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: SocketException: Failed listing interfaces (OS Error: Listing interfaces is not supported on this platform)
E/flutter ( 616): #0 _NativeSocket.listInterfaces.<anonymous closure> (dart:io-patch/socket_patch.dart:414:9)
E/flutter ( 616): #1 _rootRunUnary (dart:async/zone.dart:1132:38)
E/flutter ( 616): #2 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
E/flutter ( 616): #3 _FutureListener.handleValue (dart:async/future_impl.dart:126:18)
E/flutter ( 616): #4 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:639:45)
E/flutter ( 616): #5 Future._propagateToListeners (dart:async/future_impl.dart:668:32)
E/flutter ( 616): #6 Future._completeWithValue (dart:async/future_impl.dart:483:5)
E/flutter ( 616): #7 Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:513:7)
E/flutter ( 616): #8 _rootRun (dart:async/zone.dart:1124:13)
E/flutter ( 616): #9 _CustomZone.run (dart:async/zone.dart:1021:19)
E/flutter ( 616): #10 _CustomZone.runGuarded (dart:async/zone.dart:923:7)
E/flutter ( 616): #11 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
E/flutter ( 616): #12 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
E/flutter ( 616): #13 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
E/flutter ( 616):
Possibly related issue thread: flutter/flutter#27346
I'm using:
var discover = new upnp.DeviceDiscoverer();
await discover.start(ipv6: false);
discover
.quickDiscoverClients()
It works for me as an internal tester but not Beta testers do not get the Local Network Dialog nor does the Local Network Permission appear in iPhone Settings -> Privacy -> Local Network. Therefore, none of the local network is permitted. How do allow the Local Network Permission, please?
I've already added NSLocalNetworkUsageDescription
in plist file as well as BonjourServices
and still not showing up for my beta users. It would be nice to have this in the description of the plugin.
@tvolkert @kendfinger can you please help?
Here is more detailed question: https://stackoverflow.com/questions/70013254/local-network-permission-dialog-not-showing-up
This is a request to add support for null safety to this package.
See the migration guide for details about enabling null safety.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.