Registers a device application with the UPnP Library. Similar to UpnpRegisterRootDevice, except that it also allows the description document to be specified as a file or a memory buffer.
The description can also be configured to have the correct IP and port address.
NOTE: For the configuration to be functional, the internal web server MUST be present. In addition, the web server MUST be activated (using UpnpSetWebServerRootDir) before calling this function. The only condition where the web server can be absent is if the description document is specified as a URL and no configuration is required (i.e.
config_baseURL = 0.)
This is a synchronous call and does not generate any callbacks. Callbacks can occur as soon as this function returns.
Examples of using different types of description documents:
1) Description specified as a URL:
descriptionType == UPNPREG_URL_DESC
description is the URL
bufferLen = 0 (ignored)
2) Description specified as a file:
descriptionType == UPNPREG_FILENAME_DESC
description is a filename
bufferLen = 0 (ignored)
3) Description specified as a memory buffer:
descriptionType == UPNPREG_BUF_DESC
description is pointer to a memory buffer
bufferLen == length of memory buffer
- An integer representing one of the following:
UPNP_E_SUCCESS: The operation completed successfully.
UPNP_E_FINISH: The SDK is already terminated or is not initialized.
UPNP_E_INVALID_DESC: The description document is not a valid device description.
UPNP_E_INVALID_PARAM: Either Callback or Hnd is not a valid pointer or DescURL is
UPNP_E_NETWORK_ERROR: A network error occurred.
UPNP_E_SOCKET_WRITE: An error or timeout occurred writing to a socket.
UPNP_E_SOCKET_READ: An error or timeout occurred reading from a socket.
UPNP_E_SOCKET_BIND: An error occurred binding a socket.
UPNP_E_SOCKET_CONNECT: An error occurred connecting the socket.
UPNP_E_OUTOF_SOCKET: Too many sockets are currently allocated.
UPNP_E_OUTOF_MEMORY: There are insufficient resources to register this root device.
UPNP_E_URL_TOO_BIG: Length of the URL is bigger than the internal buffer.
UPNP_E_FILE_NOT_FOUND: The description file could not be found.
UPNP_E_FILE_READ_ERROR: An error occurred reading the description file.
UPNP_E_INVALID_URL: The URL to the description document is invalid.
UPNP_E_EXT_NOT_XML: The URL to the description document or file should have a
UPNP_E_NO_WEB_SERVER: The internal web server has been compiled out; the SDK cannot configure itself from the description document.
[in] The type of the description document. |
[in] Treated as a URL, file name or memory buffer depending on description type. |
[in] The length of memory buffer if passing a description in a buffer, otherwise it is ignored. |
[in] If nonzero, |
URLBase of description document is configured and the description is served using the internal web server.
[in] Pointer to the callback function for receiving asynchronous events. |
[in] Pointer to user data returned with the callback function when invoked. |
[out] Pointer to a variable to store the new device handle. |