[Kde-hardware-devel] UPnP support in KDE
Armijn Hemel
armijn at uulug.nl
Sun Aug 24 18:13:53 CEST 2008
hi,
[snip]
> > > After a fast look the UPnP specs look like a set of mixes of http,
> > > soap and
> > > xml to handle its different tasks (discovery, control, etc.).
> > HTTP-U (HTTP over UDP) is used for sending announcements to a multicast
> > address and to devices, SOAP is used for sending control packets, HTTP
> > is used for sending subscriptions and unsubscriptions and HTTP is also
> > used for receiving state changes. It is quite a mix of protocols :-)
> So, a typical workflow would be like the following:
> 1 - look for available services;
Yes, by either listening on the network, or explicitely requesting what
is available, or both (since some devices don't answer to searches, very
annoying). Listening on the network is done continuously.
> 2 - select the service you want;
Yup
> 3 - invoke actions on that service;
Yep
> 4 - optional: keep an eye for state changes from that service.
Indeed
> Right?
Totally
> That would translate in the following JOLIE pseudo-code (example):
> // Set the search parameters, like "I want a device supporting the full IGD
> profile"
> searchParams = ...;
> // Give me all the IGD services available. Discoverer is a service that will
> use HTTP-U
> getAvailableServices at Discoverer( searchParams )( result );
> // Use the first one found
> IGD << result.service[0];
Risky :-)
There might be more IGD devices on the network, so we might need to see
how we should handle that.
> // Call actions
> GetTotalBytesSent at IGD()( bytes )
>
> > > As such, it would
> > > be possible to reuse a lot of code from the HTTP, HTTP/XML and
> > > HTTP/SOAP
> > > implementations already present in JOLIE.
> > > Protocol quirk fixes are not new to JOLIE (HTTP hell ...), either.
> >
> > Things I have found so far is that certain devices will only accept SOAP
> > if the XML namespaces are the same as in Windows XP/Vista, that certain
> > parameters have to have content (and where a single space will not
> > suffice), and so on (I am trying to document it).
> >
> > Can you set that stuff in JOLIE?
>
> Yes, JOLIE protocols support a range of parameters (which we can extend
> without problems) in order to deal with such fine tunings. These parameters can
> be applied per-conversation (like "use always this SOAP namespace when i
> communicate with this service") or per-message (like "use this SOAP namespace
> in this particular message exchange).
> The parameters can be read/written both in the JOLIE code or in the protocol
> Java implementation, so what we need to decide is:
>
> 1 - Do we solve these quirks in the protocol implementation?
> 2 - Do we solve these quirks in the JOLIE program?
>
> The first option would mean that the JOLIE programmer using UPnP doesn't need
> to care about said quirks, which is good. Intuitively, it is the way to go,
> considering that in case a programmer would need to use a device unsupported
> by our "protocol quirk fixes" he/she could still set the necessary parameters
> from the JOLIE code.
Sounds good. I think I have found most quirks, that account for 99% of
the devices out there right now, but there will be more quirks, no doubt
about that :-)
armijn
--
-------------------------------------------------------------------------
armijn at uulug.nl | http://www.uulug.nl/ | UULug: Utrecht Linux Users Group
-------------------------------------------------------------------------
More information about the Kde-hardware-devel
mailing list