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;
/*! 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
* is valid only during the callback and should be copied if it
* 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
* 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.
*/
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 */
@ -1037,7 +1044,7 @@ EXPORT_SPEC int UpnpRegisterRootDevice2(
* the description is served using the internal web server. */
int config_baseURL,
/*! [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
* invoked. */
const void* Cookie,
@ -1224,6 +1231,10 @@ EXPORT_SPEC int UpnpSetMaxContentLength(
* matching root device, device, or service. The application specifies the
* 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
* instance issued a particular search. Therefore, the client can get
* search callbacks that do not match the original criteria of the search.
@ -1237,17 +1248,17 @@ EXPORT_SPEC int UpnpSetMaxContentLength(
*/
EXPORT_SPEC int UpnpSearchAsync(
/*! 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
* 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
* \c MIN_SEARCH_TIME. */
IN int Mx,
int Mx,
/*! The search target as defined in the UPnP Device Architecture v1.0
* specification. */
IN const char *Target,
const char *TTarget_constarget_const,
/*! 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
@ -1266,9 +1277,9 @@ EXPORT_SPEC int UpnpSearchAsync(
*/
EXPORT_SPEC int UpnpSendAdvertisement(
/*! 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. */
IN int Exp);
int Exp);
/* @} Discovery */
@ -1316,16 +1327,16 @@ EXPORT_SPEC int UpnpSendAdvertisement(
* according to the device.
*/
EXPORT_SPEC int UpnpGetServiceVarStatus(
/*! The handle of the control point. */
IN UpnpClient_Handle Hnd,
/*! The URL of the service. */
IN const char *ActionURL,
/*! The name of the variable to query. */
IN const char *VarName,
/*! The pointer to store the value for \b VarName. The SDK allocates
/*! [in] The handle of the control point. */
UpnpClient_Handle Hnd,
/*! [in] The URL of the service. */
const char *ActionURL,
/*! [in] The name of the variable to query. */
const char *VarName,
/*! [out] The pointer to store the value for \b VarName. The SDK allocates
* this string and the caller needs to free it using
* \b ixmlFreeDOMString. */
OUT DOMString *StVarVal);
DOMString *StVarVal);
/*!
@ -1346,17 +1357,17 @@ EXPORT_SPEC int UpnpGetServiceVarStatus(
* complete this operation.
*/
EXPORT_SPEC int UpnpGetServiceVarStatusAsync(
/*! The handle of the control point. */
IN UpnpClient_Handle Hnd,
/*! The URL of the service. */
IN const char *ActionURL,
/*! The name of the variable to query. */
IN const char *VarName,
/*! Pointer to a callback function to be invoked when the operation
/*! [in] The handle of the control point. */
UpnpClient_Handle Hnd,
/*! [in] The URL of the service. */
const char *ActionURL,
/*! [in] The name of the variable to query. */
const char *VarName,
/*! [in] Pointer to a callback function to be invoked when the operation
* is complete. */
IN Upnp_FunPtr Fun,
/*! Pointer to user data to pass to the callback function when invoked. */
IN const void *Cookie);
Upnp_FunPtr Fun,
/*! [in] Pointer to user data to pass to the callback function when invoked. */
const void *Cookie);
/*!
@ -1383,19 +1394,19 @@ EXPORT_SPEC int UpnpGetServiceVarStatusAsync(
* complete this operation.
*/
EXPORT_SPEC int UpnpSendAction(
/*! The handle of the control point sending the action. */
IN UpnpClient_Handle Hnd,
/*! The action URL of the service. */
IN const char *ActionURL,
/*! The type of the service. */
IN const char *ServiceType,
/*! This parameter is ignored and must be \c NULL. */
IN const char *DevUDN,
/*! The DOM document for the action. */
IN IXML_Document *Action,
/*! The DOM document for the response to the action. The SDK allocates
/*! [in] The handle of the control point sending the action. */
UpnpClient_Handle Hnd,
/*! [in] The action URL of the service. */
const char *ActionURL,
/*! [in] The type of the service. */
const char *ServiceType,
/*! [in] This parameter is ignored and must be \c NULL. */
const char *DevUDN,
/*! [in] The DOM document for the action. */
IXML_Document *Action,
/*! [out] The DOM document for the response to the action. The SDK allocates
* 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.
*/
EXPORT_SPEC int UpnpSendActionEx(
/*! The handle of the control point sending the action. */
IN UpnpClient_Handle Hnd,
/*! The action URL of the service. */
IN const char *ActionURL,
/*! The type of the service. */
IN const char *ServiceType,
/*! This parameter is ignored and must be \c NULL. */
IN const char *DevUDN,
/*! The DOM document for the SOAP header. This may be \c NULL if the
/*! [in] The handle of the control point sending the action. */
UpnpClient_Handle Hnd,
/*! [in] The action URL of the service. */
const char *ActionURL,
/*! [in] The type of the service. */
const char *ServiceType,
/*! [in] This parameter is ignored and must be \c NULL. */
const char *DevUDN,
/*! [in] The DOM document for the SOAP header. This may be \c NULL if the
* header is not required. */
IN IXML_Document *Header,
/*! The DOM document for the action. */
IN IXML_Document *Action,
/*! The DOM document for the response to the action. The SDK allocates
IXML_Document *Header,
/*! [in] The DOM document for the action. */
IXML_Document *Action,
/*! [out] The DOM document for the response to the action. The SDK allocates
* 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.
*/
EXPORT_SPEC int UpnpSendActionAsync(
/*! The handle of the control point sending the action. */
IN UpnpClient_Handle Hnd,
/*! The action URL of the service. */
IN const char *ActionURL,
/*! The type of the service. */
IN const char *ServiceType,
/*! This parameter is ignored and must be \c NULL. */
IN const char *DevUDN,
/*! The DOM document for the action to perform on this device. */
IN IXML_Document *Action,
/*! Pointer to a callback function to be invoked when the operation
/*! [in] The handle of the control point sending the action. */
UpnpClient_Handle Hnd,
/*! [in] The action URL of the service. */
const char *ActionURL,
/*! [in] The type of the service. */
const char *ServiceType,
/*! [in] This parameter is ignored and must be \c NULL. */
const char *DevUDN,
/*! [in] The DOM document for the action to perform on this device. */
IXML_Document *Action,
/*! [in] Pointer to a callback function to be invoked when the operation
* completes. */
IN Upnp_FunPtr Fun,
/*! Pointer to user data that to be passed to the callback when
Upnp_FunPtr Fun,
/*! [in] Pointer to user data that to be passed to the callback when
* invoked. */
IN const void *Cookie);
const void *Cookie);
/*!
@ -1502,28 +1513,30 @@ EXPORT_SPEC int UpnpSendActionAsync(
* complete this operation.
*/
EXPORT_SPEC int UpnpSendActionExAsync(
/*! The handle of the control point sending the action. */
IN UpnpClient_Handle Hnd,
/*! The action URL of the service. */
IN const char *ActionURL,
/*! The type of the service. */
IN const char *ServiceType,
/*! This parameter is ignored and must be \c NULL. */
IN const char *DevUDN,
/*! The DOM document for the SOAP header. This may be \c NULL if the
/*! [in] The handle of the control point sending the action. */
UpnpClient_Handle Hnd,
/*! [in] The action URL of the service. */
const char *ActionURL,
/*! [in] The type of the service. */
const char *ServiceType,
/*! [in] This parameter is ignored and must be \c NULL. */
const char *DevUDN,
/*! [in] The DOM document for the SOAP header. This may be \c NULL if the
* header is not required. */
IN IXML_Document *Header,
/*! The DOM document for the action to perform on this device. */
IN IXML_Document *Action,
/*! Pointer to a callback function to be invoked when the operation
IXML_Document *Header,
/*! [in] The DOM document for the action to perform on this device. */
IXML_Document *Action,
/*! [in] Pointer to a callback function to be invoked when the operation
* completes. */
IN Upnp_FunPtr Fun,
/*! Pointer to user data that to be passed to the callback when
Upnp_FunPtr Fun,
/*! [in] Pointer to user data that to be passed to the callback when
* invoked. */
IN const void *Cookie);
const void *Cookie);
/*! @} Control */
/******************************************************************************
******************************************************************************
* *
@ -1564,20 +1577,20 @@ EXPORT_SPEC int UpnpSendActionExAsync(
* complete this operation.
*/
EXPORT_SPEC int UpnpAcceptSubscription(
/*! The handle of the device. */
IN UpnpDevice_Handle Hnd,
/*! The device ID of the subdevice of the service generating the event. */
IN const char *DevID,
/*! The unique service identifier of the service generating the event. */
IN const char *ServID,
/*! Pointer to an array of event variables. */
IN const char **VarName,
/*! Pointer to an array of values for the event variables. */
IN const char **NewVal,
/*! The number of event variables in \b VarName. */
IN int cVariables,
/*! The subscription ID of the newly registered control point. */
IN const Upnp_SID SubsId);
/*! [in] The handle of the device. */
UpnpDevice_Handle Hnd,
/*! [in] The device ID of the subdevice of the service generating the event. */
const char *DevID,
/*! [in] The unique service identifier of the service generating the event. */
const char *ServID,
/*! [in] Pointer to an array of event variables. */
const char **VarName,
/*! [in] Pointer to an array of values for the event variables. */
const char **NewVal,
/*! [in] The number of event variables in \b VarName. */
int cVariables,
/*! [in] The subscription ID of the newly registered control point. */
const Upnp_SID SubsId);
/*!
@ -1604,18 +1617,18 @@ EXPORT_SPEC int UpnpAcceptSubscription(
* complete this operation.
*/
EXPORT_SPEC int UpnpAcceptSubscriptionExt(
/*! The handle of the device. */
IN UpnpDevice_Handle Hnd,
/*! The device ID of the subdevice of the service generating the event. */
IN const char *DevID,
/*! The unique service identifier of the service generating the event. */
IN const char *ServID,
/*! The DOM document for the property set. Property set documents must
/*! [in] The handle of the device. */
UpnpDevice_Handle Hnd,
/*! [in] The device ID of the subdevice of the service generating the event. */
const char *DevID,
/*! [in] The unique service identifier of the service generating the event. */
const char *ServID,
/*! [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
* Plug and Play Device Architecture specification. */
IN IXML_Document *PropSet,
/*! The subscription ID of the newly registered control point. */
IN Upnp_SID SubsId);
IXML_Document *PropSet,
/*! [in] The subscription ID of the newly registered control point. */
Upnp_SID SubsId);
/*!
@ -1640,18 +1653,18 @@ EXPORT_SPEC int UpnpAcceptSubscriptionExt(
* complete this operation.
*/
EXPORT_SPEC int UpnpNotify(
/*! The handle to the device sending the event. */
IN UpnpDevice_Handle,
/*! The device ID of the subdevice of the service generating the event. */
IN const char *DevID,
/*! The unique identifier of the service generating the event. */
IN const char *ServID,
/*! Pointer to an array of variables that have changed. */
IN const char **VarName,
/*! Pointer to an array of new values for those variables. */
IN const char **NewVal,
/*! The count of variables included in this notification. */
IN int cVariables);
/*! [in] The handle to the device sending the event. */
UpnpDevice_Handle,
/*! [in] The device ID of the subdevice of the service generating the event. */
const char *DevID,
/*! [in] The unique identifier of the service generating the event. */
const char *ServID,
/*! [in] Pointer to an array of variables that have changed. */
const char **VarName,
/*! [in] Pointer to an array of new values for those variables. */
const char **NewVal,
/*! [in] The count of variables included in this notification. */
int cVariables);
/*!
@ -1676,16 +1689,16 @@ EXPORT_SPEC int UpnpNotify(
* complete this operation.
*/
EXPORT_SPEC int UpnpNotifyExt(
/*! The handle to the device sending the event. */
IN UpnpDevice_Handle,
/*! The device ID of the subdevice of the service generating the event. */
IN const char *DevID,
/*! The unique identifier of the service generating the event. */
IN const char *ServID,
/*! The DOM document for the property set. Property set documents must
/*! [in] The handle to the device sending the event. */
UpnpDevice_Handle,
/*! [in] The device ID of the subdevice of the service generating the event. */
const char *DevID,
/*! [in] The unique identifier of the service generating the event. */
const char *ServID,
/*! [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
* Plug and Play Device Architecture specification. */
IN IXML_Document *PropSet);
IXML_Document *PropSet);
/*!
@ -1717,13 +1730,13 @@ EXPORT_SPEC int UpnpNotifyExt(
* complete this operation.
*/
EXPORT_SPEC int UpnpRenewSubscription(
/*! The handle of the control point that is renewing the subscription. */
IN UpnpClient_Handle Hnd,
/*! Pointer to a variable containing the requested subscription time.
/*! [in] The handle of the control point that is renewing the subscription. */
UpnpClient_Handle Hnd,
/*! [in,out] Pointer to a variable containing the requested subscription time.
* Upon return, it contains the actual renewal time. */
INOUT int *TimeOut,
/*! The ID for the subscription to renew. */
IN const Upnp_SID SubsId);
int *TimeOut,
/*! [in] The ID for the subscription to renew. */
const Upnp_SID SubsId);
/*!
@ -1774,18 +1787,18 @@ EXPORT_SPEC int UpnpRenewSubscription(
* UpnpEventSubscribe.ErrCode field as part of the callback).
*/
EXPORT_SPEC int UpnpRenewSubscriptionAsync(
/*! The handle of the control point that is renewing the subscription. */
IN UpnpClient_Handle Hnd,
/*! The requested subscription time. The actual timeout value is
/*! [in] The handle of the control point that is renewing the subscription. */
UpnpClient_Handle Hnd,
/*! [in] The requested subscription time. The actual timeout value is
* returned when the callback function is called. */
IN int TimeOut,
/*! The ID for the subscription to renew. */
IN Upnp_SID SubsId,
/*! Pointer to a callback function to be invoked when the renewal is
int TimeOut,
/*! [in] The ID for the subscription to renew. */
Upnp_SID SubsId,
/*! [in] Pointer to a callback function to be invoked when the renewal is
* complete. */
IN Upnp_FunPtr Fun,
/*! Pointer to user data passed to the callback function when invoked. */
IN const void *Cookie);
Upnp_FunPtr Fun,
/*! [in] Pointer to user data passed to the callback function when invoked. */
const void *Cookie);
/*!
@ -1804,9 +1817,9 @@ EXPORT_SPEC int UpnpRenewSubscriptionAsync(
EXPORT_SPEC int UpnpSetMaxSubscriptions(
/*! The handle of the device for which the maximum number of
* subscriptions is being set. */
IN UpnpDevice_Handle Hnd,
UpnpDevice_Handle Hnd,
/*! 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(
/*! The handle of the device for which the maximum subscription
* time-out is being set. */
IN UpnpDevice_Handle Hnd,
UpnpDevice_Handle Hnd,
/*! The maximum subscription time-out to be accepted. */
IN int MaxSubscriptionTimeOut);
int MaxSubscriptionTimeOut);
/*!
@ -1861,16 +1874,16 @@ EXPORT_SPEC int UpnpSetMaxSubscriptionTimeOut(
* complete this operation.
*/
EXPORT_SPEC int UpnpSubscribe(
/*! The handle of the control point. */
IN UpnpClient_Handle Hnd,
/*! The URL of the service to subscribe to. */
IN const char *PublisherUrl,
/*! Pointer to a variable containing the requested subscription time.
/*! [in] The handle of the control point. */
UpnpClient_Handle Hnd,
/*! [in] The URL of the service to subscribe to. */
const char *PublisherUrl,
/*! [in,out]Pointer to a variable containing the requested subscription time.
* Upon return, it contains the actual subscription time returned from
* the service. */
INOUT int *TimeOut,
/*! Pointer to a variable to receive the subscription ID (SID). */
OUT Upnp_SID SubsId);
int *TimeOut,
/*! [out] Pointer to a variable to receive the subscription ID (SID). */
Upnp_SID SubsId);
/*!
@ -1923,16 +1936,16 @@ EXPORT_SPEC int UpnpSubscribe(
*/
EXPORT_SPEC int UpnpSubscribeAsync(
/*! The handle of the control point that is subscribing. */
IN UpnpClient_Handle Hnd,
UpnpClient_Handle Hnd,
/*! 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
* subscription time returned from the service. */
IN int TimeOut,
int TimeOut,
/*! 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. */
IN const void *Cookie);
const void *Cookie);
/*!
@ -1965,10 +1978,10 @@ EXPORT_SPEC int UpnpSubscribeAsync(
* complete this operation.
*/
EXPORT_SPEC int UpnpUnSubscribe(
/*! The handle of the subscribed control point. */
IN UpnpClient_Handle Hnd,
/*! The ID returned when the control point subscribed to the service. */
IN const Upnp_SID SubsId);
/*! [in] The handle of the subscribed control point. */
UpnpClient_Handle Hnd,
/*! [in] The ID returned when the control point subscribed to the service. */
const Upnp_SID SubsId);
/*!
@ -2018,15 +2031,15 @@ EXPORT_SPEC int UpnpUnSubscribe(
* <b>UpnpEventSubscribe.ErrCode</b> field as part of the callback).
*/
EXPORT_SPEC int UpnpUnSubscribeAsync(
/*! The handle of the subscribed control point. */
IN UpnpClient_Handle Hnd,
/*! The ID returned when the control point subscribed to the service. */
IN Upnp_SID SubsId,
/*! Pointer to a callback function to be called when the operation is
/*! [in] The handle of the subscribed control point. */
UpnpClient_Handle Hnd,
/*! [in] The ID returned when the control point subscribed to the service. */
Upnp_SID SubsId,
/*! [in] Pointer to a callback function to be called when the operation is
* complete. */
IN Upnp_FunPtr Fun,
/*! Pointer to user data to pass to the callback function when invoked. */
IN const void *Cookie);
Upnp_FunPtr Fun,
/*! [in] Pointer to user data to pass to the callback function when invoked. */
const void *Cookie);
/*! @} Eventing */
@ -2470,10 +2483,10 @@ typedef void *UpnpWebFileHandle;
* \brief Get-info callback function prototype.
*/
typedef int (*VDCallback_GetInfo)(
/*! The name of the file to query. */
IN const char *filename,
/*! Pointer to a structure to store the information on the file. */
OUT UpnpFileInfo *info);
/*! [in] The name of the file to query. */
const char *filename,
/*! [out] Pointer to a structure to store the information on the file. */
UpnpFileInfo *info);
/*!
* \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.
*/
typedef UpnpWebFileHandle (*VDCallback_Open)(
/*! The name of the file to open. */
IN const char *filename,
/*! The mode in which to open the file.
/*! [in] The name of the file to open. */
const char *filename,
/*! [in] The mode in which to open the file.
* 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.
*/
typedef int (*VDCallback_Read)(
/*! The handle of the file to read. */
IN UpnpWebFileHandle fileHnd,
/*! The buffer in which to place the data. */
OUT char *buf,
/*! The size of the buffer (i.e. the number of bytes to read). */
IN size_t buflen);
/*! [in] The handle of the file to read. */
UpnpWebFileHandle fileHnd,
/*! [out] The buffer in which to place the data. */
char *buf,
/*! [in] The size of the buffer (i.e. the number of bytes to read). */
size_t buflen);
/*!
@ -2535,12 +2548,12 @@ EXPORT_SPEC int UpnpVirtualDir_set_ReadCallback(VDCallback_Read callback);
* \brief Write callback function prototype.
*/
typedef int (*VDCallback_Write)(
/*! The handle of the file to write. */
IN UpnpWebFileHandle fileHnd,
/*! The buffer with the bytes to write. */
IN char *buf,
/*! The number of bytes to write. */
IN size_t buflen);
/*! [in] The handle of the file to write. */
UpnpWebFileHandle fileHnd,
/*! [in] The buffer with the bytes to write. */
char *buf,
/*! [in] The number of bytes to write. */
size_t buflen);
/*!
@ -2558,17 +2571,17 @@ EXPORT_SPEC int UpnpVirtualDir_set_WriteCallback(VDCallback_Write callback);
* \brief Seek callback function prototype.
*/
typedef int (*VDCallback_Seek) (
/*! The handle of the file to move the file pointer. */
IN UpnpWebFileHandle fileHnd,
/*! The number of bytes to move in the file. Positive values
/*! [in] The handle of the file to move the file pointer. */
UpnpWebFileHandle fileHnd,
/*! [in] The number of bytes to move in the file. Positive values
* move foward and negative values move backward. Note that
* this must be positive if the \b origin is \c SEEK_SET. */
IN off_t offset,
/*! The position to move relative to. It can be \c SEEK_CUR
off_t offset,
/*! [in] The position to move relative to. It can be \c SEEK_CUR
* to move relative to the current position, \c SEEK_END to
* move relative to the end of the file, or \c SEEK_SET to
* 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.
*/
typedef int (*VDCallback_Close)(
/*! The handle of the file to close. */
IN UpnpWebFileHandle fileHnd);
/*! [in] The handle of the file to close. */
UpnpWebFileHandle fileHnd);
/*!

View File

@ -101,50 +101,36 @@ typedef enum Upnp_LogLevel_e {
/***************************************************************************
* Function : UpnpInitLog
/*!
* \brief Initialize the log files.
*
* Parameters: void
*
* Description:
* This functions initializes the log files
*
* Returns: int
* -1 : If fails
* UPNP_E_SUCCESS : if success
***************************************************************************/
* \return -1 if fails or UPNP_E_SUCCESS if succeeds.
*/
#ifdef DEBUG
int UpnpInitLog();
#else
static UPNP_INLINE int UpnpInitLog() { return UPNP_E_SUCCESS; }
static UPNP_INLINE int UpnpInitLog()
{
return UPNP_E_SUCCESS;
}
#endif
/***************************************************************************
* Function : UpnpSetLogLevel
*
* Parameters: Upnp_LogLevel log_level
*
* Description:
* This functions set the log level (see \c Upnp_LogLevel)
* Returns: void
***************************************************************************/
/*!
* \brief Set the log level (see \c Upnp_LogLevel).
*/
#ifdef DEBUG
void UpnpSetLogLevel(Upnp_LogLevel log_level);
void UpnpSetLogLevel(
/*! [in] Log level. */
Upnp_LogLevel log_level);
#else
static UPNP_INLINE void UpnpSetLogLevel(Upnp_LogLevel log_level) {}
#endif
/***************************************************************************
* Function : UpnpCloseLog
*
* Parameters: void
*
* Description:
* This functions closes the log files
* Returns: void
***************************************************************************/
/*!
* \brief Closes the log files.
*/
#ifdef DEBUG
void UpnpCloseLog();
#else
@ -152,23 +138,14 @@ static UPNP_INLINE void UpnpCloseLog() {}
#endif
/***************************************************************************
* 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
***************************************************************************/
/*!
* \brief Set the name for error and information files, respectively.
*/
#ifdef DEBUG
void UpnpSetLogFileNames(
/*! [in] Name of the error file. */
const char *ErrFileName,
/*! [in] Name of the information file. */
const char *InfoFileName);
#else
static UPNP_INLINE void UpnpSetLogFileNames(
@ -177,24 +154,20 @@ static UPNP_INLINE void UpnpSetLogFileNames(
#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
***************************************************************************/
/*!
* \brief Check if the module is turned on for debug and returns the file
* descriptor corresponding to the debug level
*
* \return NULL if the module is turn off for debug otheriwse returns the
* right file descriptor.
*/
#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
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
/***************************************************************************
* Function : DebugAtThisLevel
*
* 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.
/*!
* \brief Returns true if debug output should be done in this module.
*
* Returns: int
***************************************************************************/
* \return Nonzero value if true, zero if false.
*/
#ifdef DEBUG
int DebugAtThisLevel(
IN Upnp_LogLevel DLevel,
IN Dbg_Module Module);
/*! [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 DLevel,
/*! [in] Debug will go in the name of this module. */
Dbg_Module Module);
#else
static UPNP_INLINE int DebugAtThisLevel(
IN Upnp_LogLevel DLevel,
IN Dbg_Module Module) { return 0; }
Upnp_LogLevel DLevel,
Dbg_Module Module)
{
return 0;
}
#endif
/*!
* \brief Prints the debug statement either on the standard output or log file
* along with the information from where this debug statement is coming.
**/
*/
#ifdef DEBUG
void UpnpPrintf(
/*! [in] The level of the debug logging. It will decide whether debug
@ -261,28 +230,23 @@ static UPNP_INLINE void UpnpPrintf(
const char* DbgFileName,
int DbgLineNo,
const char* FmtStr,
...) {}
...)
{
}
#endif /* DEBUG */
/***************************************************************************
* 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
***************************************************************************/
/*!
* \brief Writes the file name and file number from where debug statement is
* coming to the log file.
*/
#ifdef DEBUG
void UpnpDisplayFileAndLine(
/*! [in] File descriptor where line number and file name will be written. */
FILE *fd,
/*! [in] Name of the file. */
const char *DbgFileName,
/*! [in] Line number of the file. */
int DbgLineNo);
#else
static UPNP_INLINE void UpnpDisplayFileAndLine(
@ -292,18 +256,18 @@ static UPNP_INLINE void UpnpDisplayFileAndLine(
#endif
/*! \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
/*!
* \brief Writes the buffer in the file as per the requested banner
*/
#ifdef DEBUG
void UpnpDisplayBanner(
/*! [in] file descriptor where the banner will be written. */
FILE *fd,
/*! [in] The buffer that will be written. */
const char **lines,
/*! [in] Size of the buffer. */
size_t size,
/*! [in] This parameter provides the width of the banner. */
int starlength);
#else
static UPNP_INLINE void UpnpDisplayBanner(
@ -314,27 +278,27 @@ static UPNP_INLINE void UpnpDisplayBanner(
#endif
/*! \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.
/*!
* \brief Prints thread pool statistics.
*/
#ifdef DEBUG
void PrintThreadPoolStats(
/* [in] The thread pool. */
ThreadPool *tp,
/* [in] The file name that called this function, use the macro __FILE__. */
const char *DbgFileName,
/* [in] The line number that the function was called, use the macro __LINE__. */
int DbgLineNo,
/* [in] The message. */
const char *msg);
#else
static UPNP_INLINE void PrintThreadPoolStats(
ThreadPool *tp,
const char *DbgFileName,
int DbgLineNo,
const char *msg) {}
const char *msg)
{
}
#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;
// Global log level
/*! Global 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;
//File handle for the information log file
/*! File handle for the information log file */
static FILE *InfoFileHnd = NULL;
//Name of the error file
/*! Name of the error file */
static const char *errFileName = "IUpnpErrFile.txt";
//Name of the info file
/*! Name of the info file */
static const char *infoFileName = "IUpnpInfoFile.txt";
#ifdef DEBUG
/***************************************************************************
* 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 )
int UpnpInitLog()
{
if( ErrFileName ) {
errFileName = ErrFileName;
}
if( InfoFileName ) {
infoFileName = InfoFileName;
}
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 : 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)
void UpnpSetLogLevel(Upnp_LogLevel log_level)
{
g_log_level = log_level;
}
/***************************************************************************
* Function : UpnpCloseLog
*
* Parameters: void
*
* Description:
* This functions closes the log files
* Returns: void
***************************************************************************/
void
UpnpCloseLog()
void UpnpCloseLog()
{
if( DEBUG_TARGET == 1 ) {
fflush( ErrFileHnd );
fflush( InfoFileHnd );
fclose( ErrFileHnd );
fclose( InfoFileHnd );
}
ithread_mutex_destroy( &GlobalDebugMutex );
if (DEBUG_TARGET == 1) {
fflush(ErrFileHnd);
fflush(InfoFileHnd);
fclose(ErrFileHnd);
fclose(InfoFileHnd);
}
ithread_mutex_destroy(&GlobalDebugMutex);
}
#endif // DEBUG
/***************************************************************************
* Function : DebugAtThisLevel
*
* 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
***************************************************************************/
void UpnpSetLogFileNames(
const char *ErrFileName,
const char *InfoFileName)
{
if (ErrFileName) {
errFileName = ErrFileName;
}
if (InfoFileName) {
infoFileName = InfoFileName;
}
}
#endif /* DEBUG */
#ifdef DEBUG
int DebugAtThisLevel(
IN Upnp_LogLevel DLevel,
IN Dbg_Module Module)
Upnp_LogLevel DLevel,
Dbg_Module Module)
{
int ret = DLevel <= g_log_level;
ret &=
@ -195,12 +134,12 @@ int DebugAtThisLevel(
#ifdef DEBUG
void UpnpPrintf(
IN Upnp_LogLevel DLevel,
IN Dbg_Module Module,
IN const char *DbgFileName,
IN int DbgLineNo,
IN const char *FmtStr,
... )
Upnp_LogLevel DLevel,
Dbg_Module Module,
const char *DbgFileName,
int DbgLineNo,
const char *FmtStr,
...)
{
va_list ArgList;
@ -235,24 +174,8 @@ void UpnpPrintf(
#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
FILE *GetDebugFile( Upnp_LogLevel DLevel, Dbg_Module Module )
FILE *GetDebugFile(Upnp_LogLevel DLevel, Dbg_Module Module)
{
FILE *ret;
@ -273,25 +196,11 @@ FILE *GetDebugFile( Upnp_LogLevel DLevel, Dbg_Module Module )
#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
void UpnpDisplayFileAndLine(
IN FILE * fd,
IN const char *DbgFileName,
IN int DbgLineNo)
FILE *fd,
const char *DbgFileName,
int DbgLineNo)
{
#define NLINES 2
#define MAX_LINE_SIZE 512
@ -329,10 +238,10 @@ void UpnpDisplayFileAndLine(
#ifdef DEBUG
void UpnpDisplayBanner(
IN FILE * fd,
IN const char **lines,
IN size_t size,
IN int starLength)
FILE * fd,
const char **lines,
size_t size,
int starLength)
{
int leftMarginLength = starLength / 2 + 1;
int rightMarginLength = starLength / 2 + 1;
@ -373,12 +282,12 @@ void UpnpDisplayBanner(
rightMargin[rightMarginLength] = 0;
fprintf( fd, "*%s%s%s*\n", leftMargin, line, rightMargin );
}
fprintf( fd, "%s\n\n", stars );
fprintf(fd, "%s\n\n", stars);
free( currentLine );
free( stars );
free( rightMargin );
free( leftMargin );
free(currentLine);
free(stars);
free(rightMargin);
free(leftMargin);
}
#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();
int return_code = UPNP_E_SUCCESS;
@ -430,8 +430,8 @@ exit_function:
#ifdef INCLUDE_CLIENT_APIS
int genaUnSubscribe(
IN UpnpClient_Handle client_handle,
IN const UpnpString *in_sid)
UpnpClient_Handle client_handle,
const UpnpString *in_sid)
{
ClientSubscription *sub = NULL;
int return_code = GENA_SUCCESS;
@ -482,10 +482,10 @@ exit_function:
#ifdef INCLUDE_CLIENT_APIS
int genaSubscribe(
IN UpnpClient_Handle client_handle,
IN const UpnpString *PublisherURL,
INOUT int *TimeOut,
OUT UpnpString *out_sid)
UpnpClient_Handle client_handle,
const UpnpString *PublisherURL,
int *TimeOut,
UpnpString *out_sid)
{
int return_code = GENA_SUCCESS;
ClientSubscription *newSubscription = UpnpClientSubscription_new();
@ -564,9 +564,9 @@ error_handler:
int genaRenewSubscription(
IN UpnpClient_Handle client_handle,
IN const UpnpString *in_sid,
INOUT int *TimeOut)
UpnpClient_Handle client_handle,
const UpnpString *in_sid,
int *TimeOut)
{
int return_code = GENA_SUCCESS;
ClientSubscription *sub = NULL;
@ -662,8 +662,8 @@ exit_function:
void gena_process_notification_event(
IN SOCKINFO *info,
IN http_message_t *event)
SOCKINFO *info,
http_message_t *event)
{
UpnpEvent *event_struct = UpnpEvent_new();
IXML_Document *ChangedVars = NULL;

View File

@ -61,7 +61,7 @@
*/
int genaUnregisterDevice(
/*! [in] Device handle. */
IN UpnpDevice_Handle device_handle)
UpnpDevice_Handle device_handle)
{
int ret = 0;
struct Handle_Info *handle_info;
@ -92,13 +92,13 @@ int genaUnregisterDevice(
*/
static int GeneratePropertySet(
/*! [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 char **values,
char **values,
/*! [in] number of variables. */
IN int count,
int count,
/*! [out] PropertySet node in the string format. */
OUT DOMString *out)
DOMString *out)
{
char *buffer;
int counter = 0;
@ -147,7 +147,7 @@ static int GeneratePropertySet(
*/
static void free_notify_struct(
/*! [in] Notify structure. */
IN notify_thread_struct *input)
notify_thread_struct *input)
{
( *input->reference_count )--;
if( ( *input->reference_count ) == 0 ) {
@ -170,13 +170,13 @@ static void free_notify_struct(
*/
static UPNP_INLINE int notify_send_and_recv(
/*! [in] subscription callback URL (URL of the control point). */
IN uri_type *destination_url,
uri_type *destination_url,
/*! [in] Common HTTP headers. */
IN membuffer *mid_msg,
membuffer *mid_msg,
/*! [in] The evented XML. */
IN char *propertySet,
char *propertySet,
/*! [out] The response from the control point. */
OUT http_parser_t *response)
http_parser_t *response)
{
uri_type url;
int conn_fd;
@ -258,11 +258,11 @@ static UPNP_INLINE int notify_send_and_recv(
*/
static int genaNotify(
/*! [in] Null terminated, includes all headers (including \\r\\n) except SID and SEQ. */
IN char *headers,
char *headers,
/*! [in] The evented XML. */
IN char *propertySet,
char *propertySet,
/*! [in] subscription to be Notified, assumes this is valid for life of function. */
IN subscription *sub)
subscription *sub)
{
int i;
membuffer mid_msg;
@ -326,7 +326,7 @@ static int genaNotify(
*/
static void genaNotifyThread(
/*! [in] notify thread structure containing all the headers and property set info. */
IN void *input)
void *input)
{
subscription *sub;
service_info *service;
@ -406,13 +406,13 @@ static void genaNotifyThread(
int genaInitNotify(
IN UpnpDevice_Handle device_handle,
IN char *UDN,
IN char *servId,
IN char **VarNames,
IN char **VarValues,
IN int var_count,
IN const Upnp_SID sid)
UpnpDevice_Handle device_handle,
char *UDN,
char *servId,
char **VarNames,
char **VarValues,
int var_count,
const Upnp_SID sid)
{
int ret = GENA_SUCCESS;
int line = 0;
@ -574,11 +574,11 @@ ExitFunction:
int genaInitNotifyExt(
IN UpnpDevice_Handle device_handle,
IN char *UDN,
IN char *servId,
IN IXML_Document *PropSet,
IN const Upnp_SID sid)
UpnpDevice_Handle device_handle,
char *UDN,
char *servId,
IXML_Document *PropSet,
const Upnp_SID sid)
{
int ret = GENA_SUCCESS;
int line = 0;
@ -669,10 +669,10 @@ int genaInitNotifyExt(
propertySet);
headers_size =
strlen( "CONTENT-TYPE text/xml\r\n" ) +
strlen( "CONTENT-LENGTH: \r\n" ) + MAX_CONTENT_LENGTH +
strlen( "NT: upnp:event\r\n" ) +
strlen( "NTS: upnp:propchange\r\n" ) + 1;
strlen("CONTENT-TYPE text/xml\r\n") +
strlen("CONTENT-LENGTH: \r\n") + MAX_CONTENT_LENGTH +
strlen("NT: upnp:event\r\n") +
strlen("NTS: upnp:propchange\r\n") + 1;
headers = (char *)malloc(headers_size);
if (headers == NULL) {
line = __LINE__;
@ -741,10 +741,10 @@ ExitFunction:
int genaNotifyAllExt(
IN UpnpDevice_Handle device_handle,
IN char *UDN,
IN char *servId,
IN IXML_Document *PropSet)
UpnpDevice_Handle device_handle,
char *UDN,
char *servId,
IXML_Document *PropSet)
{
int ret = GENA_SUCCESS;
int line = 0;
@ -891,12 +891,12 @@ ExitFunction:
int genaNotifyAll(
IN UpnpDevice_Handle device_handle,
IN char *UDN,
IN char *servId,
IN char **VarNames,
IN char **VarValues,
IN int var_count )
UpnpDevice_Handle device_handle,
char *UDN,
char *servId,
char **VarNames,
char **VarValues,
int var_count )
{
int ret = GENA_SUCCESS;
int line = 0;
@ -1049,13 +1049,13 @@ ExitFunction:
*/
static int respond_ok(
/*! [in] Socket connection of request. */
IN SOCKINFO *info,
SOCKINFO *info,
/*! [in] Accepted duration. */
IN int time_out,
int time_out,
/*! [in] Accepted subscription. */
IN subscription *sub,
subscription *sub,
/*! [in] Http request. */
IN http_message_t *request)
http_message_t *request)
{
int major;
int minor;
@ -1109,9 +1109,9 @@ static int respond_ok(
*/
static int create_url_list(
/*! [in] . */
IN memptr *url_list,
memptr *url_list,
/*! [out] . */
OUT URL_list *out)
URL_list *out)
{
int URLcount = 0;
int i;
@ -1185,8 +1185,8 @@ static int create_url_list(
void gena_process_subscription_request(
IN SOCKINFO *info,
IN http_message_t *request)
SOCKINFO *info,
http_message_t *request)
{
UpnpSubscriptionRequest *request_struct = UpnpSubscriptionRequest_new();
Upnp_SID temp_sid;
@ -1368,8 +1368,8 @@ exit_function:
void gena_process_subscription_renewal_request(
IN SOCKINFO *info,
IN http_message_t *request)
SOCKINFO *info,
http_message_t *request)
{
Upnp_SID sid;
subscription *sub;
@ -1480,8 +1480,8 @@ void gena_process_subscription_renewal_request(
void gena_process_unsubscribe_request(
IN SOCKINFO *info,
IN http_message_t *request)
SOCKINFO *info,
http_message_t *request)
{
Upnp_SID sid;
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(
/*! [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_t* request,
http_message_t* request,
/*! [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
EXTERN_C int genaSubscribe(
/*! [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 const UpnpString *PublisherURL,
const UpnpString *PublisherURL,
/*! [in,out] requested Duration:
* \li if -1, then "infinite".
* \li in the OUT case: actual Duration granted by Service,
* -1 for infinite. */
INOUT int *TimeOut,
int *TimeOut,
/*! [out] sid of subscription, memory passed in by caller. */
OUT UpnpString *out_sid);
UpnpString *out_sid);
#endif /* INCLUDE_CLIENT_APIS */
@ -207,9 +207,9 @@ EXTERN_C int genaSubscribe(
#ifdef INCLUDE_CLIENT_APIS
EXTERN_C int genaUnSubscribe(
/*! [in] UPnP client handle. */
IN UpnpClient_Handle client_handle,
UpnpClient_Handle client_handle,
/*! [in] The subscription ID. */
IN const UpnpString *in_sid);
const UpnpString *in_sid);
#endif /* INCLUDE_CLIENT_APIS */
@ -259,12 +259,12 @@ EXTERN_C int genaUnregisterDevice(
#ifdef INCLUDE_CLIENT_APIS
EXTERN_C int genaRenewSubscription(
/*! [in] Client handle. */
IN UpnpClient_Handle client_handle,
UpnpClient_Handle client_handle,
/*! [in] Subscription ID. */
IN const UpnpString *in_sid,
/*! [out] requested Duration, if -1, then "infinite". In the OUT case:
const UpnpString *in_sid,
/*! [in,out] requested Duration, if -1, then "infinite". In the OUT case:
* actual Duration granted by Service, -1 for infinite. */
OUT int * TimeOut);
int *TimeOut);
#endif /* INCLUDE_CLIENT_APIS */
@ -310,7 +310,7 @@ EXTERN_C int genaNotifyAllExt(
/*! [in] Service ID. */
char *servId,
/*! [in] XML document Event varible property set. */
IN IXML_Document *PropSet);
IXML_Document *PropSet);
#endif /* INCLUDE_DEVICE_APIS */
@ -325,19 +325,19 @@ EXTERN_C int genaNotifyAllExt(
#ifdef INCLUDE_DEVICE_APIS
EXTERN_C int genaInitNotify(
/*! [in] Device handle. */
IN UpnpDevice_Handle device_handle,
UpnpDevice_Handle device_handle,
/*! [in] Device udn. */
IN char *UDN,
char *UDN,
/*! [in] Service ID. */
IN char *servId,
char *servId,
/*! [in] Array of variable names. */
IN char **VarNames,
char **VarNames,
/*! [in] Array of variable values. */
IN char **VarValues,
char **VarValues,
/*! [in] Array size. */
IN int var_count,
int var_count,
/*! [in] Subscription ID. */
IN const Upnp_SID sid);
const Upnp_SID sid);
#endif /* INCLUDE_DEVICE_APIS */
@ -354,15 +354,15 @@ EXTERN_C int genaInitNotify(
#ifdef INCLUDE_DEVICE_APIS
EXTERN_C int genaInitNotifyExt(
/*! [in] Device handle. */
IN UpnpDevice_Handle device_handle,
UpnpDevice_Handle device_handle,
/*! [in] Device udn. */
IN char *UDN,
char *UDN,
/*! [in] Service ID. */
IN char *servId,
char *servId,
/*! [in] Document of the state table. */
IN IXML_Document *PropSet,
IXML_Document *PropSet,
/*! [in] subscription ID. */
IN const Upnp_SID sid);
const Upnp_SID sid);
#endif /* INCLUDE_DEVICE_APIS */
@ -374,11 +374,11 @@ EXTERN_C int genaInitNotifyExt(
*/
void error_respond(
/*! [in] Structure containing information about the socket. */
IN SOCKINFO *info,
SOCKINFO *info,
/*! [in] error code that will be in the GENA response. */
IN int error_code,
int error_code,
/*! [in] GENA request Packet. */
IN http_message_t* hmsg);
http_message_t* hmsg);
#endif /* GENA_H */

View File

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

View File

@ -48,9 +48,9 @@
*/
void gena_process_subscription_request(
/*! [in] Socket info of the device. */
IN SOCKINFO *info,
SOCKINFO *info,
/*! [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(
/*! [in] Socket info of the device. */
IN SOCKINFO *info,
SOCKINFO *info,
/*! [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(
/*! [in] Socket info of the device. */
IN SOCKINFO *info,
SOCKINFO *info,
/*! [in] UNSUBSCRIBE request from the control point. */
IN http_message_t *request);
http_message_t *request);
#endif /* GENA_DEVICE_H */

View File

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

View File

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