📄 upnp.h
字号:
/*! @{ */#define UPNP_E_SOCKET_BIND -203/*! @} *//** @name UPNP_E_SOCKET_CONNECT [-204] * {\tt UPNP_E_SOCKET_CONNECT} signifies that the SDK had a problem * connecting to a remote host. This occurs in any function that makes * network connections, such as discovery (e.g. {\bf UpnpSearchAsync} or * {\bf UpnpSendAdvertisement}), control (e.g. {\bf UpnpSendAction}), eventing * (e.g. {\bf UpnpNotify}), and HTTP functions (e.g. * {\bf UpnpDownloadXmlDoc}). *//*! @{ */#define UPNP_E_SOCKET_CONNECT -204/*! @} *//** @name UPNP_E_OUTOF_SOCKET [-205] * {\tt UPNP_E_OUTOF_SOCKET} signifies that the SDK cannot create any * more sockets. This occurs in any function that makes * network connections, such as discovery (e.g. {\bf UpnpSearchAsync} or * {\bf UpnpSendAdvertisement}), control (e.g. {\bf UpnpSendAction}), eventing * (e.g. {\bf UpnpNotify}), and HTTP functions (e.g. * {\bf UpnpDownloadXmlDoc}). *//*! @{ */#define UPNP_E_OUTOF_SOCKET -205/*! @} *//** @name UPNP_E_LISTEN [-206] * {\tt UPNP_E_LISTEN} signifies that the SDK had a problem setting the * socket to listen for incoming connections. This error only happens during * initialization (i.e. {\bf UpnpInit}). *//*! @{ */#define UPNP_E_LISTEN -206/*! @} *//** @name UPNP_E_TIMEDOUT [-207] * {\tt UPNP_E_TIMEDOUT} signifies that 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. *//*! @{ */#define UPNP_E_TIMEDOUT -207/*! @} *//** @name UPNP_E_SOCKET_ERROR [-208] * {\tt UPNP_E_SOCKET_ERROR} is the generic socket error code for * conditions not covered by other error codes. This error can be returned * by any function that performs network operations. *//*! @{ */#define UPNP_E_SOCKET_ERROR -208/*! @} */#define UPNP_E_FILE_WRITE_ERROR -209/** @name UPNP_E_CANCELED [-210] * {\tt UPNP_E_CANCELED} signifies that the operation was canceled. This * error can be returned by any function that allows for external * cancelation. *//*! @{ */#define UPNP_E_CANCELED -210/*! @} */#define UPNP_E_EVENT_PROTOCOL -300/** @name UPNP_E_SUBSCRIBE_UNACCEPTED [-301] * {\tt UPNP_E_SUBSCRIBE_UNACCEPTED} signifies that a subscription * request was rejected from the remote side. *//*! @{ */#define UPNP_E_SUBSCRIBE_UNACCEPTED -301/*! @} *//** @name UPNP_E_UNSUBSCRIBE_UNACCEPTED [-302] * {\tt UPNP_E_UNSUBSCRIBE_UNACCEPTED} signifies that an unsubscribe * request was rejected from the remote side. *//*! @{ */#define UPNP_E_UNSUBSCRIBE_UNACCEPTED -302/*! @} *//** @name UPNP_E_NOTIFY_UNACCEPTED [-303] * {\tt UPNP_E_NOTIFY_UNACCEPTED} signifies that the remote host did not * accept the notify sent from the local device. *//*! @{ */#define UPNP_E_NOTIFY_UNACCEPTED -303/*! @} *//** @name UPNP_E_INVALID_ARGUMENT [-501] * {\tt UPNP_E_INVALID_ARGUMENT} signifies that one or more of the parameters * passed to a function is invalid. Refer to the individual function * descriptions for the acceptable ranges for parameters. *//*! @{ */#define UPNP_E_INVALID_ARGUMENT -501/*! @} *//** @name UPNP_E_FILE_NOT_FOUND [-502] * {\tt UPNP_E_FILE_NOT_FOUND} signifies that the filename passed * to one of the device registration functions was not found or was not * accessible. *//*! @{ */#define UPNP_E_FILE_NOT_FOUND -502/*! @} *//** @name UPNP_E_FILE_READ_ERROR [-503] * {\tt UPNP_E_FILE_READ_ERROR} signifies an error when reading a file. *//*! @{ */#define UPNP_E_FILE_READ_ERROR -503/*! @} *//** @name UPNP_E_EXT_NOT_XML [-504] * {\tt UPNP_E_EXT_NOT_XML} signifies that the file name of the description * document passed to {\bf UpnpRegisterRootDevice2} does not end in ".xml". *//*! @{ */#define UPNP_E_EXT_NOT_XML -504/*! @} */#define UPNP_E_NO_WEB_SERVER -505#define UPNP_E_OUTOF_BOUNDS -506/** @name UPNP_E_NOT_FOUND [-507] * {\tt UPNP_E_NOT_FOUND} signifies that the response to a SOAP request * did not contain the required XML constructs. *//*! @{ */#define UPNP_E_NOT_FOUND -507/*! @} *//** @name UPNP_E_INTERNAL_ERROR [-911] * {\tt UPNP_E_INTERNAL_ERROR} is the generic error code for internal * conditions not covered by other error codes. *//*! @{ */#define UPNP_E_INTERNAL_ERROR -911/*! @} *//* SOAP-related error codes */#define UPNP_SOAP_E_INVALID_ACTION 401#define UPNP_SOAP_E_INVALID_ARGS 402#define UPNP_SOAP_E_OUT_OF_SYNC 403#define UPNP_SOAP_E_INVALID_VAR 404#define UPNP_SOAP_E_ACTION_FAILED 501/*! @} */#ifndef OUT#define OUT#endif#ifndef IN#define IN#endif#ifndef INOUT#define INOUT#endif#include "upnpdebug.h"enum UpnpOpenFileMode{UPNP_READ, UPNP_WRITE};/*! @name Constants, Structures, and Types *//*! @{ *//** Returned when a control point application registers with {\bf * UpnpRegisterClient}. Client handles can only be used with * functions that operate with a client handle. */typedef int UpnpClient_Handle;/** Returned when a device application registers with {\bf * UpnpRegisterRootDevice} or {\bf UpnpRegisterRootDevice2}. Device handles * can only be used with functions that operate with a device handle. */typedef int UpnpDevice_Handle;/** @name UPnP_EventType @memo The reason code for an event callback. @doc The {\bf Event} parameter will be different depending on the reason for the callback. The descriptions for each event type describe the contents of the {\bf Event} parameter. */enum Upnp_EventType_e { /* * Control callbacks */ /** Received by a device when a control point issues a control * request. The {\bf Event} parameter contains a pointer to a {\bf * Upnp_Action_Request} structure containing the action. The application * stores the results of the action in this structure. */ UPNP_CONTROL_ACTION_REQUEST, /** A {\bf UpnpSendActionAsync} call completed. The {\bf Event} * parameter contains a pointer to a {\bf Upnp_Action_Complete} structure * with the results of the action. */ UPNP_CONTROL_ACTION_COMPLETE, /** Received by a device when a query for a single service variable * arrives. The {\bf Event} parameter contains a pointer to a {\bf * Upnp_State_Var_Request} structure containing the name of the variable * and value. */ UPNP_CONTROL_GET_VAR_REQUEST, /** A {\bf UpnpGetServiceVarStatus} call completed. The {\bf Event} * parameter contains a pointer to a {\bf Upnp_State_Var_Complete} structure * containing the value for the variable. */ UPNP_CONTROL_GET_VAR_COMPLETE, /* * Discovery callbacks */ /** Received by a control point when a new device or service is available. * The {\bf Event} parameter contains a pointer to a {\bf * Upnp_Discovery} structure with the information about the device * or service. */ UPNP_DISCOVERY_ADVERTISEMENT_ALIVE, /** Received by a control point when a device or service shuts down. The {\bf * Event} parameter contains a pointer to a {\bf Upnp_Discovery} * structure containing the information about the device or * service. */ UPNP_DISCOVERY_ADVERTISEMENT_BYEBYE, /** Received by a control point when a matching device or service responds. * The {\bf Event} parameter contains a pointer to a {\bf * Upnp_Discovery} structure containing the information about * the reply to the search request. */ UPNP_DISCOVERY_SEARCH_RESULT, /** Received by a control point when the search timeout expires. The * SDK generates no more callbacks for this search after this * event. The {\bf Event} parameter is {\tt NULL}. */ UPNP_DISCOVERY_SEARCH_TIMEOUT, /* * Eventing callbacks */ /** Received by a device when a subscription arrives. * The {\bf Event} parameter contains a pointer to a {\bf * Upnp_Subscription_Request} structure. At this point, the * subscription has already been accepted. {\bf UpnpAcceptSubscription} * needs to be called to confirm the subscription and transmit the * initial state table. This can be done during this callback. The SDK * generates no events for a subscription unless the device * application calls {\bf UpnpAcceptSubscription}. */ UPNP_EVENT_SUBSCRIPTION_REQUEST, /** Received by a control point when an event arrives. The {\bf * Event} parameter contains a {\bf Upnp_Event} structure * with the information about the event. */ UPNP_EVENT_RECEIVED, /** A {\bf UpnpRenewSubscriptionAsync} call completed. The status of * the renewal is in the {\bf Event} parameter as a {\bf * Upnp_Event_Subscription} structure. */ UPNP_EVENT_RENEWAL_COMPLETE, /** A {\bf UpnpSubscribeAsync} call completed. The status of the * subscription is in the {\bf Event} parameter as a {\bf * Upnp_Event_Subscription} structure. */ UPNP_EVENT_SUBSCRIBE_COMPLETE, /** A {\bf UpnpUnSubscribeAsync} call completed. The status of the * subscription is in the {\bf Event} parameter as a {\bf * Upnp_Event_Subscribe} structure. */ UPNP_EVENT_UNSUBSCRIBE_COMPLETE, /** The auto-renewal of a client subscription failed. * The {\bf Event} parameter is a {\bf Upnp_Event_Subscribe} structure * with the error code set appropriately. The subscription is no longer * valid. */ UPNP_EVENT_AUTORENEWAL_FAILED, /** A client subscription has expired. This will only occur * if auto-renewal of subscriptions is disabled. * The {\bf Event} parameter is a {\bf Upnp_Event_Subscribe} * structure. The subscription is no longer valid. */ UPNP_EVENT_SUBSCRIPTION_EXPIRED};typedef enum Upnp_EventType_e Upnp_EventType;/** The {\bf Upnp_SID} 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. */ typedef char Upnp_SID[44];/** @name Upnp_SType @memo Represents the different types of searches that can be performed using the SDK for UPnP Devices API. @doc By specifying these different values to {\bf UpnpSearchAsync}, the control point application can control the scope of the search from all devices to specific devices or services. */enum Upnp_SType_e { /** Search for all devices and services on the network. */ UPNP_S_ALL, /** Search for all root devices on the network. */ UPNP_S_ROOT, /** Search for a particular device type or a particular device instance. */ UPNP_S_DEVICE,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -