mUPnP for Objective-C
|
This document describes how to use the mUPnP for Objective-C to create your UPnP™ devices and control points.
UPnP™*[^1] architecture is based on open networking to enable discovery and control of networked devices and services, such as media servers and players at home.
UPnP™ architecture is based on many standard protocols, such as GENA, SSDP, SOAP, HTTPU and HTTP. Therefore you have to understand and implement these protocols to create your devices of UPnP™.
mUPnP for MacOSX is a development package for UPnP™ developers. The mUPnP controls these protocols automatically, and supports to create your control points quickly.
Please see the following site and documents to know about UPnP™ in more detail.
Document | URL |
---|---|
UPnP™ Forum | http://www.upnp.org/ |
Universal Plug and Play Device Architecture | http://www.upnp.org/download/UPnPDA10_20000613.htm |
Universal Plug and Play Vendor\'s Implementation Guide | http://www.upnp.org/download/UPnP_Vendor_Implementation_Guide_Jan2001.htm |
Currently, the framework is based on Objective-C 2.0. Thus, the current framework requires MacOSX v10.5, Leopard, later. In the future, I will support other lower MacOSX and iPhone v2.0.
The framework is distributed as a install package as the following. Using the installer, the framework is installed into \'/Library/Framework/mUPnP.framework\' as default.
The following static structure diagram is related classes of mUPnP to create your control point of UPnP™. The control point has some root devices in the UPnP™ network.
To create a UPnP™ control point, create a instance of CGUpnpControlPoint class. The new instance is activated automatically using start (CGUpnpControlPoint). Use search (CGUpnpControlPoint) or searchWithST to find the devices in the local network.
Use CGUpnpControlPoint:devices to get the all root devices which the control point found. The method returns a NSArray object which has the devices as instances of CGUpnpDevice.
The control point can send action or query control messages to the discovered devices. To send the action control message, use CGUpnpAction:setArgumentValue:forName and CGUpnpAction:post. You should set the action values to the all input arguments, and the output argument values is ignored if you set. The following sample posts a action control request that sets a new time, and output the response result.
Similarly, to send the query control message, use query (CGUpnpStateVariable). The following sample posts a query control request, and output the return value.