#include <upnpservice.h>
Public Member Functions | |
virtual int | subscribe (Upnp_Subscription_Request *Request)=0 |
virtual int | execute (Upnp_Action_Request *Request)=0 |
Protected Member Functions | |
virtual void | setError (Upnp_Action_Request *Request, int Error) |
int | parseIntegerValue (IN IXML_Document *Document, IN const char *Item, OUT int *Value) |
int | parseStringValue (IN IXML_Document *Document, IN const char *Item, OUT char **Value) |
Protected Attributes | |
UpnpDevice_Handle | mDeviceHandle |
the UPnP device handle of the root device |
This is a service interface implemented by a UPnP service like CDS oder CMS
It comes with some tool functions which are commonly useful for processing an event or action.
virtual int cUpnpService::execute | ( | Upnp_Action_Request * | Request | ) | [pure virtual] |
Executes an action
This executes an action initialized by a control point. The result is stored in the first parameter.
UPNP_E_SUCCESS
, if subscription was okayRequest | Input and output parameters of an action |
Request | Input and output parameters of an action |
Implemented in cConnectionManager, and cContentDirectory.
int cUpnpService::parseIntegerValue | ( | IN IXML_Document * | Document, | |
IN const char * | Item, | |||
OUT int * | Value | |||
) | [protected] |
Parses an integer value
This tool function parses an integer value from a given IXML document. It is searching for the very first occurance of the demanded item.
0
, if parsing was successful<0
, if an error occuredDocument | the document, which is parsed | |
Item | the demanded item | |
Value | the value of the item |
Document | the document, which is parsed | |
Item | the demanded item | |
Value | the value of the item |
int cUpnpService::parseStringValue | ( | IN IXML_Document * | Document, | |
IN const char * | Item, | |||
OUT char ** | Value | |||
) | [protected] |
Parses a string value
This tool function parses a string value from a given IXML document. It is searching for the very first occurance of the demanded item.
0
, if parsing was successful<0
, if an error occuredDocument | the document, which is parsed | |
Item | the demanded item | |
Value | the value of the item |
Document | the document, which is parsed | |
Item | the demanded item | |
Value | the value of the item |
void cUpnpService::setError | ( | Upnp_Action_Request * | Request, | |
int | Error | |||
) | [protected, virtual] |
Sets an error on an action request
This function puts a error message into the action request structure according to its error code
Request | the action request, to set the error for | |
Error | the error code of which the message should be obtained |
Request | the action request, to set the error for | |
Error | the error code of which the message should be obtained |
Reimplemented in cConnectionManager, and cContentDirectory.
virtual int cUpnpService::subscribe | ( | Upnp_Subscription_Request * | Request | ) | [pure virtual] |
Subscribes to an event
This is a callback function to register a new subscriber for an event.
UPNP_E_SUCCESS
, if subscription was okayRequest | Information about the subscription |
Request | Information about the subscription |
Implemented in cConnectionManager, and cContentDirectory.