git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@401 119443c7-1b9e-41f8-b6fc-b9c35fce742c
This commit is contained in:
Marcelo Roberto Jimenez 2008-06-02 22:42:33 +00:00
parent ecb06fa24f
commit c1ac15fccc
12 changed files with 1761 additions and 2466 deletions

View File

@ -707,7 +707,8 @@ enum Upnp_DescType_e {
typedef enum Upnp_DescType_e Upnp_DescType; typedef enum Upnp_DescType_e Upnp_DescType;
/*! All callback functions share the same prototype, documented below. /*!
* All callback functions share the same prototype, documented below.
* Note that any memory passed to the callback function * Note that any memory passed to the callback function
* is valid only during the callback and should be copied if it * is valid only during the callback and should be copied if it
* needs to persist. This callback function needs to be thread * needs to persist. This callback function needs to be thread
@ -728,10 +729,16 @@ typedef enum Upnp_DescType_e Upnp_DescType;
* See \b Upnp_EventType for more information on the callback values and * See \b Upnp_EventType for more information on the callback values and
* the associated \b Event parameter. * the associated \b Event parameter.
* *
* The return value of the callback is currently ignored. It may be used * The return value of the callback is currently ignored. It may be used
* in the future to communicate results back to the SDK. * in the future to communicate results back to the SDK.
*/ */
typedef int (*Upnp_FunPtr)(IN Upnp_EventType EventType, IN void *Event, IN void *Cookie); typedef int (*Upnp_FunPtr)(
/*! [in] .*/
Upnp_EventType EventType,
/*! [in] .*/
void *Event,
/*! [in] .*/
void *Cookie);
/* @} Constants and Types */ /* @} Constants and Types */
@ -1037,7 +1044,7 @@ EXPORT_SPEC int UpnpRegisterRootDevice2(
* the description is served using the internal web server. */ * the description is served using the internal web server. */
int config_baseURL, int config_baseURL,
/*! [in] Pointer to the callback function for receiving asynchronous events. */ /*! [in] Pointer to the callback function for receiving asynchronous events. */
IN Upnp_FunPtr Fun, Upnp_FunPtr Fun,
/*! [in] Pointer to user data returned with the callback function when /*! [in] Pointer to user data returned with the callback function when
* invoked. */ * invoked. */
const void* Cookie, const void* Cookie,
@ -1224,6 +1231,10 @@ EXPORT_SPEC int UpnpSetMaxContentLength(
* matching root device, device, or service. The application specifies the * matching root device, device, or service. The application specifies the
* search type by the \b Target parameter. * search type by the \b Target parameter.
* *
* This function searches for the devices for the provided maximum time.
* It is an asynchronous function. It schedules a search job and returns.
* The client is notified about the search results after search timer.
*
* Note that there is no way for the SDK to distinguish which client * Note that there is no way for the SDK to distinguish which client
* instance issued a particular search. Therefore, the client can get * instance issued a particular search. Therefore, the client can get
* search callbacks that do not match the original criteria of the search. * search callbacks that do not match the original criteria of the search.
@ -1237,17 +1248,17 @@ EXPORT_SPEC int UpnpSetMaxContentLength(
*/ */
EXPORT_SPEC int UpnpSearchAsync( EXPORT_SPEC int UpnpSearchAsync(
/*! The handle of the client performing the search. */ /*! The handle of the client performing the search. */
IN UpnpClient_Handle Hnd, UpnpClient_Handle Hnd,
/*! The time, in seconds, to wait for responses. If the time is greater /*! The time, in seconds, to wait for responses. If the time is greater
* than \c MAX_SEARCH_TIME then the time is set to \c MAX_SEARCH_TIME. * than \c MAX_SEARCH_TIME then the time is set to \c MAX_SEARCH_TIME.
* If the time is less than \c MIN_SEARCH_TIME then the time is set to * If the time is less than \c MIN_SEARCH_TIME then the time is set to
* \c MIN_SEARCH_TIME. */ * \c MIN_SEARCH_TIME. */
IN int Mx, int Mx,
/*! The search target as defined in the UPnP Device Architecture v1.0 /*! The search target as defined in the UPnP Device Architecture v1.0
* specification. */ * specification. */
IN const char *Target, const char *TTarget_constarget_const,
/*! The user data to pass when the callback function is invoked. */ /*! The user data to pass when the callback function is invoked. */
IN const void *Cookie); const void *Cookie_const);
/*! /*!
* \brief Sends out the discovery announcements for all devices and services * \brief Sends out the discovery announcements for all devices and services
@ -1266,9 +1277,9 @@ EXPORT_SPEC int UpnpSearchAsync(
*/ */
EXPORT_SPEC int UpnpSendAdvertisement( EXPORT_SPEC int UpnpSendAdvertisement(
/*! The device handle for which to send out the announcements. */ /*! The device handle for which to send out the announcements. */
IN UpnpDevice_Handle Hnd, UpnpDevice_Handle Hnd,
/*! The expiration age, in seconds, of the announcements. */ /*! The expiration age, in seconds, of the announcements. */
IN int Exp); int Exp);
/* @} Discovery */ /* @} Discovery */
@ -1316,16 +1327,16 @@ EXPORT_SPEC int UpnpSendAdvertisement(
* according to the device. * according to the device.
*/ */
EXPORT_SPEC int UpnpGetServiceVarStatus( EXPORT_SPEC int UpnpGetServiceVarStatus(
/*! The handle of the control point. */ /*! [in] The handle of the control point. */
IN UpnpClient_Handle Hnd, UpnpClient_Handle Hnd,
/*! The URL of the service. */ /*! [in] The URL of the service. */
IN const char *ActionURL, const char *ActionURL,
/*! The name of the variable to query. */ /*! [in] The name of the variable to query. */
IN const char *VarName, const char *VarName,
/*! The pointer to store the value for \b VarName. The SDK allocates /*! [out] The pointer to store the value for \b VarName. The SDK allocates
* this string and the caller needs to free it using * this string and the caller needs to free it using
* \b ixmlFreeDOMString. */ * \b ixmlFreeDOMString. */
OUT DOMString *StVarVal); DOMString *StVarVal);
/*! /*!
@ -1346,17 +1357,17 @@ EXPORT_SPEC int UpnpGetServiceVarStatus(
* complete this operation. * complete this operation.
*/ */
EXPORT_SPEC int UpnpGetServiceVarStatusAsync( EXPORT_SPEC int UpnpGetServiceVarStatusAsync(
/*! The handle of the control point. */ /*! [in] The handle of the control point. */
IN UpnpClient_Handle Hnd, UpnpClient_Handle Hnd,
/*! The URL of the service. */ /*! [in] The URL of the service. */
IN const char *ActionURL, const char *ActionURL,
/*! The name of the variable to query. */ /*! [in] The name of the variable to query. */
IN const char *VarName, const char *VarName,
/*! Pointer to a callback function to be invoked when the operation /*! [in] Pointer to a callback function to be invoked when the operation
* is complete. */ * is complete. */
IN Upnp_FunPtr Fun, Upnp_FunPtr Fun,
/*! Pointer to user data to pass to the callback function when invoked. */ /*! [in] Pointer to user data to pass to the callback function when invoked. */
IN const void *Cookie); const void *Cookie);
/*! /*!
@ -1383,19 +1394,19 @@ EXPORT_SPEC int UpnpGetServiceVarStatusAsync(
* complete this operation. * complete this operation.
*/ */
EXPORT_SPEC int UpnpSendAction( EXPORT_SPEC int UpnpSendAction(
/*! The handle of the control point sending the action. */ /*! [in] The handle of the control point sending the action. */
IN UpnpClient_Handle Hnd, UpnpClient_Handle Hnd,
/*! The action URL of the service. */ /*! [in] The action URL of the service. */
IN const char *ActionURL, const char *ActionURL,
/*! The type of the service. */ /*! [in] The type of the service. */
IN const char *ServiceType, const char *ServiceType,
/*! This parameter is ignored and must be \c NULL. */ /*! [in] This parameter is ignored and must be \c NULL. */
IN const char *DevUDN, const char *DevUDN,
/*! The DOM document for the action. */ /*! [in] The DOM document for the action. */
IN IXML_Document *Action, IXML_Document *Action,
/*! The DOM document for the response to the action. The SDK allocates /*! [out] The DOM document for the response to the action. The SDK allocates
* this document and the caller needs to free it. */ * this document and the caller needs to free it. */
OUT IXML_Document **RespNode); IXML_Document **RespNode);
/*! /*!
@ -1422,22 +1433,22 @@ EXPORT_SPEC int UpnpSendAction(
* complete this operation. * complete this operation.
*/ */
EXPORT_SPEC int UpnpSendActionEx( EXPORT_SPEC int UpnpSendActionEx(
/*! The handle of the control point sending the action. */ /*! [in] The handle of the control point sending the action. */
IN UpnpClient_Handle Hnd, UpnpClient_Handle Hnd,
/*! The action URL of the service. */ /*! [in] The action URL of the service. */
IN const char *ActionURL, const char *ActionURL,
/*! The type of the service. */ /*! [in] The type of the service. */
IN const char *ServiceType, const char *ServiceType,
/*! This parameter is ignored and must be \c NULL. */ /*! [in] This parameter is ignored and must be \c NULL. */
IN const char *DevUDN, const char *DevUDN,
/*! The DOM document for the SOAP header. This may be \c NULL if the /*! [in] The DOM document for the SOAP header. This may be \c NULL if the
* header is not required. */ * header is not required. */
IN IXML_Document *Header, IXML_Document *Header,
/*! The DOM document for the action. */ /*! [in] The DOM document for the action. */
IN IXML_Document *Action, IXML_Document *Action,
/*! The DOM document for the response to the action. The SDK allocates /*! [out] The DOM document for the response to the action. The SDK allocates
* this document and the caller needs to free it. */ * this document and the caller needs to free it. */
OUT IXML_Document **RespNode); IXML_Document **RespNode);
/*! /*!
@ -1462,22 +1473,22 @@ EXPORT_SPEC int UpnpSendActionEx(
* complete this operation. * complete this operation.
*/ */
EXPORT_SPEC int UpnpSendActionAsync( EXPORT_SPEC int UpnpSendActionAsync(
/*! The handle of the control point sending the action. */ /*! [in] The handle of the control point sending the action. */
IN UpnpClient_Handle Hnd, UpnpClient_Handle Hnd,
/*! The action URL of the service. */ /*! [in] The action URL of the service. */
IN const char *ActionURL, const char *ActionURL,
/*! The type of the service. */ /*! [in] The type of the service. */
IN const char *ServiceType, const char *ServiceType,
/*! This parameter is ignored and must be \c NULL. */ /*! [in] This parameter is ignored and must be \c NULL. */
IN const char *DevUDN, const char *DevUDN,
/*! The DOM document for the action to perform on this device. */ /*! [in] The DOM document for the action to perform on this device. */
IN IXML_Document *Action, IXML_Document *Action,
/*! Pointer to a callback function to be invoked when the operation /*! [in] Pointer to a callback function to be invoked when the operation
* completes. */ * completes. */
IN Upnp_FunPtr Fun, Upnp_FunPtr Fun,
/*! Pointer to user data that to be passed to the callback when /*! [in] Pointer to user data that to be passed to the callback when
* invoked. */ * invoked. */
IN const void *Cookie); const void *Cookie);
/*! /*!
@ -1502,28 +1513,30 @@ EXPORT_SPEC int UpnpSendActionAsync(
* complete this operation. * complete this operation.
*/ */
EXPORT_SPEC int UpnpSendActionExAsync( EXPORT_SPEC int UpnpSendActionExAsync(
/*! The handle of the control point sending the action. */ /*! [in] The handle of the control point sending the action. */
IN UpnpClient_Handle Hnd, UpnpClient_Handle Hnd,
/*! The action URL of the service. */ /*! [in] The action URL of the service. */
IN const char *ActionURL, const char *ActionURL,
/*! The type of the service. */ /*! [in] The type of the service. */
IN const char *ServiceType, const char *ServiceType,
/*! This parameter is ignored and must be \c NULL. */ /*! [in] This parameter is ignored and must be \c NULL. */
IN const char *DevUDN, const char *DevUDN,
/*! The DOM document for the SOAP header. This may be \c NULL if the /*! [in] The DOM document for the SOAP header. This may be \c NULL if the
* header is not required. */ * header is not required. */
IN IXML_Document *Header, IXML_Document *Header,
/*! The DOM document for the action to perform on this device. */ /*! [in] The DOM document for the action to perform on this device. */
IN IXML_Document *Action, IXML_Document *Action,
/*! Pointer to a callback function to be invoked when the operation /*! [in] Pointer to a callback function to be invoked when the operation
* completes. */ * completes. */
IN Upnp_FunPtr Fun, Upnp_FunPtr Fun,
/*! Pointer to user data that to be passed to the callback when /*! [in] Pointer to user data that to be passed to the callback when
* invoked. */ * invoked. */
IN const void *Cookie); const void *Cookie);
/*! @} Control */ /*! @} Control */
/****************************************************************************** /******************************************************************************
****************************************************************************** ******************************************************************************
* * * *
@ -1564,20 +1577,20 @@ EXPORT_SPEC int UpnpSendActionExAsync(
* complete this operation. * complete this operation.
*/ */
EXPORT_SPEC int UpnpAcceptSubscription( EXPORT_SPEC int UpnpAcceptSubscription(
/*! The handle of the device. */ /*! [in] The handle of the device. */
IN UpnpDevice_Handle Hnd, UpnpDevice_Handle Hnd,
/*! The device ID of the subdevice of the service generating the event. */ /*! [in] The device ID of the subdevice of the service generating the event. */
IN const char *DevID, const char *DevID,
/*! The unique service identifier of the service generating the event. */ /*! [in] The unique service identifier of the service generating the event. */
IN const char *ServID, const char *ServID,
/*! Pointer to an array of event variables. */ /*! [in] Pointer to an array of event variables. */
IN const char **VarName, const char **VarName,
/*! Pointer to an array of values for the event variables. */ /*! [in] Pointer to an array of values for the event variables. */
IN const char **NewVal, const char **NewVal,
/*! The number of event variables in \b VarName. */ /*! [in] The number of event variables in \b VarName. */
IN int cVariables, int cVariables,
/*! The subscription ID of the newly registered control point. */ /*! [in] The subscription ID of the newly registered control point. */
IN const Upnp_SID SubsId); const Upnp_SID SubsId);
/*! /*!
@ -1604,18 +1617,18 @@ EXPORT_SPEC int UpnpAcceptSubscription(
* complete this operation. * complete this operation.
*/ */
EXPORT_SPEC int UpnpAcceptSubscriptionExt( EXPORT_SPEC int UpnpAcceptSubscriptionExt(
/*! The handle of the device. */ /*! [in] The handle of the device. */
IN UpnpDevice_Handle Hnd, UpnpDevice_Handle Hnd,
/*! The device ID of the subdevice of the service generating the event. */ /*! [in] The device ID of the subdevice of the service generating the event. */
IN const char *DevID, const char *DevID,
/*! The unique service identifier of the service generating the event. */ /*! [in] The unique service identifier of the service generating the event. */
IN const char *ServID, const char *ServID,
/*! The DOM document for the property set. Property set documents must /*! [in] The DOM document for the property set. Property set documents must
* conform to the XML schema defined in section 4.3 of the Universal * conform to the XML schema defined in section 4.3 of the Universal
* Plug and Play Device Architecture specification. */ * Plug and Play Device Architecture specification. */
IN IXML_Document *PropSet, IXML_Document *PropSet,
/*! The subscription ID of the newly registered control point. */ /*! [in] The subscription ID of the newly registered control point. */
IN Upnp_SID SubsId); Upnp_SID SubsId);
/*! /*!
@ -1640,18 +1653,18 @@ EXPORT_SPEC int UpnpAcceptSubscriptionExt(
* complete this operation. * complete this operation.
*/ */
EXPORT_SPEC int UpnpNotify( EXPORT_SPEC int UpnpNotify(
/*! The handle to the device sending the event. */ /*! [in] The handle to the device sending the event. */
IN UpnpDevice_Handle, UpnpDevice_Handle,
/*! The device ID of the subdevice of the service generating the event. */ /*! [in] The device ID of the subdevice of the service generating the event. */
IN const char *DevID, const char *DevID,
/*! The unique identifier of the service generating the event. */ /*! [in] The unique identifier of the service generating the event. */
IN const char *ServID, const char *ServID,
/*! Pointer to an array of variables that have changed. */ /*! [in] Pointer to an array of variables that have changed. */
IN const char **VarName, const char **VarName,
/*! Pointer to an array of new values for those variables. */ /*! [in] Pointer to an array of new values for those variables. */
IN const char **NewVal, const char **NewVal,
/*! The count of variables included in this notification. */ /*! [in] The count of variables included in this notification. */
IN int cVariables); int cVariables);
/*! /*!
@ -1676,16 +1689,16 @@ EXPORT_SPEC int UpnpNotify(
* complete this operation. * complete this operation.
*/ */
EXPORT_SPEC int UpnpNotifyExt( EXPORT_SPEC int UpnpNotifyExt(
/*! The handle to the device sending the event. */ /*! [in] The handle to the device sending the event. */
IN UpnpDevice_Handle, UpnpDevice_Handle,
/*! The device ID of the subdevice of the service generating the event. */ /*! [in] The device ID of the subdevice of the service generating the event. */
IN const char *DevID, const char *DevID,
/*! The unique identifier of the service generating the event. */ /*! [in] The unique identifier of the service generating the event. */
IN const char *ServID, const char *ServID,
/*! The DOM document for the property set. Property set documents must /*! [in] The DOM document for the property set. Property set documents must
* conform to the XML schema defined in section 4.3 of the Universal * conform to the XML schema defined in section 4.3 of the Universal
* Plug and Play Device Architecture specification. */ * Plug and Play Device Architecture specification. */
IN IXML_Document *PropSet); IXML_Document *PropSet);
/*! /*!
@ -1717,13 +1730,13 @@ EXPORT_SPEC int UpnpNotifyExt(
* complete this operation. * complete this operation.
*/ */
EXPORT_SPEC int UpnpRenewSubscription( EXPORT_SPEC int UpnpRenewSubscription(
/*! The handle of the control point that is renewing the subscription. */ /*! [in] The handle of the control point that is renewing the subscription. */
IN UpnpClient_Handle Hnd, UpnpClient_Handle Hnd,
/*! Pointer to a variable containing the requested subscription time. /*! [in,out] Pointer to a variable containing the requested subscription time.
* Upon return, it contains the actual renewal time. */ * Upon return, it contains the actual renewal time. */
INOUT int *TimeOut, int *TimeOut,
/*! The ID for the subscription to renew. */ /*! [in] The ID for the subscription to renew. */
IN const Upnp_SID SubsId); const Upnp_SID SubsId);
/*! /*!
@ -1774,18 +1787,18 @@ EXPORT_SPEC int UpnpRenewSubscription(
* UpnpEventSubscribe.ErrCode field as part of the callback). * UpnpEventSubscribe.ErrCode field as part of the callback).
*/ */
EXPORT_SPEC int UpnpRenewSubscriptionAsync( EXPORT_SPEC int UpnpRenewSubscriptionAsync(
/*! The handle of the control point that is renewing the subscription. */ /*! [in] The handle of the control point that is renewing the subscription. */
IN UpnpClient_Handle Hnd, UpnpClient_Handle Hnd,
/*! The requested subscription time. The actual timeout value is /*! [in] The requested subscription time. The actual timeout value is
* returned when the callback function is called. */ * returned when the callback function is called. */
IN int TimeOut, int TimeOut,
/*! The ID for the subscription to renew. */ /*! [in] The ID for the subscription to renew. */
IN Upnp_SID SubsId, Upnp_SID SubsId,
/*! Pointer to a callback function to be invoked when the renewal is /*! [in] Pointer to a callback function to be invoked when the renewal is
* complete. */ * complete. */
IN Upnp_FunPtr Fun, Upnp_FunPtr Fun,
/*! Pointer to user data passed to the callback function when invoked. */ /*! [in] Pointer to user data passed to the callback function when invoked. */
IN const void *Cookie); const void *Cookie);
/*! /*!
@ -1804,9 +1817,9 @@ EXPORT_SPEC int UpnpRenewSubscriptionAsync(
EXPORT_SPEC int UpnpSetMaxSubscriptions( EXPORT_SPEC int UpnpSetMaxSubscriptions(
/*! The handle of the device for which the maximum number of /*! The handle of the device for which the maximum number of
* subscriptions is being set. */ * subscriptions is being set. */
IN UpnpDevice_Handle Hnd, UpnpDevice_Handle Hnd,
/*! The maximum number of subscriptions to be allowed per service. */ /*! The maximum number of subscriptions to be allowed per service. */
IN int MaxSubscriptions); int MaxSubscriptions);
/*! /*!
@ -1826,9 +1839,9 @@ EXPORT_SPEC int UpnpSetMaxSubscriptions(
EXPORT_SPEC int UpnpSetMaxSubscriptionTimeOut( EXPORT_SPEC int UpnpSetMaxSubscriptionTimeOut(
/*! The handle of the device for which the maximum subscription /*! The handle of the device for which the maximum subscription
* time-out is being set. */ * time-out is being set. */
IN UpnpDevice_Handle Hnd, UpnpDevice_Handle Hnd,
/*! The maximum subscription time-out to be accepted. */ /*! The maximum subscription time-out to be accepted. */
IN int MaxSubscriptionTimeOut); int MaxSubscriptionTimeOut);
/*! /*!
@ -1861,16 +1874,16 @@ EXPORT_SPEC int UpnpSetMaxSubscriptionTimeOut(
* complete this operation. * complete this operation.
*/ */
EXPORT_SPEC int UpnpSubscribe( EXPORT_SPEC int UpnpSubscribe(
/*! The handle of the control point. */ /*! [in] The handle of the control point. */
IN UpnpClient_Handle Hnd, UpnpClient_Handle Hnd,
/*! The URL of the service to subscribe to. */ /*! [in] The URL of the service to subscribe to. */
IN const char *PublisherUrl, const char *PublisherUrl,
/*! Pointer to a variable containing the requested subscription time. /*! [in,out]Pointer to a variable containing the requested subscription time.
* Upon return, it contains the actual subscription time returned from * Upon return, it contains the actual subscription time returned from
* the service. */ * the service. */
INOUT int *TimeOut, int *TimeOut,
/*! Pointer to a variable to receive the subscription ID (SID). */ /*! [out] Pointer to a variable to receive the subscription ID (SID). */
OUT Upnp_SID SubsId); Upnp_SID SubsId);
/*! /*!
@ -1923,16 +1936,16 @@ EXPORT_SPEC int UpnpSubscribe(
*/ */
EXPORT_SPEC int UpnpSubscribeAsync( EXPORT_SPEC int UpnpSubscribeAsync(
/*! The handle of the control point that is subscribing. */ /*! The handle of the control point that is subscribing. */
IN UpnpClient_Handle Hnd, UpnpClient_Handle Hnd,
/*! The URL of the service to subscribe to. */ /*! The URL of the service to subscribe to. */
IN const char *PublisherUrl, const char *PublisherUrl,
/*! The requested subscription time. Upon return, it contains the actual /*! The requested subscription time. Upon return, it contains the actual
* subscription time returned from the service. */ * subscription time returned from the service. */
IN int TimeOut, int TimeOut,
/*! Pointer to the callback function for this subscribe request. */ /*! Pointer to the callback function for this subscribe request. */
IN Upnp_FunPtr Fun, Upnp_FunPtr Fun,
/*! A user data value passed to the callback function when invoked. */ /*! A user data value passed to the callback function when invoked. */
IN const void *Cookie); const void *Cookie);
/*! /*!
@ -1965,10 +1978,10 @@ EXPORT_SPEC int UpnpSubscribeAsync(
* complete this operation. * complete this operation.
*/ */
EXPORT_SPEC int UpnpUnSubscribe( EXPORT_SPEC int UpnpUnSubscribe(
/*! The handle of the subscribed control point. */ /*! [in] The handle of the subscribed control point. */
IN UpnpClient_Handle Hnd, UpnpClient_Handle Hnd,
/*! The ID returned when the control point subscribed to the service. */ /*! [in] The ID returned when the control point subscribed to the service. */
IN const Upnp_SID SubsId); const Upnp_SID SubsId);
/*! /*!
@ -2018,15 +2031,15 @@ EXPORT_SPEC int UpnpUnSubscribe(
* <b>UpnpEventSubscribe.ErrCode</b> field as part of the callback). * <b>UpnpEventSubscribe.ErrCode</b> field as part of the callback).
*/ */
EXPORT_SPEC int UpnpUnSubscribeAsync( EXPORT_SPEC int UpnpUnSubscribeAsync(
/*! The handle of the subscribed control point. */ /*! [in] The handle of the subscribed control point. */
IN UpnpClient_Handle Hnd, UpnpClient_Handle Hnd,
/*! The ID returned when the control point subscribed to the service. */ /*! [in] The ID returned when the control point subscribed to the service. */
IN Upnp_SID SubsId, Upnp_SID SubsId,
/*! Pointer to a callback function to be called when the operation is /*! [in] Pointer to a callback function to be called when the operation is
* complete. */ * complete. */
IN Upnp_FunPtr Fun, Upnp_FunPtr Fun,
/*! Pointer to user data to pass to the callback function when invoked. */ /*! [in] Pointer to user data to pass to the callback function when invoked. */
IN const void *Cookie); const void *Cookie);
/*! @} Eventing */ /*! @} Eventing */
@ -2470,10 +2483,10 @@ typedef void *UpnpWebFileHandle;
* \brief Get-info callback function prototype. * \brief Get-info callback function prototype.
*/ */
typedef int (*VDCallback_GetInfo)( typedef int (*VDCallback_GetInfo)(
/*! The name of the file to query. */ /*! [in] The name of the file to query. */
IN const char *filename, const char *filename,
/*! Pointer to a structure to store the information on the file. */ /*! [out] Pointer to a structure to store the information on the file. */
OUT UpnpFileInfo *info); UpnpFileInfo *info);
/*! /*!
* \brief Sets the get_info callback function to be used to access a virtual * \brief Sets the get_info callback function to be used to access a virtual
@ -2490,11 +2503,11 @@ EXPORT_SPEC int UpnpVirtualDir_set_GetInfoCallback(VDCallback_GetInfo callback);
* \brief Open callback function prototype. * \brief Open callback function prototype.
*/ */
typedef UpnpWebFileHandle (*VDCallback_Open)( typedef UpnpWebFileHandle (*VDCallback_Open)(
/*! The name of the file to open. */ /*! [in] The name of the file to open. */
IN const char *filename, const char *filename,
/*! The mode in which to open the file. /*! [in] The mode in which to open the file.
* Valid values are \c UPNP_READ or \c UPNP_WRITE. */ * Valid values are \c UPNP_READ or \c UPNP_WRITE. */
IN enum UpnpOpenFileMode Mode); enum UpnpOpenFileMode Mode);
/*! /*!
@ -2512,12 +2525,12 @@ EXPORT_SPEC int UpnpVirtualDir_set_OpenCallback(VDCallback_Open callback);
* \brief Read callback function prototype. * \brief Read callback function prototype.
*/ */
typedef int (*VDCallback_Read)( typedef int (*VDCallback_Read)(
/*! The handle of the file to read. */ /*! [in] The handle of the file to read. */
IN UpnpWebFileHandle fileHnd, UpnpWebFileHandle fileHnd,
/*! The buffer in which to place the data. */ /*! [out] The buffer in which to place the data. */
OUT char *buf, char *buf,
/*! The size of the buffer (i.e. the number of bytes to read). */ /*! [in] The size of the buffer (i.e. the number of bytes to read). */
IN size_t buflen); size_t buflen);
/*! /*!
@ -2535,12 +2548,12 @@ EXPORT_SPEC int UpnpVirtualDir_set_ReadCallback(VDCallback_Read callback);
* \brief Write callback function prototype. * \brief Write callback function prototype.
*/ */
typedef int (*VDCallback_Write)( typedef int (*VDCallback_Write)(
/*! The handle of the file to write. */ /*! [in] The handle of the file to write. */
IN UpnpWebFileHandle fileHnd, UpnpWebFileHandle fileHnd,
/*! The buffer with the bytes to write. */ /*! [in] The buffer with the bytes to write. */
IN char *buf, char *buf,
/*! The number of bytes to write. */ /*! [in] The number of bytes to write. */
IN size_t buflen); size_t buflen);
/*! /*!
@ -2558,17 +2571,17 @@ EXPORT_SPEC int UpnpVirtualDir_set_WriteCallback(VDCallback_Write callback);
* \brief Seek callback function prototype. * \brief Seek callback function prototype.
*/ */
typedef int (*VDCallback_Seek) ( typedef int (*VDCallback_Seek) (
/*! The handle of the file to move the file pointer. */ /*! [in] The handle of the file to move the file pointer. */
IN UpnpWebFileHandle fileHnd, UpnpWebFileHandle fileHnd,
/*! The number of bytes to move in the file. Positive values /*! [in] The number of bytes to move in the file. Positive values
* move foward and negative values move backward. Note that * move foward and negative values move backward. Note that
* this must be positive if the \b origin is \c SEEK_SET. */ * this must be positive if the \b origin is \c SEEK_SET. */
IN off_t offset, off_t offset,
/*! The position to move relative to. It can be \c SEEK_CUR /*! [in] The position to move relative to. It can be \c SEEK_CUR
* to move relative to the current position, \c SEEK_END to * to move relative to the current position, \c SEEK_END to
* move relative to the end of the file, or \c SEEK_SET to * move relative to the end of the file, or \c SEEK_SET to
* specify an absolute offset. */ * specify an absolute offset. */
IN int origin); int origin);
/*! /*!
@ -2586,8 +2599,8 @@ EXPORT_SPEC int UpnpVirtualDir_set_SeekCallback(VDCallback_Seek callback);
* \brief Close callback function prototype. * \brief Close callback function prototype.
*/ */
typedef int (*VDCallback_Close)( typedef int (*VDCallback_Close)(
/*! The handle of the file to close. */ /*! [in] The handle of the file to close. */
IN UpnpWebFileHandle fileHnd); UpnpWebFileHandle fileHnd);
/*! /*!

View File

@ -101,50 +101,36 @@ typedef enum Upnp_LogLevel_e {
/*************************************************************************** /*!
* Function : UpnpInitLog * \brief Initialize the log files.
* *
* Parameters: void * \return -1 if fails or UPNP_E_SUCCESS if succeeds.
* */
* Description:
* This functions initializes the log files
*
* Returns: int
* -1 : If fails
* UPNP_E_SUCCESS : if success
***************************************************************************/
#ifdef DEBUG #ifdef DEBUG
int UpnpInitLog(); int UpnpInitLog();
#else #else
static UPNP_INLINE int UpnpInitLog() { return UPNP_E_SUCCESS; } static UPNP_INLINE int UpnpInitLog()
{
return UPNP_E_SUCCESS;
}
#endif #endif
/*************************************************************************** /*!
* Function : UpnpSetLogLevel * \brief Set the log level (see \c Upnp_LogLevel).
* */
* Parameters: Upnp_LogLevel log_level
*
* Description:
* This functions set the log level (see \c Upnp_LogLevel)
* Returns: void
***************************************************************************/
#ifdef DEBUG #ifdef DEBUG
void UpnpSetLogLevel(Upnp_LogLevel log_level); void UpnpSetLogLevel(
/*! [in] Log level. */
Upnp_LogLevel log_level);
#else #else
static UPNP_INLINE void UpnpSetLogLevel(Upnp_LogLevel log_level) {} static UPNP_INLINE void UpnpSetLogLevel(Upnp_LogLevel log_level) {}
#endif #endif
/*************************************************************************** /*!
* Function : UpnpCloseLog * \brief Closes the log files.
* */
* Parameters: void
*
* Description:
* This functions closes the log files
* Returns: void
***************************************************************************/
#ifdef DEBUG #ifdef DEBUG
void UpnpCloseLog(); void UpnpCloseLog();
#else #else
@ -152,23 +138,14 @@ static UPNP_INLINE void UpnpCloseLog() {}
#endif #endif
/*************************************************************************** /*!
* Function : UpnpSetLogFileNames * \brief Set the name for error and information files, respectively.
* */
* Parameters:
* IN const char* ErrFileName: name of the error file
* IN const char *InfoFileName: name of the information file
* IN int size: Size of the buffer
* IN int starLength: This parameter provides the width of the banner
*
* Description:
* This functions takes the buffer and writes the buffer in the file as
* per the requested banner
* Returns: void
***************************************************************************/
#ifdef DEBUG #ifdef DEBUG
void UpnpSetLogFileNames( void UpnpSetLogFileNames(
/*! [in] Name of the error file. */
const char *ErrFileName, const char *ErrFileName,
/*! [in] Name of the information file. */
const char *InfoFileName); const char *InfoFileName);
#else #else
static UPNP_INLINE void UpnpSetLogFileNames( static UPNP_INLINE void UpnpSetLogFileNames(
@ -177,24 +154,20 @@ static UPNP_INLINE void UpnpSetLogFileNames(
#endif #endif
/*************************************************************************** /*!
* Function : UpnpGetDebugFile * \brief Check if the module is turned on for debug and returns the file
* * descriptor corresponding to the debug level
* Parameters: *
* IN Upnp_LogLevel DLevel: The level of the debug logging. It will decide * \return NULL if the module is turn off for debug otheriwse returns the
* whether debug statement will go to standard output, * right file descriptor.
* or any of the log files. */
* IN Dbg_Module Module: debug will go in the name of this module
*
* Description:
* This function checks if the module is turned on for debug
* and returns the file descriptor corresponding to the debug level
* Returns: FILE *
* NULL : if the module is turn off for debug
* else returns the right file descriptor
***************************************************************************/
#ifdef DEBUG #ifdef DEBUG
FILE *UpnpGetDebugFile(Upnp_LogLevel level, Dbg_Module module); FILE *UpnpGetDebugFile(
/*! [in] The level of the debug logging. It will decide whether debug
* statement will go to standard output, or any of the log files. */
Upnp_LogLevel level,
/*! [in] debug will go in the name of this module. */
Dbg_Module module);
#else #else
static UPNP_INLINE FILE *UpnpGetDebugFile(Upnp_LogLevel level, Dbg_Module module) static UPNP_INLINE FILE *UpnpGetDebugFile(Upnp_LogLevel level, Dbg_Module module)
{ {
@ -203,36 +176,32 @@ static UPNP_INLINE FILE *UpnpGetDebugFile(Upnp_LogLevel level, Dbg_Module module
#endif #endif
/*************************************************************************** /*!
* Function : DebugAtThisLevel * \brief Returns true if debug output should be done in this module.
*
* Parameters:
* IN Upnp_LogLevel DLevel: The level of the debug logging. It will decide
* whether debug statement will go to standard output,
* or any of the log files.
* IN Dbg_Module Module: debug will go in the name of this module
*
* Description:
* This functions returns true if debug output should be done in this
* module.
* *
* Returns: int * \return Nonzero value if true, zero if false.
***************************************************************************/ */
#ifdef DEBUG #ifdef DEBUG
int DebugAtThisLevel( int DebugAtThisLevel(
IN Upnp_LogLevel DLevel, /*! [in] The level of the debug logging. It will decide whether debug
IN Dbg_Module Module); * statement will go to standard output, or any of the log files. */
Upnp_LogLevel DLevel,
/*! [in] Debug will go in the name of this module. */
Dbg_Module Module);
#else #else
static UPNP_INLINE int DebugAtThisLevel( static UPNP_INLINE int DebugAtThisLevel(
IN Upnp_LogLevel DLevel, Upnp_LogLevel DLevel,
IN Dbg_Module Module) { return 0; } Dbg_Module Module)
{
return 0;
}
#endif #endif
/*! /*!
* \brief Prints the debug statement either on the standard output or log file * \brief Prints the debug statement either on the standard output or log file
* along with the information from where this debug statement is coming. * along with the information from where this debug statement is coming.
**/ */
#ifdef DEBUG #ifdef DEBUG
void UpnpPrintf( void UpnpPrintf(
/*! [in] The level of the debug logging. It will decide whether debug /*! [in] The level of the debug logging. It will decide whether debug
@ -261,28 +230,23 @@ static UPNP_INLINE void UpnpPrintf(
const char* DbgFileName, const char* DbgFileName,
int DbgLineNo, int DbgLineNo,
const char* FmtStr, const char* FmtStr,
...) {} ...)
{
}
#endif /* DEBUG */ #endif /* DEBUG */
/*************************************************************************** /*!
* Function : UpnpDisplayFileAndLine * \brief Writes the file name and file number from where debug statement is
* * coming to the log file.
* Parameters: */
* IN FILE *fd: File descriptor where line number and file name will be
* written
* IN char *DbgFileName: Name of the file
* IN int DbgLineNo : Line number of the file
*
* Description:
* This function writes the file name and file number from where
* debug statement is coming to the log file
* Returns: void
***************************************************************************/
#ifdef DEBUG #ifdef DEBUG
void UpnpDisplayFileAndLine( void UpnpDisplayFileAndLine(
/*! [in] File descriptor where line number and file name will be written. */
FILE *fd, FILE *fd,
/*! [in] Name of the file. */
const char *DbgFileName, const char *DbgFileName,
/*! [in] Line number of the file. */
int DbgLineNo); int DbgLineNo);
#else #else
static UPNP_INLINE void UpnpDisplayFileAndLine( static UPNP_INLINE void UpnpDisplayFileAndLine(
@ -292,18 +256,18 @@ static UPNP_INLINE void UpnpDisplayFileAndLine(
#endif #endif
/*! \brief Writes the buffer in the file as per the requested banner /*!
* * \brief Writes the buffer in the file as per the requested banner
* \param [in] fd file descriptor where the banner will be written
* \param [in] lines: The buffer that will be written
* \param [in] size: Size of the buffer
* \param [in] starlength: This parameter provides the width of the banner
*/ */
#ifdef DEBUG #ifdef DEBUG
void UpnpDisplayBanner( void UpnpDisplayBanner(
/*! [in] file descriptor where the banner will be written. */
FILE *fd, FILE *fd,
/*! [in] The buffer that will be written. */
const char **lines, const char **lines,
/*! [in] Size of the buffer. */
size_t size, size_t size,
/*! [in] This parameter provides the width of the banner. */
int starlength); int starlength);
#else #else
static UPNP_INLINE void UpnpDisplayBanner( static UPNP_INLINE void UpnpDisplayBanner(
@ -314,27 +278,27 @@ static UPNP_INLINE void UpnpDisplayBanner(
#endif #endif
/*! \brief Prints thread pool statistics. /*!
* * \brief Prints thread pool statistics.
* \param [in] tp The thread pool
* \param [in] DbgFileName the file name that called this function, use the
* macro __FILE__.
* \param [in] DbgLineNo the line number that the function was called, use
* the macro __LINE__.
* \param [in] msg message.
*/ */
#ifdef DEBUG #ifdef DEBUG
void PrintThreadPoolStats( void PrintThreadPoolStats(
/* [in] The thread pool. */
ThreadPool *tp, ThreadPool *tp,
/* [in] The file name that called this function, use the macro __FILE__. */
const char *DbgFileName, const char *DbgFileName,
/* [in] The line number that the function was called, use the macro __LINE__. */
int DbgLineNo, int DbgLineNo,
/* [in] The message. */
const char *msg); const char *msg);
#else #else
static UPNP_INLINE void PrintThreadPoolStats( static UPNP_INLINE void PrintThreadPoolStats(
ThreadPool *tp, ThreadPool *tp,
const char *DbgFileName, const char *DbgFileName,
int DbgLineNo, int DbgLineNo,
const char *msg) {} const char *msg)
{
}
#endif #endif

File diff suppressed because it is too large Load Diff

View File

@ -44,138 +44,77 @@
//Mutex to synchronize all the log file opeartions in the debug mode /*! Mutex to synchronize all the log file opeartions in the debug mode */
static ithread_mutex_t GlobalDebugMutex; static ithread_mutex_t GlobalDebugMutex;
// Global log level /*! Global log level */
static Upnp_LogLevel g_log_level = UPNP_DEFAULT_LOG_LEVEL; static Upnp_LogLevel g_log_level = UPNP_DEFAULT_LOG_LEVEL;
//File handle for the error log file /*! File handle for the error log file */
static FILE *ErrFileHnd = NULL; static FILE *ErrFileHnd = NULL;
//File handle for the information log file /*! File handle for the information log file */
static FILE *InfoFileHnd = NULL; static FILE *InfoFileHnd = NULL;
//Name of the error file /*! Name of the error file */
static const char *errFileName = "IUpnpErrFile.txt"; static const char *errFileName = "IUpnpErrFile.txt";
//Name of the info file /*! Name of the info file */
static const char *infoFileName = "IUpnpInfoFile.txt"; static const char *infoFileName = "IUpnpInfoFile.txt";
#ifdef DEBUG #ifdef DEBUG
/*************************************************************************** int UpnpInitLog()
* Function : UpnpSetLogFileNames
*
* Parameters:
* IN const char* ErrFileName: name of the error file
* IN const char *InfoFileName: name of the information file
* IN int size: Size of the buffer
* IN int starLength: This parameter provides the width of the banner
*
* Description:
* This functions takes the buffer and writes the buffer in the file as
* per the requested banner
* Returns: void
***************************************************************************/
void
UpnpSetLogFileNames ( IN const char *ErrFileName,
IN const char *InfoFileName )
{ {
if( ErrFileName ) { ithread_mutex_init(&GlobalDebugMutex, NULL);
errFileName = ErrFileName; if(DEBUG_TARGET == 1) {
} if((ErrFileHnd = fopen( errFileName, "a")) == NULL) {
if( InfoFileName ) { return -1;
infoFileName = InfoFileName; }
} if((InfoFileHnd = fopen( infoFileName, "a")) == NULL) {
return -1;
}
}
return UPNP_E_SUCCESS;
} }
/*************************************************************************** void UpnpSetLogLevel(Upnp_LogLevel log_level)
* Function : UpnpInitLog
*
* Parameters: void
*
* Description:
* This functions initializes the log files
*
* Returns: int
* -1 : If fails
* UPNP_E_SUCCESS : if success
***************************************************************************/
int
UpnpInitLog()
{
ithread_mutex_init( &GlobalDebugMutex, NULL );
if( DEBUG_TARGET == 1 ) {
if( ( ErrFileHnd = fopen( errFileName, "a" ) ) == NULL )
return -1;
if( ( InfoFileHnd = fopen( infoFileName, "a" ) ) == NULL )
return -1;
}
return UPNP_E_SUCCESS;
}
/***************************************************************************
* Function : UpnpSetLogLevel
*
* Parameters: Upnp_LogLevel log_level
*
* Description:
* This functions set the log level (see {\tt Upnp_LogLevel}
* Returns: void
***************************************************************************/
void
UpnpSetLogLevel (Upnp_LogLevel log_level)
{ {
g_log_level = log_level; g_log_level = log_level;
} }
/*************************************************************************** void UpnpCloseLog()
* Function : UpnpCloseLog
*
* Parameters: void
*
* Description:
* This functions closes the log files
* Returns: void
***************************************************************************/
void
UpnpCloseLog()
{ {
if( DEBUG_TARGET == 1 ) { if (DEBUG_TARGET == 1) {
fflush( ErrFileHnd ); fflush(ErrFileHnd);
fflush( InfoFileHnd ); fflush(InfoFileHnd);
fclose( ErrFileHnd ); fclose(ErrFileHnd);
fclose( InfoFileHnd ); fclose(InfoFileHnd);
} }
ithread_mutex_destroy( &GlobalDebugMutex ); ithread_mutex_destroy(&GlobalDebugMutex);
} }
#endif // DEBUG
/***************************************************************************
* Function : DebugAtThisLevel void UpnpSetLogFileNames(
* const char *ErrFileName,
* Parameters: const char *InfoFileName)
* IN Upnp_LogLevel DLevel: The level of the debug logging. It will decide {
* whether debug statement will go to standard output, if (ErrFileName) {
* or any of the log files. errFileName = ErrFileName;
* IN Dbg_Module Module: debug will go in the name of this module }
* if (InfoFileName) {
* Description: infoFileName = InfoFileName;
* This functions returns true if debug output should be done in this }
* module. }
* #endif /* DEBUG */
* Returns: int
***************************************************************************/
#ifdef DEBUG #ifdef DEBUG
int DebugAtThisLevel( int DebugAtThisLevel(
IN Upnp_LogLevel DLevel, Upnp_LogLevel DLevel,
IN Dbg_Module Module) Dbg_Module Module)
{ {
int ret = DLevel <= g_log_level; int ret = DLevel <= g_log_level;
ret &= ret &=
@ -195,12 +134,12 @@ int DebugAtThisLevel(
#ifdef DEBUG #ifdef DEBUG
void UpnpPrintf( void UpnpPrintf(
IN Upnp_LogLevel DLevel, Upnp_LogLevel DLevel,
IN Dbg_Module Module, Dbg_Module Module,
IN const char *DbgFileName, const char *DbgFileName,
IN int DbgLineNo, int DbgLineNo,
IN const char *FmtStr, const char *FmtStr,
... ) ...)
{ {
va_list ArgList; va_list ArgList;
@ -235,24 +174,8 @@ void UpnpPrintf(
#endif #endif
/***************************************************************************
* Function : UpnpGetDebugFile
*
* Parameters:
* IN Upnp_LogLevel DLevel: The level of the debug logging. It will decide
* whether debug statement will go to standard output,
* or any of the log files.
* IN Dbg_Module Module: debug will go in the name of this module
*
* Description:
* This function checks if the module is turned on for debug
* and returns the file descriptor corresponding to the debug level
* Returns: FILE *
* NULL : if the module is turn off for debug
* else returns the right file descriptor
***************************************************************************/
#ifdef DEBUG #ifdef DEBUG
FILE *GetDebugFile( Upnp_LogLevel DLevel, Dbg_Module Module ) FILE *GetDebugFile(Upnp_LogLevel DLevel, Dbg_Module Module)
{ {
FILE *ret; FILE *ret;
@ -273,25 +196,11 @@ FILE *GetDebugFile( Upnp_LogLevel DLevel, Dbg_Module Module )
#endif #endif
/***************************************************************************
* Function : UpnpDisplayFileAndLine
*
* Parameters:
* IN FILE *fd: File descriptor where line number and file name will be
* written
* IN char *DbgFileName: Name of the file
* IN int DbgLineNo : Line number of the file
*
* Description:
* This function writes the file name and file number from where
* debug statement is coming to the log file
* Returns: void
***************************************************************************/
#ifdef DEBUG #ifdef DEBUG
void UpnpDisplayFileAndLine( void UpnpDisplayFileAndLine(
IN FILE * fd, FILE *fd,
IN const char *DbgFileName, const char *DbgFileName,
IN int DbgLineNo) int DbgLineNo)
{ {
#define NLINES 2 #define NLINES 2
#define MAX_LINE_SIZE 512 #define MAX_LINE_SIZE 512
@ -329,10 +238,10 @@ void UpnpDisplayFileAndLine(
#ifdef DEBUG #ifdef DEBUG
void UpnpDisplayBanner( void UpnpDisplayBanner(
IN FILE * fd, FILE * fd,
IN const char **lines, const char **lines,
IN size_t size, size_t size,
IN int starLength) int starLength)
{ {
int leftMarginLength = starLength / 2 + 1; int leftMarginLength = starLength / 2 + 1;
int rightMarginLength = starLength / 2 + 1; int rightMarginLength = starLength / 2 + 1;
@ -373,12 +282,12 @@ void UpnpDisplayBanner(
rightMargin[rightMarginLength] = 0; rightMargin[rightMarginLength] = 0;
fprintf( fd, "*%s%s%s*\n", leftMargin, line, rightMargin ); fprintf( fd, "*%s%s%s*\n", leftMargin, line, rightMargin );
} }
fprintf( fd, "%s\n\n", stars ); fprintf(fd, "%s\n\n", stars);
free( currentLine ); free(currentLine);
free( stars ); free(stars);
free( rightMargin ); free(rightMargin);
free( leftMargin ); free(leftMargin);
} }
#endif #endif

View File

@ -383,7 +383,7 @@ static int gena_subscribe(
} }
int genaUnregisterClient(IN UpnpClient_Handle client_handle) int genaUnregisterClient(UpnpClient_Handle client_handle)
{ {
ClientSubscription *sub_copy = UpnpClientSubscription_new(); ClientSubscription *sub_copy = UpnpClientSubscription_new();
int return_code = UPNP_E_SUCCESS; int return_code = UPNP_E_SUCCESS;
@ -430,8 +430,8 @@ exit_function:
#ifdef INCLUDE_CLIENT_APIS #ifdef INCLUDE_CLIENT_APIS
int genaUnSubscribe( int genaUnSubscribe(
IN UpnpClient_Handle client_handle, UpnpClient_Handle client_handle,
IN const UpnpString *in_sid) const UpnpString *in_sid)
{ {
ClientSubscription *sub = NULL; ClientSubscription *sub = NULL;
int return_code = GENA_SUCCESS; int return_code = GENA_SUCCESS;
@ -482,10 +482,10 @@ exit_function:
#ifdef INCLUDE_CLIENT_APIS #ifdef INCLUDE_CLIENT_APIS
int genaSubscribe( int genaSubscribe(
IN UpnpClient_Handle client_handle, UpnpClient_Handle client_handle,
IN const UpnpString *PublisherURL, const UpnpString *PublisherURL,
INOUT int *TimeOut, int *TimeOut,
OUT UpnpString *out_sid) UpnpString *out_sid)
{ {
int return_code = GENA_SUCCESS; int return_code = GENA_SUCCESS;
ClientSubscription *newSubscription = UpnpClientSubscription_new(); ClientSubscription *newSubscription = UpnpClientSubscription_new();
@ -564,9 +564,9 @@ error_handler:
int genaRenewSubscription( int genaRenewSubscription(
IN UpnpClient_Handle client_handle, UpnpClient_Handle client_handle,
IN const UpnpString *in_sid, const UpnpString *in_sid,
INOUT int *TimeOut) int *TimeOut)
{ {
int return_code = GENA_SUCCESS; int return_code = GENA_SUCCESS;
ClientSubscription *sub = NULL; ClientSubscription *sub = NULL;
@ -662,8 +662,8 @@ exit_function:
void gena_process_notification_event( void gena_process_notification_event(
IN SOCKINFO *info, SOCKINFO *info,
IN http_message_t *event) http_message_t *event)
{ {
UpnpEvent *event_struct = UpnpEvent_new(); UpnpEvent *event_struct = UpnpEvent_new();
IXML_Document *ChangedVars = NULL; IXML_Document *ChangedVars = NULL;

View File

@ -61,7 +61,7 @@
*/ */
int genaUnregisterDevice( int genaUnregisterDevice(
/*! [in] Device handle. */ /*! [in] Device handle. */
IN UpnpDevice_Handle device_handle) UpnpDevice_Handle device_handle)
{ {
int ret = 0; int ret = 0;
struct Handle_Info *handle_info; struct Handle_Info *handle_info;
@ -92,13 +92,13 @@ int genaUnregisterDevice(
*/ */
static int GeneratePropertySet( static int GeneratePropertySet(
/*! [in] Array of variable names (go in the event notify). */ /*! [in] Array of variable names (go in the event notify). */
IN char **names, char **names,
/*! [in] Array of variable values (go in the event notify). */ /*! [in] Array of variable values (go in the event notify). */
IN char **values, char **values,
/*! [in] number of variables. */ /*! [in] number of variables. */
IN int count, int count,
/*! [out] PropertySet node in the string format. */ /*! [out] PropertySet node in the string format. */
OUT DOMString *out) DOMString *out)
{ {
char *buffer; char *buffer;
int counter = 0; int counter = 0;
@ -147,7 +147,7 @@ static int GeneratePropertySet(
*/ */
static void free_notify_struct( static void free_notify_struct(
/*! [in] Notify structure. */ /*! [in] Notify structure. */
IN notify_thread_struct *input) notify_thread_struct *input)
{ {
( *input->reference_count )--; ( *input->reference_count )--;
if( ( *input->reference_count ) == 0 ) { if( ( *input->reference_count ) == 0 ) {
@ -170,13 +170,13 @@ static void free_notify_struct(
*/ */
static UPNP_INLINE int notify_send_and_recv( static UPNP_INLINE int notify_send_and_recv(
/*! [in] subscription callback URL (URL of the control point). */ /*! [in] subscription callback URL (URL of the control point). */
IN uri_type *destination_url, uri_type *destination_url,
/*! [in] Common HTTP headers. */ /*! [in] Common HTTP headers. */
IN membuffer *mid_msg, membuffer *mid_msg,
/*! [in] The evented XML. */ /*! [in] The evented XML. */
IN char *propertySet, char *propertySet,
/*! [out] The response from the control point. */ /*! [out] The response from the control point. */
OUT http_parser_t *response) http_parser_t *response)
{ {
uri_type url; uri_type url;
int conn_fd; int conn_fd;
@ -258,11 +258,11 @@ static UPNP_INLINE int notify_send_and_recv(
*/ */
static int genaNotify( static int genaNotify(
/*! [in] Null terminated, includes all headers (including \\r\\n) except SID and SEQ. */ /*! [in] Null terminated, includes all headers (including \\r\\n) except SID and SEQ. */
IN char *headers, char *headers,
/*! [in] The evented XML. */ /*! [in] The evented XML. */
IN char *propertySet, char *propertySet,
/*! [in] subscription to be Notified, assumes this is valid for life of function. */ /*! [in] subscription to be Notified, assumes this is valid for life of function. */
IN subscription *sub) subscription *sub)
{ {
int i; int i;
membuffer mid_msg; membuffer mid_msg;
@ -326,7 +326,7 @@ static int genaNotify(
*/ */
static void genaNotifyThread( static void genaNotifyThread(
/*! [in] notify thread structure containing all the headers and property set info. */ /*! [in] notify thread structure containing all the headers and property set info. */
IN void *input) void *input)
{ {
subscription *sub; subscription *sub;
service_info *service; service_info *service;
@ -406,13 +406,13 @@ static void genaNotifyThread(
int genaInitNotify( int genaInitNotify(
IN UpnpDevice_Handle device_handle, UpnpDevice_Handle device_handle,
IN char *UDN, char *UDN,
IN char *servId, char *servId,
IN char **VarNames, char **VarNames,
IN char **VarValues, char **VarValues,
IN int var_count, int var_count,
IN const Upnp_SID sid) const Upnp_SID sid)
{ {
int ret = GENA_SUCCESS; int ret = GENA_SUCCESS;
int line = 0; int line = 0;
@ -574,11 +574,11 @@ ExitFunction:
int genaInitNotifyExt( int genaInitNotifyExt(
IN UpnpDevice_Handle device_handle, UpnpDevice_Handle device_handle,
IN char *UDN, char *UDN,
IN char *servId, char *servId,
IN IXML_Document *PropSet, IXML_Document *PropSet,
IN const Upnp_SID sid) const Upnp_SID sid)
{ {
int ret = GENA_SUCCESS; int ret = GENA_SUCCESS;
int line = 0; int line = 0;
@ -669,10 +669,10 @@ int genaInitNotifyExt(
propertySet); propertySet);
headers_size = headers_size =
strlen( "CONTENT-TYPE text/xml\r\n" ) + strlen("CONTENT-TYPE text/xml\r\n") +
strlen( "CONTENT-LENGTH: \r\n" ) + MAX_CONTENT_LENGTH + strlen("CONTENT-LENGTH: \r\n") + MAX_CONTENT_LENGTH +
strlen( "NT: upnp:event\r\n" ) + strlen("NT: upnp:event\r\n") +
strlen( "NTS: upnp:propchange\r\n" ) + 1; strlen("NTS: upnp:propchange\r\n") + 1;
headers = (char *)malloc(headers_size); headers = (char *)malloc(headers_size);
if (headers == NULL) { if (headers == NULL) {
line = __LINE__; line = __LINE__;
@ -741,10 +741,10 @@ ExitFunction:
int genaNotifyAllExt( int genaNotifyAllExt(
IN UpnpDevice_Handle device_handle, UpnpDevice_Handle device_handle,
IN char *UDN, char *UDN,
IN char *servId, char *servId,
IN IXML_Document *PropSet) IXML_Document *PropSet)
{ {
int ret = GENA_SUCCESS; int ret = GENA_SUCCESS;
int line = 0; int line = 0;
@ -891,12 +891,12 @@ ExitFunction:
int genaNotifyAll( int genaNotifyAll(
IN UpnpDevice_Handle device_handle, UpnpDevice_Handle device_handle,
IN char *UDN, char *UDN,
IN char *servId, char *servId,
IN char **VarNames, char **VarNames,
IN char **VarValues, char **VarValues,
IN int var_count ) int var_count )
{ {
int ret = GENA_SUCCESS; int ret = GENA_SUCCESS;
int line = 0; int line = 0;
@ -1049,13 +1049,13 @@ ExitFunction:
*/ */
static int respond_ok( static int respond_ok(
/*! [in] Socket connection of request. */ /*! [in] Socket connection of request. */
IN SOCKINFO *info, SOCKINFO *info,
/*! [in] Accepted duration. */ /*! [in] Accepted duration. */
IN int time_out, int time_out,
/*! [in] Accepted subscription. */ /*! [in] Accepted subscription. */
IN subscription *sub, subscription *sub,
/*! [in] Http request. */ /*! [in] Http request. */
IN http_message_t *request) http_message_t *request)
{ {
int major; int major;
int minor; int minor;
@ -1109,9 +1109,9 @@ static int respond_ok(
*/ */
static int create_url_list( static int create_url_list(
/*! [in] . */ /*! [in] . */
IN memptr *url_list, memptr *url_list,
/*! [out] . */ /*! [out] . */
OUT URL_list *out) URL_list *out)
{ {
int URLcount = 0; int URLcount = 0;
int i; int i;
@ -1185,8 +1185,8 @@ static int create_url_list(
void gena_process_subscription_request( void gena_process_subscription_request(
IN SOCKINFO *info, SOCKINFO *info,
IN http_message_t *request) http_message_t *request)
{ {
UpnpSubscriptionRequest *request_struct = UpnpSubscriptionRequest_new(); UpnpSubscriptionRequest *request_struct = UpnpSubscriptionRequest_new();
Upnp_SID temp_sid; Upnp_SID temp_sid;
@ -1368,8 +1368,8 @@ exit_function:
void gena_process_subscription_renewal_request( void gena_process_subscription_renewal_request(
IN SOCKINFO *info, SOCKINFO *info,
IN http_message_t *request) http_message_t *request)
{ {
Upnp_SID sid; Upnp_SID sid;
subscription *sub; subscription *sub;
@ -1480,8 +1480,8 @@ void gena_process_subscription_renewal_request(
void gena_process_unsubscribe_request( void gena_process_unsubscribe_request(
IN SOCKINFO *info, SOCKINFO *info,
IN http_message_t *request) http_message_t *request)
{ {
Upnp_SID sid; Upnp_SID sid;
service_info *service; service_info *service;

File diff suppressed because it is too large Load Diff

View File

@ -161,11 +161,11 @@ typedef struct NOTIFY_THREAD_STRUCT {
*/ */
EXTERN_C void genaCallback( EXTERN_C void genaCallback(
/*! [in] represents the parse state of the request */ /*! [in] represents the parse state of the request */
IN http_parser_t *parser, http_parser_t *parser,
/*! [in] HTTP message containing GENA request */ /*! [in] HTTP message containing GENA request */
IN http_message_t* request, http_message_t* request,
/*! [in,out] Structure containing information about the socket */ /*! [in,out] Structure containing information about the socket */
IN SOCKINFO *info); SOCKINFO *info);
/*! /*!
@ -181,16 +181,16 @@ EXTERN_C void genaCallback(
#ifdef INCLUDE_CLIENT_APIS #ifdef INCLUDE_CLIENT_APIS
EXTERN_C int genaSubscribe( EXTERN_C int genaSubscribe(
/*! [in] The client handle. */ /*! [in] The client handle. */
IN UpnpClient_Handle client_handle, UpnpClient_Handle client_handle,
/*! [in] Of the form: "http://134.134.156.80:4000/RedBulb/Event */ /*! [in] Of the form: "http://134.134.156.80:4000/RedBulb/Event */
IN const UpnpString *PublisherURL, const UpnpString *PublisherURL,
/*! [in,out] requested Duration: /*! [in,out] requested Duration:
* \li if -1, then "infinite". * \li if -1, then "infinite".
* \li in the OUT case: actual Duration granted by Service, * \li in the OUT case: actual Duration granted by Service,
* -1 for infinite. */ * -1 for infinite. */
INOUT int *TimeOut, int *TimeOut,
/*! [out] sid of subscription, memory passed in by caller. */ /*! [out] sid of subscription, memory passed in by caller. */
OUT UpnpString *out_sid); UpnpString *out_sid);
#endif /* INCLUDE_CLIENT_APIS */ #endif /* INCLUDE_CLIENT_APIS */
@ -207,9 +207,9 @@ EXTERN_C int genaSubscribe(
#ifdef INCLUDE_CLIENT_APIS #ifdef INCLUDE_CLIENT_APIS
EXTERN_C int genaUnSubscribe( EXTERN_C int genaUnSubscribe(
/*! [in] UPnP client handle. */ /*! [in] UPnP client handle. */
IN UpnpClient_Handle client_handle, UpnpClient_Handle client_handle,
/*! [in] The subscription ID. */ /*! [in] The subscription ID. */
IN const UpnpString *in_sid); const UpnpString *in_sid);
#endif /* INCLUDE_CLIENT_APIS */ #endif /* INCLUDE_CLIENT_APIS */
@ -259,12 +259,12 @@ EXTERN_C int genaUnregisterDevice(
#ifdef INCLUDE_CLIENT_APIS #ifdef INCLUDE_CLIENT_APIS
EXTERN_C int genaRenewSubscription( EXTERN_C int genaRenewSubscription(
/*! [in] Client handle. */ /*! [in] Client handle. */
IN UpnpClient_Handle client_handle, UpnpClient_Handle client_handle,
/*! [in] Subscription ID. */ /*! [in] Subscription ID. */
IN const UpnpString *in_sid, const UpnpString *in_sid,
/*! [out] requested Duration, if -1, then "infinite". In the OUT case: /*! [in,out] requested Duration, if -1, then "infinite". In the OUT case:
* actual Duration granted by Service, -1 for infinite. */ * actual Duration granted by Service, -1 for infinite. */
OUT int * TimeOut); int *TimeOut);
#endif /* INCLUDE_CLIENT_APIS */ #endif /* INCLUDE_CLIENT_APIS */
@ -310,7 +310,7 @@ EXTERN_C int genaNotifyAllExt(
/*! [in] Service ID. */ /*! [in] Service ID. */
char *servId, char *servId,
/*! [in] XML document Event varible property set. */ /*! [in] XML document Event varible property set. */
IN IXML_Document *PropSet); IXML_Document *PropSet);
#endif /* INCLUDE_DEVICE_APIS */ #endif /* INCLUDE_DEVICE_APIS */
@ -325,19 +325,19 @@ EXTERN_C int genaNotifyAllExt(
#ifdef INCLUDE_DEVICE_APIS #ifdef INCLUDE_DEVICE_APIS
EXTERN_C int genaInitNotify( EXTERN_C int genaInitNotify(
/*! [in] Device handle. */ /*! [in] Device handle. */
IN UpnpDevice_Handle device_handle, UpnpDevice_Handle device_handle,
/*! [in] Device udn. */ /*! [in] Device udn. */
IN char *UDN, char *UDN,
/*! [in] Service ID. */ /*! [in] Service ID. */
IN char *servId, char *servId,
/*! [in] Array of variable names. */ /*! [in] Array of variable names. */
IN char **VarNames, char **VarNames,
/*! [in] Array of variable values. */ /*! [in] Array of variable values. */
IN char **VarValues, char **VarValues,
/*! [in] Array size. */ /*! [in] Array size. */
IN int var_count, int var_count,
/*! [in] Subscription ID. */ /*! [in] Subscription ID. */
IN const Upnp_SID sid); const Upnp_SID sid);
#endif /* INCLUDE_DEVICE_APIS */ #endif /* INCLUDE_DEVICE_APIS */
@ -354,15 +354,15 @@ EXTERN_C int genaInitNotify(
#ifdef INCLUDE_DEVICE_APIS #ifdef INCLUDE_DEVICE_APIS
EXTERN_C int genaInitNotifyExt( EXTERN_C int genaInitNotifyExt(
/*! [in] Device handle. */ /*! [in] Device handle. */
IN UpnpDevice_Handle device_handle, UpnpDevice_Handle device_handle,
/*! [in] Device udn. */ /*! [in] Device udn. */
IN char *UDN, char *UDN,
/*! [in] Service ID. */ /*! [in] Service ID. */
IN char *servId, char *servId,
/*! [in] Document of the state table. */ /*! [in] Document of the state table. */
IN IXML_Document *PropSet, IXML_Document *PropSet,
/*! [in] subscription ID. */ /*! [in] subscription ID. */
IN const Upnp_SID sid); const Upnp_SID sid);
#endif /* INCLUDE_DEVICE_APIS */ #endif /* INCLUDE_DEVICE_APIS */
@ -374,11 +374,11 @@ EXTERN_C int genaInitNotifyExt(
*/ */
void error_respond( void error_respond(
/*! [in] Structure containing information about the socket. */ /*! [in] Structure containing information about the socket. */
IN SOCKINFO *info, SOCKINFO *info,
/*! [in] error code that will be in the GENA response. */ /*! [in] error code that will be in the GENA response. */
IN int error_code, int error_code,
/*! [in] GENA request Packet. */ /*! [in] GENA request Packet. */
IN http_message_t* hmsg); http_message_t* hmsg);
#endif /* GENA_H */ #endif /* GENA_H */

View File

@ -55,9 +55,9 @@
*/ */
void gena_process_notification_event( void gena_process_notification_event(
/*! [in] Socket info of the device. */ /*! [in] Socket info of the device. */
IN SOCKINFO *info, SOCKINFO *info,
/*! [in] The http message contains the GENA notification. */ /*! [in] The http message contains the GENA notification. */
IN http_message_t *event); http_message_t *event);
#endif /* GENA_CTRLPT_H */ #endif /* GENA_CTRLPT_H */

View File

@ -48,9 +48,9 @@
*/ */
void gena_process_subscription_request( void gena_process_subscription_request(
/*! [in] Socket info of the device. */ /*! [in] Socket info of the device. */
IN SOCKINFO *info, SOCKINFO *info,
/*! [in] Subscription request from the control point. */ /*! [in] Subscription request from the control point. */
IN http_message_t *request); http_message_t *request);
/*! /*!
@ -59,9 +59,9 @@ void gena_process_subscription_request(
*/ */
void gena_process_subscription_renewal_request( void gena_process_subscription_renewal_request(
/*! [in] Socket info of the device. */ /*! [in] Socket info of the device. */
IN SOCKINFO *info, SOCKINFO *info,
/*! [in] Subscription renewal request from the control point. */ /*! [in] Subscription renewal request from the control point. */
IN http_message_t *request); http_message_t *request);
/*! /*!
@ -70,9 +70,9 @@ void gena_process_subscription_renewal_request(
*/ */
void gena_process_unsubscribe_request( void gena_process_unsubscribe_request(
/*! [in] Socket info of the device. */ /*! [in] Socket info of the device. */
IN SOCKINFO *info, SOCKINFO *info,
/*! [in] UNSUBSCRIBE request from the control point. */ /*! [in] UNSUBSCRIBE request from the control point. */
IN http_message_t *request); http_message_t *request);
#endif /* GENA_DEVICE_H */ #endif /* GENA_DEVICE_H */

View File

@ -70,81 +70,62 @@ typedef void (*MiniServerCallback)(
extern "C" { extern "C" {
#endif #endif
/************************************************************************
* Function: SetHTTPGetCallback
*
* Parameters:
* MiniServerCallback callback; - HTTP Callback to be invoked
*
* Description: Set HTTP Get Callback
*
* Return: void
************************************************************************/
void SetHTTPGetCallback( MiniServerCallback callback );
/************************************************************************ /*!
* Function: SetSoapCallback * \brief Set HTTP Get Callback.
* */
* Parameters: void SetHTTPGetCallback(
* MiniServerCallback callback; - SOAP Callback to be invoked /*! [in] HTTP Callback to be invoked . */
* MiniServerCallback callback);
* Description: Set SOAP Callback
*
* Return: void /*!
************************************************************************/ * \brief Set SOAP Callback.
*/
#ifdef INCLUDE_DEVICE_APIS #ifdef INCLUDE_DEVICE_APIS
void SetSoapCallback( MiniServerCallback callback ); void SetSoapCallback(
/*! [in] SOAP Callback to be invoked . */
MiniServerCallback callback);
#else /* INCLUDE_DEVICE_APIS */ #else /* INCLUDE_DEVICE_APIS */
static inline void SetSoapCallback( MiniServerCallback callback ) {} static inline void SetSoapCallback(MiniServerCallback callback) {}
#endif /* INCLUDE_DEVICE_APIS */ #endif /* INCLUDE_DEVICE_APIS */
/************************************************************************
* Function: SetGenaCallback
*
* Parameters:
* MiniServerCallback callback; - GENA Callback to be invoked
*
* D6escription: Set GENA Callback
*
* Return: void
************************************************************************/
void SetGenaCallback( MiniServerCallback callback );
/************************************************************************ /*!
* Function: StartMiniServer * \brief Set GENA Callback.
* */
* Parameters: void SetGenaCallback(
* IN OUT unsigned short *listen_port4 ; Port on which the server /*! [in] GENA Callback to be invoked. */
* listens for incoming IPv4 connections. MiniServerCallback callback);
* IN OUT unsigned short *listen_port6 ; Port on which the server
* listens for incoming IPv6 connections.
*
* Description: Initialize the sockets functionality for the
* Miniserver. Initialize a thread pool job to run the MiniServer
* and the job to the thread pool. If listen port is 0, port is
* dynamically picked
*
* Use timer mechanism to start the MiniServer, failure to meet the
* allowed delay aborts the attempt to launch the MiniServer.
*
* Return: int;
* On success: UPNP_E_SUCCESS
* On error: UPNP_E_XXX
************************************************************************/
int StartMiniServer( IN OUT unsigned short* listen_port4,
IN OUT unsigned short* listen_port6 );
/************************************************************************
* Function: StopMiniServer /*!
* \brief Initialize the sockets functionality for the Miniserver.
* *
* Parameters: * Initialize a thread pool job to run the MiniServer and the job to the
* void; * thread pool.
* *
* Description: Stop and Shutdown the MiniServer and free socket resources. * If listen port is 0, port is dynamically picked.
* *
* Return : int; * Use timer mechanism to start the MiniServer, failure to meet the
* Always returns 0 * allowed delay aborts the attempt to launch the MiniServer.
************************************************************************/ *
* \return
* \li On success: UPNP_E_SUCCESS.
* \li On error: UPNP_E_XXX.
*/
int StartMiniServer(
/*! [in,out] Port on which the server listens for incoming IPv4 connections. */
unsigned short *listen_port4,
/*! [in,out] Port on which the server listens for incoming IPv6 connections. */
unsigned short *listen_port6);
/*!
* \brief Stop and Shutdown the MiniServer and free socket resources.
*
* \return Always returns 0.
*/
int StopMiniServer(); int StopMiniServer();

View File

@ -352,7 +352,7 @@ void UpnpThreadDistribution(struct UpnpNonblockParam * Param);
/*! /*!
* \brief This function is a timer thread scheduled by UpnpSendAdvertisement * \brief This function is a timer thread scheduled by UpnpSendAdvertisement
* to the send advetisement again. * to the send advetisement again.
*/ */
void AutoAdvertise( void AutoAdvertise(
/*! [in] Information provided to the thread. */ /*! [in] Information provided to the thread. */