UPnPsdk 0.1
Universal Plug and Play +, Software Development Kit
 
Loading...
Searching...
No Matches
API.hpp File Reference

UPnPsdk API. More...

+ Include dependency graph for API.hpp:

Go to the source code of this file.

Macros

#define LINE_SIZE   (size_t)180
 
#define NAME_SIZE   (size_t)256
 
#define MNFT_NAME_SIZE   64
 
#define MODL_NAME_SIZE   32
 
#define SERL_NUMR_SIZE   64
 
#define MODL_DESC_SIZE   64
 
#define UPNP_INFINITE   -1
 
#define UPNP_USING_CHUNKED   -3
 
#define UPNP_UNTIL_CLOSE   -4
 
Error codes

The functions in the SDK API can return a variety of error codes to describe problems encountered during execution. This section lists the error codes and provides a brief description of what each error code means. Refer to the documentation for each function for a description of what an error code means in that context.

#define UPNP_E_SUCCESS   0
 The operation completed successfully.
 
#define UPNP_E_INVALID_HANDLE   -100
 The handle passed to a function is not a recognized as a valid handle.
 
#define UPNP_E_INVALID_PARAM   -101
 One or more of the parameters passed to the function is not valid.
 
#define UPNP_E_OUTOF_HANDLE   -102
 The SDK does not have any more space for additional handles.
 
#define UPNP_E_OUTOF_CONTEXT   -103
 The operation completed successfully.
 
#define UPNP_E_OUTOF_MEMORY   -104
 Not enough resources are currently available to complete the operation.
 
#define UPNP_E_INIT   -105
 The SDK has already been initialized.
 
#define UPNP_E_BUFFER_TOO_SMALL   -106
 The operation completed successfully.
 
#define UPNP_E_INVALID_DESC   -107
 The description document passed to UpnpRegisterRootDevice, UpnpRegisterRootDevice2 UpnpRegisterRootDevice3 or UpnpRegisterRootDevice4 is invalid.
 
#define UPNP_E_INVALID_URL   -108
 An URL passed into the function is invalid.
 
#define UPNP_E_INVALID_SID   -109
 The operation completed successfully.
 
#define UPNP_E_INVALID_DEVICE   -110
 The operation completed successfully.
 
#define UPNP_E_INVALID_SERVICE   -111
 The device ID/service ID pair does not refer to a valid service.
 
#define UPNP_E_BAD_RESPONSE   -113
 The response received from the remote side of a connection is not correct for the protocol.
 
#define UPNP_E_BAD_REQUEST   -114
 The operation completed successfully.
 
#define UPNP_E_INVALID_ACTION   -115
 The SOAP action message is invalid.
 
#define UPNP_E_FINISH   -116
 UpnpInit2 has not been called, or UpnpFinish has already been called.
 
#define UPNP_E_INIT_FAILED   -117
 UpnpInit2 cannot complete.
 
#define UPNP_E_URL_TOO_BIG   -118
 The URL passed into a function is too long.
 
#define UPNP_E_BAD_HTTPMSG   -119
 The HTTP message contains invalid message headers.
 
#define UPNP_E_ALREADY_REGISTERED   -120
 A client or a device is already registered.
 
#define UPNP_E_INVALID_INTERFACE   -121
 The interface provided to UpnpInit2 is unknown or does not have a valid IPv4 or IPv6 address configured.
 
#define UPNP_E_NETWORK_ERROR   -200
 A network error occurred.
 
#define UPNP_E_SOCKET_WRITE   -201
 An error happened while writing to a socket.
 
#define UPNP_E_SOCKET_READ   -202
 An error happened while reading from a socket.
 
#define UPNP_E_SOCKET_BIND   -203
 The SDK had a problem binding a socket to a network interface.
 
#define UPNP_E_SOCKET_CONNECT   -204
 The SDK had a problem connecting to a remote host.
 
#define UPNP_E_OUTOF_SOCKET   -205
 The SDK cannot create any more sockets.
 
#define UPNP_E_LISTEN   -206
 The SDK had a problem setting the socket to listen for incoming connections.
 
#define UPNP_E_TIMEDOUT   -207
 Too much time elapsed before the required number of bytes were sent or received over a socket.
 
#define UPNP_E_SOCKET_ERROR   -208
 Generic socket error code for conditions not covered by other error codes.
 
#define UPNP_E_FILE_WRITE_ERROR   -209
 The operation completed successfully.
 
#define UPNP_E_CANCELED   -210
 The operation was canceled.
 
#define UPNP_E_SOCKET_ACCEPT   -211
 The SDK had a problem accepting a network connection.
 
#define UPNP_E_EVENT_PROTOCOL   -300
 The operation completed successfully.
 
#define UPNP_E_SUBSCRIBE_UNACCEPTED   -301
 A subscription request was rejected from the remote side.
 
#define UPNP_E_UNSUBSCRIBE_UNACCEPTED   -302
 An unsubscribe request was rejected from the remote side.
 
#define UPNP_E_NOTIFY_UNACCEPTED   -303
 The remote host did not accept the notify sent from the local device.
 
#define UPNP_E_INVALID_ARGUMENT   -501
 One or more of the parameters passed to a function is invalid.
 
#define UPNP_E_FILE_NOT_FOUND   -502
 The filename passed to one of the device registration functions was not found or was not accessible.
 
#define UPNP_E_FILE_READ_ERROR   -503
 An error happened while reading a file.
 
#define UPNP_E_EXT_NOT_XML   -504
 The file name of the description document passed to UpnpRegisterRootDevice2 does not end in ".xml".
 
#define UPNP_E_NO_WEB_SERVER   -505
 The operation completed successfully.
 
#define UPNP_E_OUTOF_BOUNDS   -506
 The operation completed successfully.
 
#define UPNP_E_NOT_FOUND   -507
 The response to a SOAP request did not contain the required XML constructs.
 
#define UPNP_E_INTERNAL_ERROR   -911
 Generic error code for internal conditions not covered by other error codes.
 
#define UPNP_SOAP_E_INVALID_ACTION   401
 The operation completed successfully.
 
#define UPNP_SOAP_E_INVALID_ARGS   402
 The operation completed successfully.
 
#define UPNP_SOAP_E_OUT_OF_SYNC   403
 The operation completed successfully.
 
#define UPNP_SOAP_E_INVALID_VAR   404
 The operation completed successfully.
 
#define UPNP_SOAP_E_ACTION_FAILED   501
 The operation completed successfully.
 

Functions

PUPNP_Api int UpnpInit2 (const char *IfName, unsigned short DestPort)
 Initializes the Linux SDK for UPnP Devices.
 
PUPNP_Api int UpnpFinish (void)
 Terminates the Linux SDK for UPnP Devices.
 
PUPNP_Api in_port_t UpnpGetServerPort (void)
 Returns the internal server IPv4 UPnP listening port.
 
PUPNP_Api unsigned short UpnpGetServerPort6 (void)
 Returns the internal server IPv6 link-local (LLA) UPnP listening port.
 
PUPNP_Api unsigned short UpnpGetServerUlaGuaPort6 (void)
 Returns the internal server IPv6 ULA or GUA UPnP listening port.
 
PUPNP_Api char * UpnpGetServerIpAddress (void)
 Returns the local IPv4 listening ip address.
 
PUPNP_Api char * UpnpGetServerIp6Address (void)
 Returns the IPv6 link-local listening ip address.
 
PUPNP_Api char * UpnpGetServerUlaGuaIp6Address (void)
 Returns the IPv6 unique-local or globally-unique listening ip address.
 
PUPNP_Api int UpnpRegisterRootDevice (const char *const DescUrl, const Upnp_FunPtr Fun, const void *const Cookie, UpnpDevice_Handle *const Hnd)
 Registers one root- or logical-device object with the UPnP Library to get a handle for it.
 
PUPNP_Api int UpnpRegisterRootDevice2 (const Upnp_DescType descriptionType, const char *const description_const, const size_t bufferLen, const int config_baseURL, const Upnp_FunPtr Fun, const void *const Cookie, UpnpDevice_Handle *const Hnd)
 Registers one root- or logical-device object with the UPnP Library with additional description and get a handle for it.
 
PUPNP_Api int UpnpRegisterRootDevice3 (const char *const DescUrl, const Upnp_FunPtr Fun, const void *const Cookie, UpnpDevice_Handle *const Hnd, const int AddressFamily)
 Registers one UPnP device object for a specific address family with the UPnP library and get a handle for it.
 
PUPNP_Api int UpnpRegisterRootDevice4 (const char *const DescUrl, const Upnp_FunPtr Fun, const void *const Cookie, UpnpDevice_Handle *const Hnd, const int AddressFamily, const char *const LowerDescUrl)
 Same as UpnpRegisterRootDevice3() with additional argument to specify a description URL.
 
PUPNP_Api int UpnpUnRegisterRootDevice (UpnpDevice_Handle Hnd)
 Unregisters a root device registered with UpnpRegisterRootDevice(), UpnpRegisterRootDevice2(), UpnpRegisterRootDevice3(), UpnpRegisterRootDevice4.
 
PUPNP_Api int UpnpUnRegisterRootDeviceLowPower (UpnpDevice_Handle Hnd, int PowerState, int SleepPeriod, int RegistrationState)
 Unregisters a root device registered with UpnpRegisterRootDevice(), UpnpRegisterRootDevice2(), UpnpRegisterRootDevice3(), UpnpRegisterRootDevice4 for Low Power.
 
PUPNP_Api int UpnpRegisterClient (Upnp_FunPtr Fun, const void *Cookie, UpnpClient_Handle *Hnd)
 Registers a control point application with the UPnP Library.
 
PUPNP_Api int UpnpUnRegisterClient (UpnpClient_Handle Hnd)
 Unregisters a control point application, unsubscribing all active subscriptions.
 
PUPNP_Api int UpnpSetContentLength (UpnpClient_Handle Hnd, size_t contentLength)
 Sets the content-length that the SDK will process on an incoming SOAP requests or responses.
 
PUPNP_Api int UpnpSetMaxContentLength (size_t contentLength)
 Sets the maximum content-length that the SDK will process on an incoming SOAP requests or responses.
 
PUPNP_Api int UpnpSearchAsync (UpnpClient_Handle Hnd, int Mx, const char *Target_const, const void *Cookie_const)
 Searches for devices matching the given search target.
 
PUPNP_Api int UpnpSendAdvertisement (UpnpDevice_Handle Hnd, int Exp)
 Sends out the discovery announcements for all devices and services contained within one root device.
 
PUPNP_Api int UpnpSendAdvertisementLowPower (UpnpDevice_Handle Hnd, int Exp, int PowerState, int SleepPeriod, int RegistrationState)
 Sends out the discovery announcements for all devices and services contained within one root device.
 
PUPNP_Api int UpnpGetServiceVarStatus (UpnpClient_Handle Hnd, const char *ActionURL_const, const char *VarName_const, DOMString *StVar)
 Queries the state of a state variable of a service on another device.
 
PUPNP_Api int UpnpGetServiceVarStatusAsync (UpnpClient_Handle Hnd, const char *ActionURL_const, const char *VarName_const, Upnp_FunPtr Fun, const void *Cookie_const)
 Queries the state of a variable of a service, generating a callback when the operation is complete.
 
PUPNP_Api int UpnpSendAction (UpnpClient_Handle Hnd, const char *ActionURL_const, const char *ServiceType_const, const char *DevUDN_const, IXML_Document *Action, IXML_Document **RespNodePtr)
 Sends a message to change a state variable in a service.
 
PUPNP_Api int UpnpSendActionEx (UpnpClient_Handle Hnd, const char *ActionURL_const, const char *ServiceType_const, const char *DevUDN_const, IXML_Document *Header, IXML_Document *Action, IXML_Document **RespNodePtr)
 Sends a message to change a state variable in a service.
 
PUPNP_Api int UpnpSendActionAsync (UpnpClient_Handle Hnd, const char *ActionURL_const, const char *ServiceType_const, const char *DevUDN_const, IXML_Document *Act, Upnp_FunPtr Fun, const void *Cookie_const)
 Sends a message to change a state variable in a service, generating a callback when the operation is complete.
 
PUPNP_Api int UpnpSendActionExAsync (UpnpClient_Handle Hnd, const char *ActionURL_const, const char *ServiceType_const, const char *DevUDN_const, IXML_Document *Header, IXML_Document *Act, Upnp_FunPtr Fun, const void *Cookie_const)
 Sends a message to change a state variable in a service, generating a callback when the operation is complete.
 
PUPNP_Api int UpnpAcceptSubscription (UpnpDevice_Handle Hnd, const char *DevID_const, const char *ServName_const, const char **VarName_const, const char **NewVal_const, int cVariables, const Upnp_SID SubsId)
 Accepts a subscription request and sends out the current state of the eventable variables for a service.
 
PUPNP_Api int UpnpAcceptSubscriptionExt (UpnpDevice_Handle Hnd, const char *DevID_const, const char *ServName_const, IXML_Document *PropSet, const Upnp_SID SubsId)
 Similar to UpnpAcceptSubscription() except that it takes a DOM document for the variables to event rather than an array of strings.
 
PUPNP_Api int UpnpNotify (UpnpDevice_Handle Hnd, const char *DevID_const, const char *ServName_const, const char **VarName_const, const char **NewVal_const, int cVariables)
 Sends out an event change notification to all control points subscribed to a particular service.
 
PUPNP_Api int UpnpNotifyExt (UpnpDevice_Handle Hnd, const char *DevID_const, const char *ServName_const, IXML_Document *PropSet)
 Similar to UpnpNotify() except that it takes a DOM document for the event rather than an array of strings.
 
PUPNP_Api int UpnpRenewSubscription (UpnpClient_Handle Hnd, int *TimeOut, const Upnp_SID SubsId)
 Renews a subscription that is about to expire.
 
PUPNP_Api int UpnpRenewSubscriptionAsync (UpnpClient_Handle Hnd, int TimeOut, Upnp_SID SubsId, Upnp_FunPtr Fun, const void *Cookie_const)
 Renews a subscription that is about to expire, generating a callback when the operation is complete.
 
PUPNP_Api int UpnpSetMaxSubscriptions (UpnpDevice_Handle Hnd, int MaxSubscriptions)
 Sets the maximum number of subscriptions accepted per service.
 
PUPNP_Api int UpnpSetMaxSubscriptionTimeOut (UpnpDevice_Handle Hnd, int MaxSubscriptionTimeOut)
 Sets the maximum time-out accepted for a subscription request or renewal.
 
PUPNP_Api int UpnpSubscribe (UpnpClient_Handle Hnd, const char *EvtUrl_const, int *TimeOut, Upnp_SID SubsId)
 Registers a control point to receive event notifications from a UPnP device.
 
PUPNP_Api int UpnpSubscribeAsync (UpnpClient_Handle Hnd, const char *EvtUrl_const, int TimeOut, Upnp_FunPtr Fun, const void *Cookie_const)
 Performs the same operation as UpnpSubscribe(), but returns immediately and calls the registered callback function when the operation is complete.
 
PUPNP_Api int UpnpUnSubscribe (UpnpClient_Handle Hnd, const Upnp_SID SubsId)
 Removes the subscription of a control point from a service previously subscribed to using UpnpSubscribe() or UpnpSubscribeAsync().
 
PUPNP_Api int UpnpUnSubscribeAsync (UpnpClient_Handle Hnd, Upnp_SID SubsId, Upnp_FunPtr Fun, const void *Cookie_const)
 Removes a subscription of a control point from a service previously subscribed to using UpnpSubscribe() or UpnpSubscribeAsync(), generating a callback when the operation is complete.
 

Constants and Types

enum  UpnpOpenFileMode { UPNP_READ , UPNP_WRITE }
 Represents the different types of searches that can be performed using the SDK for UPnP Devices API. More...
 
enum  Upnp_SType_e { UPNP_S_ALL , UPNP_S_ROOT , UPNP_S_DEVICE , UPNP_S_SERVICE }
 Represents the different types of searches that can be performed using the SDK for UPnP Devices API. More...
 
enum  Upnp_DescType_e { UPNPREG_URL_DESC , UPNPREG_FILENAME_DESC , UPNPREG_BUF_DESC }
 Specifies the type of description in UpnpRegisterRootDevice2. More...
 
typedef int UpnpClient_Handle
 Returned when a control point application registers with UpnpRegisterClient().
 
typedef int UpnpDevice_Handle
 Returned when a device application registers with UpnpRegisterRootDevice(),UpnpRegisterRootDevice2(), UpnpRegisterRootDevice3() or UpnpRegisterRootDevice4().
 
typedef char Upnp_SID[44]
 Holds the subscription identifier for a subscription between a client and a device.
 
typedef enum Upnp_SType_e Upnp_SType
 Represents the different types of searches that can be performed using the SDK for UPnP Devices API.
 
typedef enum Upnp_DescType_e Upnp_DescType
 Represents the different types of searches that can be performed using the SDK for UPnP Devices API.
 
enum  Upnp_HttpMethod {
  UPNP_HTTPMETHOD_PUT , UPNP_HTTPMETHOD_DELETE , UPNP_HTTPMETHOD_GET , UPNP_HTTPMETHOD_HEAD ,
  UPNP_HTTPMETHOD_POST
}
 Different HTTP methods. More...
 
PUPNP_Api int UpnpDownloadUrlItem (const char *url, char **outBuf, char *contentType)
 Downloads a file specified in a URL.
 
PUPNP_Api int UpnpOpenHttpGet (const char *url, void **handle, char **contentType, int *contentLength, int *httpStatus, int timeout)
 Gets a file specified in a URL.
 
PUPNP_Api int UpnpOpenHttpGetProxy (const char *url, const char *proxy_str, void **handle, char **contentType, int *contentLength, int *httpStatus, int timeout)
 Gets a file specified in a URL through the specified proxy.
 
PUPNP_Api int UpnpOpenHttpGetEx (const char *url_str, void **Handle, char **contentType, int *contentLength, int *httpStatus, int lowRange, int highRange, int timeout)
 Gets specified number of bytes from a file specified in the URL.
 
PUPNP_Api int UpnpReadHttpGet (void *Handle, char *buf, size_t *size, int timeout)
 Gets specified number of bytes from a file specified in a URL.
 
PUPNP_Api int UpnpHttpGetProgress (void *Handle, size_t *length, size_t *total)
 Retrieve progress information of a http-get transfer.
 
PUPNP_Api int UpnpCancelHttpGet (void *Handle)
 Set the cancel flag of the handle parameter.
 
PUPNP_Api int UpnpCloseHttpGet (void *Handle)
 Closes the connection and frees memory that was allocated for the handle parameter.
 
PUPNP_Api int UpnpOpenHttpPost (const char *url, void **handle, const char *contentType, int contentLength, int timeout)
 Makes an HTTP POST request message, opens a connection to the server and sends the POST request to the server if the connection to the server succeeds.
 
PUPNP_Api int UpnpWriteHttpPost (void *handle, char *buf, size_t *size, int timeout)
 Sends a request to a server to copy the contents of a buffer to the URI specified in the UpnpOpenHttpPost() call.
 
PUPNP_Api int UpnpCloseHttpPost (void *handle, int *httpStatus, int timeout)
 Sends and receives any pending data, closes the connection with the server, and frees memory allocated during the UpnpOpenHttpPost() call.
 
PUPNP_Api int UpnpOpenHttpConnection (const char *url, void **handle, int timeout)
 Opens a connection to the server.
 
PUPNP_Api int UpnpMakeHttpRequest (Upnp_HttpMethod method, const char *url, void *handle, UpnpString *headers, const char *contentType, int contentLength, int timeout)
 Makes a HTTP request using a connection previously created by UpnpOpenHttpConnection().
 
PUPNP_Api int UpnpWriteHttpRequest (void *handle, char *buf, size_t *size, int timeout)
 Writes the content of a HTTP request initiated by a UpnpMakeHttpRequest() call. The end of the content should be indicated by a call to UpnpEndHttpRequest().
 
PUPNP_Api int UpnpEndHttpRequest (void *handle, int timeout)
 Indicates the end of a HTTP request previously made by UpnpMakeHttpRequest().
 
PUPNP_Api int UpnpGetHttpResponse (void *handle, UpnpString *headers, char **contentType, int *contentLength, int *httpStatus, int timeout)
 Gets the response from the server using a connection previously created by UpnpOpenHttpConnection().
 
PUPNP_Api int UpnpReadHttpResponse (void *handle, char *buf, size_t *size, int timeout)
 Reads the content of a response using a connection previously created by UpnpOpenHttpConnection().
 
PUPNP_Api int UpnpCloseHttpConnection (void *handle)
 Closes the connection created with UpnpOpenHttpConnection() and frees any memory associated with the connection.
 
PUPNP_Api int UpnpDownloadXmlDoc (const char *url, IXML_Document **xmlDoc)
 Downloads an XML document specified in a URL.
 
typedef void * UpnpWebFileHandle
 The type of handle returned by the web server for open requests.
 
typedef int(* VDCallback_GetInfo) (const char *filename, UpnpFileInfo *info, const void *cookie, const void **request_cookie)
 Get-info callback function prototype.
 
typedef UpnpWebFileHandle(* VDCallback_Open) (const char *filename, enum UpnpOpenFileMode Mode, const void *cookie, const void *request_cookie)
 Open callback function prototype.
 
typedef int(* VDCallback_Read) (UpnpWebFileHandle fileHnd, char *buf, size_t buflen, const void *cookie, const void *request_cookie)
 Read callback function prototype.
 
typedef int(* VDCallback_Write) (UpnpWebFileHandle fileHnd, char *buf, size_t buflen, const void *cookie, const void *request_cookie)
 Write callback function prototype.
 
typedef int(* VDCallback_Seek) (UpnpWebFileHandle fileHnd, off_t offset, int origin, const void *cookie, const void *request_cookie)
 Seek callback function prototype.
 
typedef int(* VDCallback_Close) (UpnpWebFileHandle fileHnd, const void *cookie, const void *request_cookie)
 Close callback function prototype.
 
typedef int(* WebCallback_HostValidate) (const char *hostname, void *cookie)
 Callback for validating HTTP requests HOST header values.
 
PUPNP_Api int UpnpSetWebServerRootDir (const char *rootDir)
 Sets the document root directory for the internal web server.
 
PUPNP_Api int UpnpVirtualDir_set_GetInfoCallback (VDCallback_GetInfo callback)
 Sets the get_info callback function to be used to access a web directory.
 
PUPNP_Api int UpnpVirtualDir_set_OpenCallback (VDCallback_Open callback)
 Sets the open callback function to be used to access a web directory.
 
PUPNP_Api int UpnpVirtualDir_set_ReadCallback (VDCallback_Read callback)
 Sets the read callback function to be used to access a web directory.
 
PUPNP_Api int UpnpVirtualDir_set_WriteCallback (VDCallback_Write callback)
 Sets the write callback function to be used to access a web directory.
 
PUPNP_Api int UpnpVirtualDir_set_SeekCallback (VDCallback_Seek callback)
 Sets the seek callback function to be used to access a web directory.
 
PUPNP_Api int UpnpVirtualDir_set_CloseCallback (VDCallback_Close callback)
 Sets the close callback function to be used to access a web directory.
 
PUPNP_Api int UpnpEnableWebserver (int enable)
 Enables or disables the webserver.
 
PUPNP_Api int UpnpIsWebserverEnabled (void)
 Returns the status of the webserver.
 
PUPNP_Api void UpnpSetHostValidateCallback (WebCallback_HostValidate callback, void *cookie)
 Set callback for validating HTTP requests HOST header values.
 
PUPNP_Api void UpnpSetAllowLiteralHostRedirection (int enable)
 Enable or disable literal IP redirection.
 
PUPNP_Api int UpnpSetWebServerCorsString (const char *corsString)
 Assign the Access-Control-Allow-Origin specfied by the input const char* cors_string parameter to the global CORS string.
 
PUPNP_Api int UpnpAddVirtualDir (const char *newDirName, const void *cookie, const void **oldcookie)
 Adds a web directory mapping.
 
PUPNP_Api int UpnpRemoveVirtualDir (const char *dirName)
 Removes a web directory mapping made with UpnpAddVirtualDir().
 
PUPNP_Api void UpnpRemoveAllVirtualDirs (void)
 Removes all web directory mappings.
 

Detailed Description

UPnPsdk API.

Definition in file API.hpp.

Macro Definition Documentation

◆ LINE_SIZE

#define LINE_SIZE   (size_t)180

Program constant

Definition at line 45 of file API.hpp.

◆ NAME_SIZE

#define NAME_SIZE   (size_t)256

Program constant

Definition at line 46 of file API.hpp.

◆ MNFT_NAME_SIZE

#define MNFT_NAME_SIZE   64

Program constant

Definition at line 47 of file API.hpp.

◆ MODL_NAME_SIZE

#define MODL_NAME_SIZE   32

Program constant

Definition at line 48 of file API.hpp.

◆ SERL_NUMR_SIZE

#define SERL_NUMR_SIZE   64

Program constant

Definition at line 49 of file API.hpp.

◆ MODL_DESC_SIZE

#define MODL_DESC_SIZE   64

Program constant

Definition at line 50 of file API.hpp.

◆ UPNP_INFINITE

#define UPNP_INFINITE   -1

Program constant

Definition at line 51 of file API.hpp.

◆ UPNP_USING_CHUNKED

#define UPNP_USING_CHUNKED   -3

Program constant

Definition at line 52 of file API.hpp.

◆ UPNP_UNTIL_CLOSE

#define UPNP_UNTIL_CLOSE   -4

Program constant

Definition at line 53 of file API.hpp.

◆ UPNP_E_SUCCESS

#define UPNP_E_SUCCESS   0

The operation completed successfully.

For asynchronous functions, this only means that the packet generated by the operation was successfully transmitted on the network. The result of the entire operation comes as part of the callback for that operation.

Definition at line 75 of file API.hpp.

◆ UPNP_E_INVALID_HANDLE

#define UPNP_E_INVALID_HANDLE   -100

The handle passed to a function is not a recognized as a valid handle.

Definition at line 80 of file API.hpp.

◆ UPNP_E_INVALID_PARAM

#define UPNP_E_INVALID_PARAM   -101

One or more of the parameters passed to the function is not valid.

Refer to the documentation for each function for more information on the valid ranges of the parameters.

Definition at line 88 of file API.hpp.

◆ UPNP_E_OUTOF_HANDLE

#define UPNP_E_OUTOF_HANDLE   -102

The SDK does not have any more space for additional handles.

The SDK allocates space for only a few handles in order to conserve memory.

Definition at line 95 of file API.hpp.

◆ UPNP_E_OUTOF_CONTEXT

#define UPNP_E_OUTOF_CONTEXT   -103

The operation completed successfully.

For asynchronous functions, this only means that the packet generated by the operation was successfully transmitted on the network. The result of the entire operation comes as part of the callback for that operation.

Definition at line 97 of file API.hpp.

◆ UPNP_E_OUTOF_MEMORY

#define UPNP_E_OUTOF_MEMORY   -104

Not enough resources are currently available to complete the operation.

Most operations require some free memory in order to complete their work.

Definition at line 105 of file API.hpp.

◆ UPNP_E_INIT

#define UPNP_E_INIT   -105

The SDK has already been initialized.

The SDK needs to be initialied only once per process. Any additional initialization attempts simply return this error with no other ill effects.

Definition at line 113 of file API.hpp.

◆ UPNP_E_BUFFER_TOO_SMALL

#define UPNP_E_BUFFER_TOO_SMALL   -106

The operation completed successfully.

For asynchronous functions, this only means that the packet generated by the operation was successfully transmitted on the network. The result of the entire operation comes as part of the callback for that operation.

Definition at line 115 of file API.hpp.

◆ UPNP_E_INVALID_DESC

#define UPNP_E_INVALID_DESC   -107

The description document passed to UpnpRegisterRootDevice, UpnpRegisterRootDevice2 UpnpRegisterRootDevice3 or UpnpRegisterRootDevice4 is invalid.

Definition at line 122 of file API.hpp.

◆ UPNP_E_INVALID_URL

#define UPNP_E_INVALID_URL   -108

An URL passed into the function is invalid.

The actual cause is function specific, but in general, the URL itself might be malformed (e.g. have invalid characters in it) or the host might be unreachable.

Definition at line 131 of file API.hpp.

◆ UPNP_E_INVALID_SID

#define UPNP_E_INVALID_SID   -109

The operation completed successfully.

For asynchronous functions, this only means that the packet generated by the operation was successfully transmitted on the network. The result of the entire operation comes as part of the callback for that operation.

Definition at line 133 of file API.hpp.

◆ UPNP_E_INVALID_DEVICE

#define UPNP_E_INVALID_DEVICE   -110

The operation completed successfully.

For asynchronous functions, this only means that the packet generated by the operation was successfully transmitted on the network. The result of the entire operation comes as part of the callback for that operation.

Definition at line 135 of file API.hpp.

◆ UPNP_E_INVALID_SERVICE

#define UPNP_E_INVALID_SERVICE   -111

The device ID/service ID pair does not refer to a valid service.

Returned only by UpnpNotify, UpnpNotifyExt, UpnpAcceptSubscription, and UpnpAcceptSubscriptionExt.

Definition at line 143 of file API.hpp.

◆ UPNP_E_BAD_RESPONSE

#define UPNP_E_BAD_RESPONSE   -113

The response received from the remote side of a connection is not correct for the protocol.

This applies to the GENA, SOAP, and HTTP protocols.

Definition at line 151 of file API.hpp.

◆ UPNP_E_BAD_REQUEST

#define UPNP_E_BAD_REQUEST   -114

The operation completed successfully.

For asynchronous functions, this only means that the packet generated by the operation was successfully transmitted on the network. The result of the entire operation comes as part of the callback for that operation.

Definition at line 153 of file API.hpp.

◆ UPNP_E_INVALID_ACTION

#define UPNP_E_INVALID_ACTION   -115

The SOAP action message is invalid.

This can be because the DOM document passed to the function was malformed or the action message is not correct for the given action.

Definition at line 161 of file API.hpp.

◆ UPNP_E_FINISH

#define UPNP_E_FINISH   -116

UpnpInit2 has not been called, or UpnpFinish has already been called.

None of the API functions operate until UpnpInit2 successfully completes.

Definition at line 169 of file API.hpp.

◆ UPNP_E_INIT_FAILED

#define UPNP_E_INIT_FAILED   -117

UpnpInit2 cannot complete.

The typical reason is failure to allocate sufficient resources.

Definition at line 176 of file API.hpp.

◆ UPNP_E_URL_TOO_BIG

#define UPNP_E_URL_TOO_BIG   -118

The URL passed into a function is too long.

The SDK limits URLs to 180 characters in length.

Definition at line 183 of file API.hpp.

◆ UPNP_E_BAD_HTTPMSG

#define UPNP_E_BAD_HTTPMSG   -119

The HTTP message contains invalid message headers.

The error always refers to the HTTP message header received from the remote host. The main areas where this occurs are in SOAP control messages (e.g. UpnpSendAction), GENA subscription message (e.g. UpnpSubscribe), GENA event notifications (e.g. UpnpNotify), and HTTP transfers (e.g. UpnpDownloadXmlDoc).

Definition at line 194 of file API.hpp.

◆ UPNP_E_ALREADY_REGISTERED

#define UPNP_E_ALREADY_REGISTERED   -120

A client or a device is already registered.

The SDK currently has a limit of one registered client and one registered device per process.

Definition at line 202 of file API.hpp.

◆ UPNP_E_INVALID_INTERFACE

#define UPNP_E_INVALID_INTERFACE   -121

The interface provided to UpnpInit2 is unknown or does not have a valid IPv4 or IPv6 address configured.

Definition at line 208 of file API.hpp.

◆ UPNP_E_NETWORK_ERROR

#define UPNP_E_NETWORK_ERROR   -200

A network error occurred.

It is the generic error code for network problems that are not covered under one of the more specific error codes. The typical meaning is the SDK failed to read the local IP address or had problems configuring one of the sockets.

Definition at line 217 of file API.hpp.

◆ UPNP_E_SOCKET_WRITE

#define UPNP_E_SOCKET_WRITE   -201

An error happened while writing to a socket.

This occurs in any function that makes network connections, such as discovery (e.g. UpnpSearchAsync or UpnpSendAdvertisement), control (e.g. UpnpSendAction), eventing (e.g. UpnpNotify), and HTTP functions (e.g. UpnpDownloadXmlDoc).

Definition at line 227 of file API.hpp.

◆ UPNP_E_SOCKET_READ

#define UPNP_E_SOCKET_READ   -202

An error happened while reading from a socket.

This occurs in any function that makes network connections, such as discovery (e.g. UpnpSearchAsync or UpnpSendAdvertisement), control (e.g. UpnpSendAction), eventing (e.g. UpnpNotify), and HTTP functions (e.g. UpnpDownloadXmlDoc).

Definition at line 237 of file API.hpp.

◆ UPNP_E_SOCKET_BIND

#define UPNP_E_SOCKET_BIND   -203

The SDK had a problem binding a socket to a network interface.

This occurs in any function that makes network connections, such as discovery (e.g. UpnpSearchAsync or UpnpSendAdvertisement), control (e.g. UpnpSendAction), eventing (e.g. UpnpNotify), and HTTP functions (e.g. UpnpDownloadXmlDoc).

Definition at line 247 of file API.hpp.

◆ UPNP_E_SOCKET_CONNECT

#define UPNP_E_SOCKET_CONNECT   -204

The SDK had a problem connecting to a remote host.

This occurs in any function that makes network connections, such as discovery (e.g. UpnpSearchAsync or UpnpSendAdvertisement), control (e.g. UpnpSendAction), eventing (e.g. UpnpNotify), and HTTP functions (e.g. UpnpDownloadXmlDoc).

Definition at line 257 of file API.hpp.

◆ UPNP_E_OUTOF_SOCKET

#define UPNP_E_OUTOF_SOCKET   -205

The SDK cannot create any more sockets.

This occurs in any function that makes network connections, such as discovery (e.g. UpnpSearchAsync or UpnpSendAdvertisement), control (e.g. UpnpSendAction), eventing (e.g. UpnpNotify), and HTTP functions (e.g. UpnpDownloadXmlDoc).

Definition at line 267 of file API.hpp.

◆ UPNP_E_LISTEN

#define UPNP_E_LISTEN   -206

The SDK had a problem setting the socket to listen for incoming connections.

This error only happens during initialization (i.e. UpnpInit2).

Definition at line 275 of file API.hpp.

◆ UPNP_E_TIMEDOUT

#define UPNP_E_TIMEDOUT   -207

Too much time elapsed before the required number of bytes were sent or received over a socket.

This error can be returned by any function that performs network operations.

Definition at line 283 of file API.hpp.

◆ UPNP_E_SOCKET_ERROR

#define UPNP_E_SOCKET_ERROR   -208

Generic socket error code for conditions not covered by other error codes.

This error can be returned by any function that performs network operations.

Definition at line 291 of file API.hpp.

◆ UPNP_E_FILE_WRITE_ERROR

#define UPNP_E_FILE_WRITE_ERROR   -209

The operation completed successfully.

For asynchronous functions, this only means that the packet generated by the operation was successfully transmitted on the network. The result of the entire operation comes as part of the callback for that operation.

Definition at line 293 of file API.hpp.

◆ UPNP_E_CANCELED

#define UPNP_E_CANCELED   -210

The operation was canceled.

This error can be returned by any function that allows for external cancelation.

Definition at line 300 of file API.hpp.

◆ UPNP_E_SOCKET_ACCEPT

#define UPNP_E_SOCKET_ACCEPT   -211

The SDK had a problem accepting a network connection.

This occurs in any function that makes network connections, such as discovery (e.g. UpnpSearchAsync or UpnpSendAdvertisement), control (e.g. UpnpSendAction), eventing (e.g. UpnpNotify), and HTTP functions (e.g. UpnpDownloadXmlDoc).

Definition at line 310 of file API.hpp.

◆ UPNP_E_EVENT_PROTOCOL

#define UPNP_E_EVENT_PROTOCOL   -300

The operation completed successfully.

For asynchronous functions, this only means that the packet generated by the operation was successfully transmitted on the network. The result of the entire operation comes as part of the callback for that operation.

Definition at line 312 of file API.hpp.

◆ UPNP_E_SUBSCRIBE_UNACCEPTED

#define UPNP_E_SUBSCRIBE_UNACCEPTED   -301

A subscription request was rejected from the remote side.

Definition at line 317 of file API.hpp.

◆ UPNP_E_UNSUBSCRIBE_UNACCEPTED

#define UPNP_E_UNSUBSCRIBE_UNACCEPTED   -302

An unsubscribe request was rejected from the remote side.

Definition at line 322 of file API.hpp.

◆ UPNP_E_NOTIFY_UNACCEPTED

#define UPNP_E_NOTIFY_UNACCEPTED   -303

The remote host did not accept the notify sent from the local device.

Definition at line 327 of file API.hpp.

◆ UPNP_E_INVALID_ARGUMENT

#define UPNP_E_INVALID_ARGUMENT   -501

One or more of the parameters passed to a function is invalid.

Refer to the individual function descriptions for the acceptable ranges for parameters.

Definition at line 335 of file API.hpp.

◆ UPNP_E_FILE_NOT_FOUND

#define UPNP_E_FILE_NOT_FOUND   -502

The filename passed to one of the device registration functions was not found or was not accessible.

Definition at line 341 of file API.hpp.

◆ UPNP_E_FILE_READ_ERROR

#define UPNP_E_FILE_READ_ERROR   -503

An error happened while reading a file.

Definition at line 346 of file API.hpp.

◆ UPNP_E_EXT_NOT_XML

#define UPNP_E_EXT_NOT_XML   -504

The file name of the description document passed to UpnpRegisterRootDevice2 does not end in ".xml".

Definition at line 352 of file API.hpp.

◆ UPNP_E_NO_WEB_SERVER

#define UPNP_E_NO_WEB_SERVER   -505

The operation completed successfully.

For asynchronous functions, this only means that the packet generated by the operation was successfully transmitted on the network. The result of the entire operation comes as part of the callback for that operation.

Definition at line 354 of file API.hpp.

◆ UPNP_E_OUTOF_BOUNDS

#define UPNP_E_OUTOF_BOUNDS   -506

The operation completed successfully.

For asynchronous functions, this only means that the packet generated by the operation was successfully transmitted on the network. The result of the entire operation comes as part of the callback for that operation.

Definition at line 355 of file API.hpp.

◆ UPNP_E_NOT_FOUND

#define UPNP_E_NOT_FOUND   -507

The response to a SOAP request did not contain the required XML constructs.

Definition at line 361 of file API.hpp.

◆ UPNP_E_INTERNAL_ERROR

#define UPNP_E_INTERNAL_ERROR   -911

Generic error code for internal conditions not covered by other error codes.

Definition at line 367 of file API.hpp.

◆ UPNP_SOAP_E_INVALID_ACTION

#define UPNP_SOAP_E_INVALID_ACTION   401

The operation completed successfully.

For asynchronous functions, this only means that the packet generated by the operation was successfully transmitted on the network. The result of the entire operation comes as part of the callback for that operation.

Definition at line 370 of file API.hpp.

◆ UPNP_SOAP_E_INVALID_ARGS

#define UPNP_SOAP_E_INVALID_ARGS   402

The operation completed successfully.

For asynchronous functions, this only means that the packet generated by the operation was successfully transmitted on the network. The result of the entire operation comes as part of the callback for that operation.

Definition at line 371 of file API.hpp.

◆ UPNP_SOAP_E_OUT_OF_SYNC

#define UPNP_SOAP_E_OUT_OF_SYNC   403

The operation completed successfully.

For asynchronous functions, this only means that the packet generated by the operation was successfully transmitted on the network. The result of the entire operation comes as part of the callback for that operation.

Definition at line 372 of file API.hpp.

◆ UPNP_SOAP_E_INVALID_VAR

#define UPNP_SOAP_E_INVALID_VAR   404

The operation completed successfully.

For asynchronous functions, this only means that the packet generated by the operation was successfully transmitted on the network. The result of the entire operation comes as part of the callback for that operation.

Definition at line 373 of file API.hpp.

◆ UPNP_SOAP_E_ACTION_FAILED

#define UPNP_SOAP_E_ACTION_FAILED   501

The operation completed successfully.

For asynchronous functions, this only means that the packet generated by the operation was successfully transmitted on the network. The result of the entire operation comes as part of the callback for that operation.

Definition at line 374 of file API.hpp.

Typedef Documentation

◆ UpnpClient_Handle

typedef int UpnpClient_Handle

Returned when a control point application registers with UpnpRegisterClient().

Client handles can only be used with functions that operate with a client handle.

Definition at line 415 of file API.hpp.

◆ UpnpDevice_Handle

typedef int UpnpDevice_Handle

Returned when a device application registers with UpnpRegisterRootDevice(),UpnpRegisterRootDevice2(), UpnpRegisterRootDevice3() or UpnpRegisterRootDevice4().

Device handles can only be used with functions that operate with a device handle.

Definition at line 425 of file API.hpp.

◆ Upnp_SID

typedef char Upnp_SID[44]

Holds the subscription identifier for a subscription between a client and a device.

The SID is a string representation of a globally unique id (GUID) and should not be modified.

Definition at line 434 of file API.hpp.

◆ Upnp_SType

typedef enum Upnp_SType_e Upnp_SType

Represents the different types of searches that can be performed using the SDK for UPnP Devices API.

By specifying these different values to UpnpSearchAsync, the control point application can control the scope of the search from all devices to specific devices or services.

Definition at line 460 of file API.hpp.

◆ Upnp_DescType

Represents the different types of searches that can be performed using the SDK for UPnP Devices API.

By specifying these different values to UpnpSearchAsync, the control point application can control the scope of the search from all devices to specific devices or services.

Definition at line 481 of file API.hpp.

Enumeration Type Documentation

◆ UpnpOpenFileMode

Represents the different types of searches that can be performed using the SDK for UPnP Devices API.

By specifying these different values to UpnpSearchAsync, the control point application can control the scope of the search from all devices to specific devices or services.

Definition at line 406 of file API.hpp.

◆ Upnp_SType_e

Represents the different types of searches that can be performed using the SDK for UPnP Devices API.

By specifying these different values to UpnpSearchAsync, the control point application can control the scope of the search from all devices to specific devices or services.

Enumerator
UPNP_S_ALL 

Search for all devices and services on the network.

UPNP_S_ROOT 

Search for all root devices on the network.

UPNP_S_DEVICE 

Search for a particular device type or a particular device instance.

UPNP_S_SERVICE 

Search for a particular service type, possibly on a particular device type or device instance.

Definition at line 444 of file API.hpp.

◆ Upnp_DescType_e

Specifies the type of description in UpnpRegisterRootDevice2.

These values control how UpnpRegisterRootDevice2 interprets the description parameter.

Enumerator
UPNPREG_URL_DESC 

The description is the URL to the description document.

UPNPREG_FILENAME_DESC 

The description is a file name on the local file system containing the description of the device.

UPNPREG_BUF_DESC 

The description is a pointer to a character array containing the XML description document.

Definition at line 468 of file API.hpp.