Additional, optional utility API that can be helpful in writing applications. More...
Functions | |
PUPNP_Api void | UpnpSetMaxJobsTotal (int mjt) |
Sets the maximum number of jobs in the internal thread pool. | |
PUPNP_Api const char * | UpnpGetErrorMessage (int errorcode) |
Converts an SDK error code into a string error message suitable for display. The memory returned from this function should NOT be freed. | |
PUPNP_Api int | UpnpResolveURL (const char *BaseURL, const char *RelURL, char *AbsURL) |
Combines a base URL and a relative URL into a single absolute URL. | |
PUPNP_Api int | UpnpResolveURL2 (const char *BaseURL, const char *RelURL, char **AbsURL) |
Combines a base URL and a relative URL into a single absolute URL. | |
PUPNP_Api IXML_Document * | UpnpMakeAction (const char *ActionName, const char *ServType, int NumArg, const char *Arg,...) |
Creates an action request packet based on its input parameters (status variable name and value pair). | |
PUPNP_Api IXML_Document * | UpnpMakeActionResponse (const char *ActionName, const char *ServType, int NumArg, const char *Arg,...) |
Ceates an action response packet based on its output parameters (status variable name and value pair). | |
PUPNP_Api int | UpnpAddToAction (IXML_Document **ActionDoc, const char *ActionName, const char *ServType, const char *ArgName, const char *ArgVal) |
Adds the argument in the action request. | |
PUPNP_Api int | UpnpAddToActionResponse (IXML_Document **ActionResponse, const char *ActionName, const char *ServType, const char *ArgName, const char *ArgVal) |
Creates an action response packet based on its output parameters (status variable name and value pair). | |
PUPNP_Api IXML_Document * | UpnpCreatePropertySet (int NumArg, const char *Arg,...) |
Creates a property set message packet. | |
PUPNP_Api int | UpnpAddToPropertySet (IXML_Document **PropSet, const char *ArgName, const char *ArgVal) |
Can be used when an application needs to transfer the status of many variables at once. | |
Additional, optional utility API that can be helpful in writing applications.
This additional API can be compiled out in order to save code size in the library. Refer to the file README for details.
PUPNP_Api void UpnpSetMaxJobsTotal | ( | int | mjt | ) |
Sets the maximum number of jobs in the internal thread pool.
This option is intended for server applications to avoid an overflow of jobs when serving e.g. many web requests.
Definition at line 128 of file upnptools.cpp.
PUPNP_Api const char * UpnpGetErrorMessage | ( | int | errorcode | ) |
Converts an SDK error code into a string error message suitable for display. The memory returned from this function should NOT be freed.
[in] | errorcode | The SDK error code to convert. |
Definition at line 116 of file upnptools.cpp.
PUPNP_Api int UpnpResolveURL | ( | const char * | BaseURL, |
const char * | RelURL, | ||
char * | AbsURL | ||
) |
Combines a base URL and a relative URL into a single absolute URL.
The memory for AbsURL needs to be allocated by the caller and must be large enough to hold the BaseURL and RelURL combined.
UPNP_E_SUCCESS
: The operation completed successfully. UPNP_E_INVALID_PARAM
: RelURL is NULL
. UPNP_E_INVALID_URL
: The BaseURL / RelURL combination does not form a valid URL. UPNP_E_OUTOF_MEMORY
: Insufficient resources exist to complete this operation.[in] | BaseURL | The base URL to combine. |
[in] | RelURL | The relative URL to BaseURL. |
[out] | AbsURL | A pointer to a buffer to store the absolute URL. |
Definition at line 135 of file upnptools.cpp.
PUPNP_Api int UpnpResolveURL2 | ( | const char * | BaseURL, |
const char * | RelURL, | ||
char ** | AbsURL | ||
) |
Combines a base URL and a relative URL into a single absolute URL.
The memory for AbsURL becomes owned by the caller and should be freed later.
UPNP_E_SUCCESS
: The operation completed successfully. UPNP_E_INVALID_PARAM
: RelURL is NULL
. UPNP_E_INVALID_URL
: The BaseURL / RelURL combination does not form a valid URL. UPNP_E_OUTOF_MEMORY
: Insufficient resources exist to complete this operation. [in] | BaseURL | The base URL to combine. |
[in] | RelURL | The relative URL to BaseURL. |
[out] | AbsURL | A pointer to a pointer to a buffer to store the absolute URL. Must be freed later by the caller. |
Definition at line 154 of file upnptools.cpp.
PUPNP_Api IXML_Document * UpnpMakeAction | ( | const char * | ActionName, |
const char * | ServType, | ||
int | NumArg, | ||
const char * | Arg, | ||
... | |||
) |
Creates an action request packet based on its input parameters (status variable name and value pair).
Any number of input parameters can be passed to this function but every input variable name should have a matching value argument.
It is a wrapper function that calls makeAction() function to create the action request.
NULL
if the operation failed. [in] | ActionName | Name of the action request or response. |
[in] | ServType | The service type. |
[in] | NumArg | Number of argument pairs to be passed. |
[in] | Arg | pointer to the first argument. |
[in] | ... | Argument list. |
Definition at line 329 of file upnptools.cpp.
PUPNP_Api IXML_Document * UpnpMakeActionResponse | ( | const char * | ActionName, |
const char * | ServType, | ||
int | NumArg, | ||
const char * | Arg, | ||
... | |||
) |
Ceates an action response packet based on its output parameters (status variable name and value pair).
Any number of input parameters can be passed to this function but every output variable name should have a matching value argument.
It is a wrapper function that calls makeAction() function to create the action request.
NULL
if the operation failed. [in] | ActionName | The action name. |
[in] | ServType | The service type.. |
[in] | NumArg | The number of argument pairs passed. |
[in] | Arg | The status variable name and value pair. |
[in] | ... | Other status variable name and value pairs. |
Definition at line 341 of file upnptools.cpp.
PUPNP_Api int UpnpAddToAction | ( | IXML_Document ** | ActionDoc, |
const char * | ActionName, | ||
const char * | ServType, | ||
const char * | ArgName, | ||
const char * | ArgVal | ||
) |
Adds the argument in the action request.
This API is specially suitable inside a loop to add any number input parameters into an existing action. If no action document exists in the beginning then a Upnp_Document variable initialized with NULL
should be passed as a parameter.
It is a wrapper function that calls addToAction() function to add the argument in the action request.
UPNP_E_SUCCESS
: The operation completed successfully. UPNP_E_INVALID_PARAM
: One or more of the parameters are invalid. UPNP_E_OUTOF_MEMORY
: Insufficient resources exist to complete this operation. [in,out] | ActionDoc | A pointer to store the action document node. |
[in] | ActionName | The action name. |
[in] | ServType | The service type. |
[in] | ArgName | The status variable name. |
[in] | ArgVal | The status variable value. |
Definition at line 354 of file upnptools.cpp.
PUPNP_Api int UpnpAddToActionResponse | ( | IXML_Document ** | ActionResponse, |
const char * | ActionName, | ||
const char * | ServType, | ||
const char * | ArgName, | ||
const char * | ArgVal | ||
) |
Creates an action response packet based on its output parameters (status variable name and value pair).
This API is especially suitable inside a loop to add any number of input parameters into an existing action response. If no action document exists in the beginning, a Upnp_Document variable initialized with NULL
should be passed as a parameter.
It is a wrapper function that calls addToAction() function to add the argument in the action request.
UPNP_E_SUCCESS
: The operation completed successfully. UPNP_E_INVALID_PARAM
: One or more of the parameters are invalid. UPNP_E_OUTOF_MEMORY
: Insufficient resources exist to complete this operation. [in,out] | ActionResponse | Pointer to a document to store the action document node. |
[in] | ActionName | The action name. |
[in] | ServType | The service type. |
[in] | ArgName | The status variable name. |
[in] | ArgVal | The status variable value. |
Definition at line 360 of file upnptools.cpp.
PUPNP_Api IXML_Document * UpnpCreatePropertySet | ( | int | NumArg, |
const char * | Arg, | ||
... | |||
) |
Creates a property set message packet.
Any number of input parameters can be passed to this function but every input variable name should have a matching value input argument.
NULL
on failure, or the property-set document node. [in] | NumArg | The number of argument pairs passed. |
[in] | Arg | The status variable name and value pair. |
[in] | ... | Variable sized list with the rest of the parameters. |
Definition at line 367 of file upnptools.cpp.
PUPNP_Api int UpnpAddToPropertySet | ( | IXML_Document ** | PropSet, |
const char * | ArgName, | ||
const char * | ArgVal | ||
) |
Can be used when an application needs to transfer the status of many variables at once.
It can be used (inside a loop) to add some extra status variables into an existing property set. If the application does not already have a property set document, the application should create a variable initialized with NULL
and pass that as the first parameter.
UPNP_E_SUCCESS
: The operation completed successfully. UPNP_E_INVALID_PARAM
: One or more of the parameters are invalid. UPNP_E_OUTOF_MEMORY
: Insufficient resources exist to complete this operation. [in,out] | PropSet | A pointer to the document containing the property set document node. |
[in] | ArgName | The status variable name. |
[in] | ArgVal | The status variable value. |
Definition at line 410 of file upnptools.cpp.