Merge similar code.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
/* autoconfig.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Define to 1 to compile debug code */
|
||||
/* #undef DEBUG */
|
||||
#define DEBUG 1
|
||||
|
||||
/* Define to 1 if you have the <arpa/inet.h> header file. */
|
||||
#define HAVE_ARPA_INET_H 1
|
||||
@@ -87,10 +87,10 @@
|
||||
#define LT_OBJDIR ".libs/"
|
||||
|
||||
/* Define to 1 to prevent compilation of assert() */
|
||||
#define NDEBUG 1
|
||||
/* #undef NDEBUG */
|
||||
|
||||
/* Define to 1 to prevent some debug code */
|
||||
#define NO_DEBUG 1
|
||||
/* #undef NO_DEBUG */
|
||||
|
||||
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
|
||||
/* #undef NO_MINUS_C_MINUS_O */
|
||||
@@ -130,7 +130,7 @@
|
||||
#define UPNP_HAVE_CLIENT 1
|
||||
|
||||
/* see upnpconfig.h */
|
||||
/* #undef UPNP_HAVE_DEBUG */
|
||||
#define UPNP_HAVE_DEBUG 1
|
||||
|
||||
/* see upnpconfig.h */
|
||||
#define UPNP_HAVE_DEVICE 1
|
||||
|
@@ -69,7 +69,7 @@
|
||||
|
||||
/** Defined to 1 if the library has been compiled with DEBUG enabled
|
||||
* (i.e. configure --enable-debug) : <upnp/upnpdebug.h> file is available */
|
||||
/* #undef UPNP_HAVE_DEBUG */
|
||||
#define UPNP_HAVE_DEBUG 1
|
||||
|
||||
|
||||
/** Defined to 1 if the library has been compiled with client API enabled
|
||||
|
@@ -304,24 +304,6 @@ static UPNP_INLINE void PrintThreadPoolStats(
|
||||
#endif
|
||||
|
||||
|
||||
/*!
|
||||
* \brief Print the node names and values of a XML tree.
|
||||
*/
|
||||
#ifdef DEBUG
|
||||
void printNodes(
|
||||
/*! [in] The root of the tree to print. */
|
||||
IXML_Node *tmpRoot,
|
||||
/*! [in] The depth to print. */
|
||||
int depth);
|
||||
#else
|
||||
static UPNP_INLINE void printNodes(
|
||||
IXML_Node *tmpRoot,
|
||||
int depth)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*@}*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@@ -29,201 +29,237 @@
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/** @name Optional Tool APIs
|
||||
* The Linux SDK for UPnP Devices contains some additional, optional
|
||||
* utility APIs that can be helpful in writing applications using the
|
||||
* SDK. These additional APIs can be compiled out in order to save code
|
||||
* size in the SDK. Refer to the README for details.
|
||||
*/
|
||||
|
||||
/*! @{ */
|
||||
|
||||
#ifndef UPNP_TOOLS_H
|
||||
#define UPNP_TOOLS_H
|
||||
|
||||
#include "upnp.h"
|
||||
|
||||
/*!
|
||||
* \file
|
||||
*
|
||||
* \defgroup UPnPTools Optional Tool API
|
||||
*
|
||||
* \brief Additional, optional utility API that can be helpful in writing
|
||||
* applications.
|
||||
*
|
||||
* This additional API can be compiled out in order to save code size in the
|
||||
* library. Refer to the file README for details.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
#include "ixml.h" /* for IXML_Document */
|
||||
|
||||
|
||||
/* Function declarations only if tools compiled into the library */
|
||||
#if UPNP_HAVE_TOOLS
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** {\bf UpnpResolveURL} combines a base URL and a relative URL into
|
||||
* a single absolute URL. The memory for {\bf AbsURL} needs to be
|
||||
* allocated by the caller and must be large enough to hold the
|
||||
* {\bf BaseURL} and {\bf RelURL} combined.
|
||||
|
||||
/*!
|
||||
* \brief Converts an SDK error code into a string error message suitable for
|
||||
* display. The memory returned from this function should NOT be freed.
|
||||
*
|
||||
* @return [int] An integer representing one of the following:
|
||||
* \begin{itemize}
|
||||
* \item {\tt UPNP_E_SUCCESS}: The operation completed successfully.
|
||||
* \item {\tt UPNP_E_INVALID_PARAM}: {\bf RelURL} is {\tt NULL}.
|
||||
* \item {\tt UPNP_E_INVALID_URL}: The {\bf BaseURL} / {\bf RelURL}
|
||||
* \return An ASCII text string representation of the error message associated
|
||||
* with the error code or the string "Unknown error code"
|
||||
*/
|
||||
EXPORT_SPEC const char *UpnpGetErrorMessage(
|
||||
/*! [in] The SDK error code to convert. */
|
||||
int errorcode);
|
||||
|
||||
|
||||
/*!
|
||||
* \brief Combines a base URL and a relative URL into a single absolute URL.
|
||||
*
|
||||
* The memory for \b AbsURL needs to be allocated by the caller and must
|
||||
* be large enough to hold the \b BaseURL and \b RelURL combined.
|
||||
*
|
||||
* \return An integer representing one of the following:
|
||||
* \li <tt>UPNP_E_SUCCESS</tt>: The operation completed successfully.
|
||||
* \li <tt>UPNP_E_INVALID_PARAM</tt>: \b RelURL is <tt>NULL</tt>.
|
||||
* \li <tt>UPNP_E_INVALID_URL</tt>: The \b BaseURL / \b RelURL
|
||||
* combination does not form a valid URL.
|
||||
* \item {\tt UPNP_E_OUTOF_MEMORY}: Insufficient resources exist to
|
||||
* \li <tt>UPNP_E_OUTOF_MEMORY</tt>: Insufficient resources exist to
|
||||
* complete this operation.
|
||||
* \end{itemize}
|
||||
*/
|
||||
|
||||
EXPORT_SPEC int UpnpResolveURL(
|
||||
IN const char * BaseURL, /** The base URL to combine. */
|
||||
IN const char * RelURL, /** The relative URL to {\bf BaseURL}. */
|
||||
OUT char * AbsURL /** A pointer to a buffer to store the
|
||||
absolute URL. */
|
||||
);
|
||||
/*! [in] The base URL to combine. */
|
||||
const char *BaseURL,
|
||||
/*! [in] The relative URL to \b BaseURL. */
|
||||
const char *RelURL,
|
||||
/*! [out] A pointer to a buffer to store the absolute URL. */
|
||||
char *AbsURL);
|
||||
|
||||
/** {\bf UpnpMakeAction} creates an action request packet based on its input
|
||||
* parameters (status variable name and value pair). Any number of input
|
||||
* parameters can be passed to this function but every input variable name
|
||||
* should have a matching value argument.
|
||||
|
||||
/*!
|
||||
* \brief Creates an action request packet based on its input parameters
|
||||
* (status variable name and value pair).
|
||||
*
|
||||
* @return [IXML_Document*] The action node of {\bf Upnp_Document} type or
|
||||
* {\tt NULL} if the operation failed.
|
||||
* Any number of input parameters can be passed to this function but every
|
||||
* input variable name should have a matching value argument.
|
||||
*
|
||||
* It is a wrapper function that calls makeAction() function to create the
|
||||
* action request.
|
||||
*
|
||||
* \return The action node of \b Upnp_Document type or <tt>NULL</tt> if the
|
||||
* operation failed.
|
||||
*/
|
||||
EXPORT_SPEC IXML_Document *UpnpMakeAction(
|
||||
/*! [in] Name of the action request or response. */
|
||||
const char *ActionName,
|
||||
/*! [in] The service type. */
|
||||
const char *ServType,
|
||||
/*! [in] Number of argument pairs to be passed. */
|
||||
int NumArg,
|
||||
/*! [in] pointer to the first argument. */
|
||||
const char *Arg,
|
||||
/*! [in] Argument list. */
|
||||
...);
|
||||
|
||||
EXPORT_SPEC IXML_Document* UpnpMakeAction(
|
||||
IN const char * ActionName, /** The action name. */
|
||||
IN const char * ServType, /** The service type. */
|
||||
IN int NumArg, /** Number of argument pairs to be passed. */
|
||||
IN const char * Arg, /** Status variable name and value pair. */
|
||||
IN ... /* Other status variable name and value pairs. */
|
||||
);
|
||||
|
||||
/** {\bf UpnpAddToAction} creates an action request packet based on its input
|
||||
* parameters (status variable name and value pair). This API is specially
|
||||
* suitable inside a loop to add any number input parameters into an existing
|
||||
* action. If no action document exists in the beginning then a
|
||||
* {\bf Upnp_Document} variable initialized with {\tt NULL} should be passed
|
||||
* as a parameter.
|
||||
/*!
|
||||
* \brief Ceates an action response packet based on its output parameters
|
||||
* (status variable name and value pair).
|
||||
*
|
||||
* @return [int] An integer representing one of the following:
|
||||
* \begin{itemize}
|
||||
* \item {\tt UPNP_E_SUCCESS}: The operation completed successfully.
|
||||
* \item {\tt UPNP_E_INVALID_PARAM}: One or more of the parameters
|
||||
* are invalid.
|
||||
* \item {\tt UPNP_E_OUTOF_MEMORY}: Insufficient resources exist to
|
||||
* Any number of input parameters can be passed to this function but every
|
||||
* output variable name should have a matching value argument.
|
||||
*
|
||||
* It is a wrapper function that calls makeAction() function to create the
|
||||
* action request.
|
||||
*
|
||||
* \return The action node of \b Upnp_Document type or <tt>NULL</tt> if the
|
||||
* operation failed.
|
||||
*/
|
||||
EXPORT_SPEC IXML_Document *UpnpMakeActionResponse(
|
||||
/*! [in] The action name. */
|
||||
const char *ActionName,
|
||||
/*! [in] The service type.. */
|
||||
const char *ServType,
|
||||
/*! [in] The number of argument pairs passed. */
|
||||
int NumArg,
|
||||
/*! [in] The status variable name and value pair. */
|
||||
const char *Arg,
|
||||
/*! [in] Other status variable name and value pairs. */
|
||||
...);
|
||||
|
||||
|
||||
/*!
|
||||
* \brief Adds the argument in the action request.
|
||||
*
|
||||
* This API is specially suitable inside a loop to add any number input
|
||||
* parameters into an existing action. If no action document exists in the
|
||||
* beginning then a <b>Upnp_Document variable initialized with <tt>NULL</tt></b>
|
||||
* should be passed as a parameter.
|
||||
*
|
||||
* It is a wrapper function that calls addToAction() function to add the
|
||||
* argument in the action request.
|
||||
*
|
||||
* \return An integer representing one of the following:
|
||||
* \li <tt>UPNP_E_SUCCESS</tt>: The operation completed successfully.
|
||||
* \li <tt>UPNP_E_INVALID_PARAM</tt>: One or more of the parameters are invalid.
|
||||
* \li <tt>UPNP_E_OUTOF_MEMORY</tt>: Insufficient resources exist to
|
||||
* complete this operation.
|
||||
* \end{itemize}
|
||||
*/
|
||||
|
||||
EXPORT_SPEC int UpnpAddToAction(
|
||||
IN OUT IXML_Document ** ActionDoc,
|
||||
/** A pointer to store the action
|
||||
document node. */
|
||||
IN const char * ActionName, /** The action name. */
|
||||
IN const char * ServType, /** The service type. */
|
||||
IN const char * ArgName, /** The status variable name. */
|
||||
IN const char * ArgVal /** The status variable value. */
|
||||
);
|
||||
/*! [in,out] A pointer to store the action document node. */
|
||||
IXML_Document **ActionDoc,
|
||||
/*! [in] The action name. */
|
||||
const char *ActionName,
|
||||
/*! [in] The service type. */
|
||||
const char *ServType,
|
||||
/*! [in] The status variable name. */
|
||||
const char *ArgName,
|
||||
/*! [in] The status variable value. */
|
||||
const char *ArgVal);
|
||||
|
||||
/** {\bf UpnpMakeActionResponse} creates an action response packet based
|
||||
* on its output parameters (status variable name and value pair). Any
|
||||
* number of input parameters can be passed to this function but every output
|
||||
* variable name should have a matching value argument.
|
||||
|
||||
/*!
|
||||
* \brief Creates an action response packet based on its output parameters
|
||||
* (status variable name and value pair).
|
||||
*
|
||||
* @return [IXML_Document*] The action node of {\bf Upnp_Document} type or
|
||||
* {\tt NULL} if the operation failed.
|
||||
*/
|
||||
|
||||
EXPORT_SPEC IXML_Document* UpnpMakeActionResponse(
|
||||
IN const char * ActionName, /** The action name. */
|
||||
IN const char * ServType, /** The service type. */
|
||||
IN int NumArg, /** The number of argument pairs passed. */
|
||||
IN const char * Arg, /** The status variable name and value pair. */
|
||||
IN ... /* Other status variable name and value pairs. */
|
||||
);
|
||||
|
||||
/** {\bf UpnpAddToActionResponse} creates an action response
|
||||
* packet based on its output parameters (status variable name
|
||||
* and value pair). This API is especially suitable inside
|
||||
* a loop to add any number of input parameters into an existing action
|
||||
* response. If no action document exists in the beginning, a
|
||||
* {\bf Upnp_Document} variable initialized with {\tt NULL} should be passed
|
||||
* as a parameter.
|
||||
* This API is especially suitable inside a loop to add any number of input
|
||||
* parameters into an existing action response. If no action document exists
|
||||
* in the beginning, a \b Upnp_Document variable initialized with <tt>NULL</tt>
|
||||
* should be passed as a parameter.
|
||||
*
|
||||
* @return [int] An integer representing one of the following:
|
||||
* \begin{itemize}
|
||||
* \item {\tt UPNP_E_SUCCESS}: The operation completed successfully.
|
||||
* \item {\tt UPNP_E_INVALID_PARAM}: One or more of the parameters
|
||||
* are invalid.
|
||||
* \item {\tt UPNP_E_OUTOF_MEMORY}: Insufficient resources exist to
|
||||
* It is a wrapper function that calls addToAction() function to add the
|
||||
* argument in the action request.
|
||||
*
|
||||
* \return An integer representing one of the following:
|
||||
* \li <tt>UPNP_E_SUCCESS</tt>: The operation completed successfully.
|
||||
* \li <tt>UPNP_E_INVALID_PARAM</tt>: One or more of the parameters are invalid.
|
||||
* \li <tt>UPNP_E_OUTOF_MEMORY</tt>: Insufficient resources exist to
|
||||
* complete this operation.
|
||||
* \end{itemize}
|
||||
*/
|
||||
|
||||
EXPORT_SPEC int UpnpAddToActionResponse(
|
||||
IN OUT IXML_Document ** ActionResponse,
|
||||
/** Pointer to a document to
|
||||
store the action document
|
||||
node. */
|
||||
IN const char * ActionName, /** The action name. */
|
||||
IN const char * ServType, /** The service type. */
|
||||
IN const char * ArgName, /** The status variable name. */
|
||||
IN const char * ArgVal /** The status variable value. */
|
||||
);
|
||||
/*! [in,out] Pointer to a document to store the action document node. */
|
||||
IXML_Document **ActionResponse,
|
||||
/*! [in] The action name. */
|
||||
const char *ActionName,
|
||||
/*! [in] The service type. */
|
||||
const char *ServType,
|
||||
/*! [in] The status variable name. */
|
||||
const char *ArgName,
|
||||
/*! [in] The status variable value. */
|
||||
const char *ArgVal);
|
||||
|
||||
/** {\bf UpnpAddToPropertySet} can be used when an application needs to
|
||||
* transfer the status of many variables at once. It can be used
|
||||
* (inside a loop) to add some extra status variables into an existing
|
||||
* property set. If the application does not already have a property
|
||||
* set document, the application should create a variable initialized
|
||||
* with {\tt NULL} and pass that as the first parameter.
|
||||
|
||||
/*!
|
||||
* \brief Creates a property set message packet.
|
||||
*
|
||||
* @return [int] An integer representing one of the following:
|
||||
* \begin{itemize}
|
||||
* \item {\tt UPNP_E_SUCCESS}: The operation completed successfully.
|
||||
* \item {\tt UPNP_E_INVALID_PARAM}: One or more of the parameters
|
||||
* are invalid.
|
||||
* \item {\tt UPNP_E_OUTOF_MEMORY}: Insufficient resources exist to
|
||||
* Any number of input parameters can be passed to this function but every
|
||||
* input variable name should have a matching value input argument.
|
||||
*
|
||||
* \return <tt>NULL</tt> on failure, or the property-set document node.
|
||||
*/
|
||||
EXPORT_SPEC IXML_Document *UpnpCreatePropertySet(
|
||||
/*! [in] The number of argument pairs passed. */
|
||||
int NumArg,
|
||||
/*! [in] The status variable name and value pair. */
|
||||
const char *Arg,
|
||||
/*! [in] Variable sized list with the rest of the parameters. */
|
||||
...);
|
||||
|
||||
|
||||
/*!
|
||||
* \brief Can be used when an application needs to transfer the status of many
|
||||
* variables at once.
|
||||
*
|
||||
* It can be used (inside a loop) to add some extra status variables into an
|
||||
* existing property set. If the application does not already have a property
|
||||
* set document, the application should create a variable initialized with
|
||||
* <tt>NULL</tt> and pass that as the first parameter.
|
||||
*
|
||||
* \return An integer representing one of the following:
|
||||
* \li <tt>UPNP_E_SUCCESS</tt>: The operation completed successfully.
|
||||
* \li <tt>UPNP_E_INVALID_PARAM</tt>: One or more of the parameters are invalid.
|
||||
* \li <tt>UPNP_E_OUTOF_MEMORY</tt>: Insufficient resources exist to
|
||||
* complete this operation.
|
||||
* \end{itemize}
|
||||
*
|
||||
*/
|
||||
|
||||
EXPORT_SPEC int UpnpAddToPropertySet(
|
||||
IN OUT IXML_Document **PropSet,
|
||||
/** A pointer to the document containing
|
||||
the property set document node. */
|
||||
IN const char * ArgName, /** The status variable name. */
|
||||
IN const char * ArgVal /** The status variable value. */
|
||||
);
|
||||
/*! [in,out] A pointer to the document containing the property set document node. */
|
||||
IXML_Document **PropSet,
|
||||
/*! [in] The status variable name. */
|
||||
const char *ArgName,
|
||||
/*! [in] The status variable value. */
|
||||
const char *ArgVal);
|
||||
|
||||
/** {\bf UpnpCreatePropertySet} creates a property set
|
||||
* message packet. Any number of input parameters can be passed
|
||||
* to this function but every input variable name should have
|
||||
* a matching value input argument.
|
||||
*
|
||||
* @return [IXML_Document*] {\tt NULL} on failure, or the property-set
|
||||
* document node.
|
||||
*
|
||||
*/
|
||||
|
||||
EXPORT_SPEC IXML_Document* UpnpCreatePropertySet(
|
||||
IN int NumArg, /** The number of argument pairs passed. */
|
||||
IN const char* Arg, /** The status variable name and value pair. */
|
||||
IN ...
|
||||
);
|
||||
|
||||
/** {\bf UpnpGetErrorMessage} converts an SDK error code into a
|
||||
* string error message suitable for display. The memory returned
|
||||
* from this function should NOT be freed.
|
||||
*
|
||||
* @return [char*] An ASCII text string representation of the error message
|
||||
* associated with the error code.
|
||||
*/
|
||||
|
||||
EXPORT_SPEC const char * UpnpGetErrorMessage(
|
||||
int errorcode /** The SDK error code to convert. */
|
||||
);
|
||||
|
||||
/*! @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*! @} */
|
||||
|
||||
|
||||
#endif /* UPNP_HAVE_TOOLS */
|
||||
|
||||
|
||||
#endif /* UPNP_TOOLS_H */
|
||||
|
||||
|
@@ -1,51 +1,55 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (c) 2000-2003 Intel Corporation
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above copyright notice,
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// and/or other materials provided with the distribution.
|
||||
// * Neither name of Intel Corporation nor the names of its contributors
|
||||
// may be used to endorse or promote products derived from this software
|
||||
// without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
|
||||
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Copyright (c) 2000-2003 Intel Corporation
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* - Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* - Neither name of Intel Corporation nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
#ifndef SAMPLE_UTIL_H
|
||||
#define SAMPLE_UTIL_H
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "ithread.h"
|
||||
#include "ixml.h"
|
||||
#include "ixml.h" /* for IXML_Document, IXML_Element */
|
||||
#include "upnp.h" /* for Upnp_EventType */
|
||||
#include "upnptools.h"
|
||||
|
||||
|
||||
// mutex to control displaying of events
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
/* mutex to control displaying of events */
|
||||
extern ithread_mutex_t display_mutex;
|
||||
|
||||
|
||||
@@ -166,7 +170,7 @@ int SampleUtil_PrintEvent(IN Upnp_EventType EventType,
|
||||
********************************************************************************/
|
||||
int SampleUtil_FindAndParseService (
|
||||
IN IXML_Document *DescDoc,
|
||||
IN const char *location,
|
||||
IN const char* location,
|
||||
IN char *serviceType,
|
||||
OUT char **serviceId,
|
||||
OUT char **eventURL,
|
||||
|
@@ -937,23 +937,24 @@ TvStateUpdate( char *UDN,
|
||||
*
|
||||
********************************************************************************/
|
||||
void TvCtrlPointHandleEvent(
|
||||
const Upnp_SID sid,
|
||||
const char *sid,
|
||||
int evntkey,
|
||||
IXML_Document *changes)
|
||||
{
|
||||
struct TvDeviceNode *tmpdevnode;
|
||||
int service;
|
||||
const char *aux_sid = NULL;
|
||||
|
||||
ithread_mutex_lock(&DeviceListMutex);
|
||||
|
||||
tmpdevnode = GlobalDeviceList;
|
||||
while (tmpdevnode) {
|
||||
for (service = 0; service < TV_SERVICE_SERVCOUNT; ++service) {
|
||||
if(strcmp(tmpdevnode->device.TvService[service].SID, sid) == 0) {
|
||||
if (strcmp(tmpdevnode->device.TvService[service].SID, sid) == 0) {
|
||||
SampleUtil_Print("Received Tv %s Event: %d for SID %s",
|
||||
TvServiceName[service],
|
||||
evntkey,
|
||||
sid );
|
||||
aux_sid);
|
||||
TvStateUpdate(
|
||||
tmpdevnode->device.UDN,
|
||||
service,
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/*******************************************************************************
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright (c) 2000-2003 Intel Corporation
|
||||
* All rights reserved.
|
||||
@@ -27,29 +27,40 @@
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************/
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef UPNP_TV_CTRLPT_H
|
||||
#define UPNP_TV_CTRLPT_H
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "sample_util.h"
|
||||
|
||||
|
||||
#include "ithread.h"
|
||||
#ifndef WIN32
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include "upnp.h"
|
||||
#include "UpnpString.h"
|
||||
#include "upnptools.h"
|
||||
|
||||
|
||||
#include <signal.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "upnp.h"
|
||||
#include "upnptools.h"
|
||||
#include "sample_util.h"
|
||||
|
||||
#ifdef WIN32
|
||||
/* Do not #include <unistd.h> */
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
|
||||
#define TV_SERVICE_SERVCOUNT 2
|
||||
#define TV_SERVICE_CONTROL 0
|
||||
@@ -110,11 +121,11 @@ extern ithread_mutex_t DeviceListMutex;
|
||||
|
||||
extern UpnpClient_Handle ctrlpt_handle;
|
||||
|
||||
void TvCtrlPointPrintHelp( void );
|
||||
void TvCtrlPointPrintHelp(void);
|
||||
int TvCtrlPointDeleteNode(struct TvDeviceNode *);
|
||||
int TvCtrlPointRemoveDevice(const char *);
|
||||
int TvCtrlPointRemoveAll( void );
|
||||
int TvCtrlPointRefresh( void );
|
||||
int TvCtrlPointRemoveAll(void);
|
||||
int TvCtrlPointRefresh(void);
|
||||
|
||||
|
||||
int TvCtrlPointSendAction(int, int, char *, char **, char **, int);
|
||||
@@ -138,20 +149,20 @@ int TvCtrlPointGetContrast(int);
|
||||
int TvCtrlPointGetBrightness(int);
|
||||
|
||||
int TvCtrlPointGetDevice(int, struct TvDeviceNode **);
|
||||
int TvCtrlPointPrintList( void );
|
||||
int TvCtrlPointPrintList(void);
|
||||
int TvCtrlPointPrintDevice(int);
|
||||
void TvCtrlPointAddDevice(IXML_Document *, const char *, int);
|
||||
void TvCtrlPointHandleGetVar(const char *, const char *, const DOMString);
|
||||
void TvStateUpdate(char*,int, IXML_Document * , char **);
|
||||
void TvCtrlPointHandleEvent(const Upnp_SID, int, IXML_Document *);
|
||||
void TvCtrlPointHandleEvent(const char *, int, IXML_Document *);
|
||||
void TvCtrlPointHandleSubscribeUpdate(const char *, const Upnp_SID, int);
|
||||
int TvCtrlPointCallbackEventHandler(Upnp_EventType, void *, void *);
|
||||
void TvCtrlPointVerifyTimeouts(int);
|
||||
void TvCtrlPointPrintCommands( void );
|
||||
void* TvCtrlPointCommandLoop( void* );
|
||||
int TvCtrlPointStart( print_string printFunctionPtr, state_update updateFunctionPtr );
|
||||
int TvCtrlPointStop( void );
|
||||
int TvCtrlPointProcessCommand( char *cmdline );
|
||||
void TvCtrlPointPrintCommands(void);
|
||||
void* TvCtrlPointCommandLoop(void *);
|
||||
int TvCtrlPointStart(print_string printFunctionPtr, state_update updateFunctionPtr);
|
||||
int TvCtrlPointStop(void);
|
||||
int TvCtrlPointProcessCommand(char *cmdline);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
|
@@ -1,53 +1,66 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (c) 2000-2003 Intel Corporation
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above copyright notice,
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// and/or other materials provided with the distribution.
|
||||
// * Neither name of Intel Corporation nor the names of its contributors
|
||||
// may be used to endorse or promote products derived from this software
|
||||
// without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
|
||||
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright (c) 2000-2003 Intel Corporation
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* - Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* - Neither name of Intel Corporation nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef UPNP_TV_DEVICE_H
|
||||
#define UPNP_TV_DEVICE_H
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "ithread.h"
|
||||
#include <stdlib.h>
|
||||
#ifndef WIN32
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <string.h>
|
||||
#include "upnp.h"
|
||||
|
||||
#include "sample_util.h"
|
||||
|
||||
|
||||
#include "ithread.h"
|
||||
#include "upnp.h"
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
#ifdef WIN32
|
||||
/* Do not #include <unistd.h> */
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
|
||||
//Color constants
|
||||
#define MAX_COLOR 10
|
||||
#define MIN_COLOR 1
|
||||
@@ -148,8 +161,7 @@ extern char *TvServiceType[];
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
typedef int (*upnp_action) (IXML_Document *request, IXML_Document **out,
|
||||
char **errorString);
|
||||
typedef int (*upnp_action) (IXML_Document *request, IXML_Document **out, char **errorString);
|
||||
|
||||
/* Structure for storing Tv Service
|
||||
identifiers and state table */
|
||||
@@ -193,7 +205,7 @@ extern ithread_mutex_t TVDevMutex;
|
||||
* struct TvService *out - service containing action table to set.
|
||||
*
|
||||
*****************************************************************************/
|
||||
int SetActionTable(int serviceType, struct TvService * out);
|
||||
int SetActionTable(int serviceType, struct TvService *out);
|
||||
|
||||
/******************************************************************************
|
||||
* TvDeviceStateTableInit
|
||||
@@ -313,8 +325,7 @@ int TvDeviceSetServiceTableVar(unsigned int, unsigned int, char*);
|
||||
* char **errorString - errorString (in case action was unsuccessful)
|
||||
*
|
||||
*****************************************************************************/
|
||||
int TvDevicePowerOn(IN IXML_Document * in, OUT IXML_Document **out,
|
||||
OUT char **errorString);
|
||||
int TvDevicePowerOn(IN IXML_Document * in, OUT IXML_Document **out, OUT char **errorString);
|
||||
|
||||
/******************************************************************************
|
||||
* TvDevicePowerOff
|
||||
@@ -329,8 +340,7 @@ int TvDevicePowerOn(IN IXML_Document * in, OUT IXML_Document **out,
|
||||
* char **errorString - errorString (in case action was unsuccessful)
|
||||
*
|
||||
*****************************************************************************/
|
||||
int TvDevicePowerOff(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
OUT char **errorString);
|
||||
int TvDevicePowerOff(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
|
||||
|
||||
/******************************************************************************
|
||||
* TvDeviceSetChannel
|
||||
@@ -347,8 +357,7 @@ int TvDevicePowerOff(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
* char **errorString - errorString (in case action was unsuccessful)
|
||||
*
|
||||
*****************************************************************************/
|
||||
int TvDeviceSetChannel(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
OUT char **errorString);
|
||||
int TvDeviceSetChannel(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
|
||||
|
||||
/******************************************************************************
|
||||
* TvDeviceIncreaseChannel
|
||||
@@ -363,8 +372,7 @@ int TvDeviceSetChannel(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
* char **errorString - errorString (in case action was unsuccessful)
|
||||
*
|
||||
*****************************************************************************/
|
||||
int TvDeviceIncreaseChannel(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
OUT char **errorString);
|
||||
int TvDeviceIncreaseChannel(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
|
||||
/******************************************************************************
|
||||
* TvDeviceDecreaseChannel
|
||||
*
|
||||
@@ -378,8 +386,7 @@ int TvDeviceIncreaseChannel(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
* char **errorString - errorString (in case action was unsuccessful)
|
||||
*
|
||||
*****************************************************************************/
|
||||
int TvDeviceDecreaseChannel(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
OUT char **errorString);
|
||||
int TvDeviceDecreaseChannel(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
|
||||
/******************************************************************************
|
||||
* TvDeviceSetVolume
|
||||
*
|
||||
@@ -395,8 +402,7 @@ int TvDeviceDecreaseChannel(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
* char **errorString - errorString (in case action was unsuccessful)
|
||||
*
|
||||
*****************************************************************************/
|
||||
int TvDeviceSetVolume(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
OUT char **errorString);
|
||||
int TvDeviceSetVolume(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
|
||||
|
||||
/******************************************************************************
|
||||
* TvDeviceIncreaseVolume
|
||||
@@ -411,8 +417,7 @@ int TvDeviceSetVolume(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
* IXML_Document **out - action result document
|
||||
* char **errorString - errorString (in case action was unsuccessful)
|
||||
*****************************************************************************/
|
||||
int TvDeviceIncreaseVolume(IN IXML_Document *in, OUT IXML_Document**out,
|
||||
OUT char **errorString);
|
||||
int TvDeviceIncreaseVolume(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
@@ -428,8 +433,7 @@ int TvDeviceIncreaseVolume(IN IXML_Document *in, OUT IXML_Document**out,
|
||||
* char **errorString - errorString (in case action was unsuccessful)
|
||||
*
|
||||
*****************************************************************************/
|
||||
int TvDeviceDecreaseVolume(IN IXML_Document *in, OUT IXML_Document**out,
|
||||
OUT char **errorString);
|
||||
int TvDeviceDecreaseVolume(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
|
||||
|
||||
|
||||
//Picture Service Actions
|
||||
@@ -449,8 +453,7 @@ int TvDeviceDecreaseVolume(IN IXML_Document *in, OUT IXML_Document**out,
|
||||
* char **errorString - errorString (in case action was unsuccessful)
|
||||
*
|
||||
*****************************************************************************/
|
||||
int TvDeviceSetColor(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
OUT char **errorString);
|
||||
int TvDeviceSetColor(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
@@ -465,8 +468,7 @@ int TvDeviceSetColor(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
* IXML_Document **out - action result document
|
||||
* char **errorString - errorString (in case action was unsuccessful)
|
||||
*****************************************************************************/
|
||||
int TvDeviceIncreaseColor(IN IXML_Document * in, OUT IXML_Document **out,
|
||||
OUT char **errorString);
|
||||
int TvDeviceIncreaseColor(IN IXML_Document * in, OUT IXML_Document **out, OUT char **errorString);
|
||||
|
||||
/******************************************************************************
|
||||
* TvDeviceDecreaseColor
|
||||
@@ -480,8 +482,7 @@ int TvDeviceIncreaseColor(IN IXML_Document * in, OUT IXML_Document **out,
|
||||
* IXML_Document **out - action result document
|
||||
* char **errorString - errorString (in case action was unsuccessful)
|
||||
*****************************************************************************/
|
||||
int TvDeviceDecreaseColor(IN IXML_Document * in, OUT IXML_Document **out,
|
||||
OUT char **errorString);
|
||||
int TvDeviceDecreaseColor(IN IXML_Document * in, OUT IXML_Document **out, OUT char **errorString);
|
||||
|
||||
/******************************************************************************
|
||||
* TvDeviceSetTint
|
||||
@@ -498,8 +499,7 @@ int TvDeviceDecreaseColor(IN IXML_Document * in, OUT IXML_Document **out,
|
||||
* char **errorString - errorString (in case action was unsuccessful)
|
||||
*
|
||||
*****************************************************************************/
|
||||
int TvDeviceSetTint(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
OUT char **errorString);
|
||||
int TvDeviceSetTint(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
|
||||
|
||||
/******************************************************************************
|
||||
* TvDeviceIncreaseTint
|
||||
@@ -514,8 +514,7 @@ int TvDeviceSetTint(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
* char **errorString - errorString (in case action was unsuccessful)
|
||||
*
|
||||
*****************************************************************************/
|
||||
int TvDeviceIncreaseTint(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
OUT char **errorString);
|
||||
int TvDeviceIncreaseTint(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
|
||||
|
||||
/******************************************************************************
|
||||
* TvDeviceDecreaseTint
|
||||
@@ -530,8 +529,7 @@ int TvDeviceIncreaseTint(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
* char **errorString - errorString (in case action was unsuccessful)
|
||||
*
|
||||
*****************************************************************************/
|
||||
int TvDeviceDecreaseTint(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
OUT char **errorString);
|
||||
int TvDeviceDecreaseTint(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
|
||||
|
||||
/*****************************************************************************
|
||||
* TvDeviceSetContrast
|
||||
@@ -548,8 +546,7 @@ int TvDeviceDecreaseTint(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
* char **errorString - errorString (in case action was unsuccessful)
|
||||
*
|
||||
****************************************************************************/
|
||||
int TvDeviceSetContrast(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
OUT char **errorString);
|
||||
int TvDeviceSetContrast(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
|
||||
|
||||
/******************************************************************************
|
||||
* TvDeviceIncreaseContrast
|
||||
@@ -565,8 +562,7 @@ int TvDeviceSetContrast(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
* char **errorString - errorString (in case action was unsuccessful)
|
||||
*
|
||||
*****************************************************************************/
|
||||
int TvDeviceIncreaseContrast(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
OUT char **errorString);
|
||||
int TvDeviceIncreaseContrast(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
|
||||
/******************************************************************************
|
||||
* TvDeviceDecreaseContrast
|
||||
*
|
||||
@@ -580,8 +576,7 @@ int TvDeviceIncreaseContrast(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
* char **errorString - errorString (in case action was unsuccessful)
|
||||
*
|
||||
*****************************************************************************/
|
||||
int TvDeviceDecreaseContrast(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
OUT char **errorString);
|
||||
int TvDeviceDecreaseContrast(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
|
||||
|
||||
/******************************************************************************
|
||||
* TvDeviceSetBrightness
|
||||
@@ -595,8 +590,7 @@ int TvDeviceDecreaseContrast(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
* brightness -- The brightness value to change to.
|
||||
*
|
||||
*****************************************************************************/
|
||||
int TvDeviceSetBrightness(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
OUT char **errorString);
|
||||
int TvDeviceSetBrightness(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
|
||||
|
||||
/******************************************************************************
|
||||
* TvDeviceIncreaseBrightness
|
||||
@@ -611,8 +605,7 @@ int TvDeviceSetBrightness(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
* char **errorString - errorString (in case action was unsuccessful)
|
||||
*
|
||||
*****************************************************************************/
|
||||
int TvDeviceIncreaseBrightness(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
OUT char **errorString);
|
||||
int TvDeviceIncreaseBrightness(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
|
||||
|
||||
/******************************************************************************
|
||||
* TvDeviceDecreaseBrightness
|
||||
@@ -626,12 +619,11 @@ int TvDeviceIncreaseBrightness(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
* char **errorString - errorString (in case action was unsuccessful)
|
||||
*
|
||||
*****************************************************************************/
|
||||
int TvDeviceDecreaseBrightness(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
OUT char **errorString);
|
||||
int TvDeviceDecreaseBrightness(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
|
||||
|
||||
int TvDeviceStart(char * ip_address, unsigned short port,char * desc_doc_name,
|
||||
char *web_dir_path, print_string pfun);
|
||||
int TvDeviceStop();
|
||||
int TvDeviceStop(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@@ -943,12 +943,13 @@ TvStateUpdate( char *UDN,
|
||||
*
|
||||
********************************************************************************/
|
||||
void TvCtrlPointHandleEvent(
|
||||
const Upnp_SID sid,
|
||||
const char *sid,
|
||||
int evntkey,
|
||||
IXML_Document *changes)
|
||||
{
|
||||
struct TvDeviceNode *tmpdevnode;
|
||||
int service;
|
||||
const char *aux_sid = NULL;
|
||||
|
||||
ithread_mutex_lock(&DeviceListMutex);
|
||||
|
||||
@@ -959,7 +960,7 @@ void TvCtrlPointHandleEvent(
|
||||
SampleUtil_Print("Received Tv %s Event: %d for SID %s",
|
||||
TvServiceName[service],
|
||||
evntkey,
|
||||
sid);
|
||||
aux_sid);
|
||||
TvStateUpdate(
|
||||
tmpdevnode->device.UDN,
|
||||
service,
|
||||
|
@@ -44,6 +44,7 @@ extern "C" {
|
||||
|
||||
#include "ithread.h"
|
||||
#include "upnp.h"
|
||||
#include "UpnpString.h"
|
||||
#include "upnptools.h"
|
||||
|
||||
|
||||
@@ -121,7 +122,7 @@ extern ithread_mutex_t DeviceListMutex;
|
||||
extern UpnpClient_Handle ctrlpt_handle;
|
||||
|
||||
void TvCtrlPointPrintHelp(void);
|
||||
int TvCtrlPointDeleteNode(struct TvDeviceNode*);
|
||||
int TvCtrlPointDeleteNode(struct TvDeviceNode *);
|
||||
int TvCtrlPointRemoveDevice(const char *);
|
||||
int TvCtrlPointRemoveAll(void);
|
||||
int TvCtrlPointRefresh(void);
|
||||
@@ -148,20 +149,20 @@ int TvCtrlPointGetContrast(int);
|
||||
int TvCtrlPointGetBrightness(int);
|
||||
|
||||
int TvCtrlPointGetDevice(int, struct TvDeviceNode **);
|
||||
int TvCtrlPointPrintList( void );
|
||||
int TvCtrlPointPrintList(void);
|
||||
int TvCtrlPointPrintDevice(int);
|
||||
void TvCtrlPointAddDevice(IXML_Document *, const char *, int);
|
||||
void TvCtrlPointHandleGetVar(const char *, const char *, const DOMString);
|
||||
void TvStateUpdate(char*,int, IXML_Document * , char **);
|
||||
void TvCtrlPointHandleEvent(const Upnp_SID, int, IXML_Document *);
|
||||
void TvCtrlPointHandleEvent(const char *, int, IXML_Document *);
|
||||
void TvCtrlPointHandleSubscribeUpdate(const char *, const Upnp_SID, int);
|
||||
int TvCtrlPointCallbackEventHandler(Upnp_EventType, void *, void *);
|
||||
void TvCtrlPointVerifyTimeouts(int);
|
||||
void TvCtrlPointPrintCommands( void );
|
||||
void* TvCtrlPointCommandLoop( void* );
|
||||
int TvCtrlPointStart( print_string printFunctionPtr, state_update updateFunctionPtr );
|
||||
int TvCtrlPointStop( void );
|
||||
int TvCtrlPointProcessCommand( char *cmdline );
|
||||
void TvCtrlPointPrintCommands(void);
|
||||
void* TvCtrlPointCommandLoop(void *);
|
||||
int TvCtrlPointStart(print_string printFunctionPtr, state_update updateFunctionPtr);
|
||||
int TvCtrlPointStop(void);
|
||||
int TvCtrlPointProcessCommand(char *cmdline);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/*******************************************************************************
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright (c) 2000-2003 Intel Corporation
|
||||
* All rights reserved.
|
||||
@@ -27,28 +27,40 @@
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************/
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef UPNP_TV_DEVICE_H
|
||||
#define UPNP_TV_DEVICE_H
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "ithread.h"
|
||||
#include <stdlib.h>
|
||||
#ifndef WIN32
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <string.h>
|
||||
#include "upnp.h"
|
||||
|
||||
#include "sample_util.h"
|
||||
|
||||
|
||||
#include "ithread.h"
|
||||
#include "upnp.h"
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
#ifdef WIN32
|
||||
/* Do not #include <unistd.h> */
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
|
||||
//Color constants
|
||||
#define MAX_COLOR 10
|
||||
#define MIN_COLOR 1
|
||||
@@ -149,8 +161,7 @@ extern char *TvServiceType[];
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
typedef int (*upnp_action) (IXML_Document *request, IXML_Document **out,
|
||||
char **errorString);
|
||||
typedef int (*upnp_action) (IXML_Document *request, IXML_Document **out, char **errorString);
|
||||
|
||||
/* Structure for storing Tv Service
|
||||
identifiers and state table */
|
||||
@@ -194,7 +205,7 @@ extern ithread_mutex_t TVDevMutex;
|
||||
* struct TvService *out - service containing action table to set.
|
||||
*
|
||||
*****************************************************************************/
|
||||
int SetActionTable(int serviceType, struct TvService * out);
|
||||
int SetActionTable(int serviceType, struct TvService *out);
|
||||
|
||||
/******************************************************************************
|
||||
* TvDeviceStateTableInit
|
||||
@@ -314,8 +325,7 @@ int TvDeviceSetServiceTableVar(unsigned int, unsigned int, char*);
|
||||
* char **errorString - errorString (in case action was unsuccessful)
|
||||
*
|
||||
*****************************************************************************/
|
||||
int TvDevicePowerOn(IN IXML_Document * in, OUT IXML_Document **out,
|
||||
OUT char **errorString);
|
||||
int TvDevicePowerOn(IN IXML_Document * in, OUT IXML_Document **out, OUT char **errorString);
|
||||
|
||||
/******************************************************************************
|
||||
* TvDevicePowerOff
|
||||
@@ -330,8 +340,7 @@ int TvDevicePowerOn(IN IXML_Document * in, OUT IXML_Document **out,
|
||||
* char **errorString - errorString (in case action was unsuccessful)
|
||||
*
|
||||
*****************************************************************************/
|
||||
int TvDevicePowerOff(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
OUT char **errorString);
|
||||
int TvDevicePowerOff(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
|
||||
|
||||
/******************************************************************************
|
||||
* TvDeviceSetChannel
|
||||
@@ -348,8 +357,7 @@ int TvDevicePowerOff(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
* char **errorString - errorString (in case action was unsuccessful)
|
||||
*
|
||||
*****************************************************************************/
|
||||
int TvDeviceSetChannel(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
OUT char **errorString);
|
||||
int TvDeviceSetChannel(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
|
||||
|
||||
/******************************************************************************
|
||||
* TvDeviceIncreaseChannel
|
||||
@@ -364,8 +372,7 @@ int TvDeviceSetChannel(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
* char **errorString - errorString (in case action was unsuccessful)
|
||||
*
|
||||
*****************************************************************************/
|
||||
int TvDeviceIncreaseChannel(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
OUT char **errorString);
|
||||
int TvDeviceIncreaseChannel(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
|
||||
/******************************************************************************
|
||||
* TvDeviceDecreaseChannel
|
||||
*
|
||||
@@ -379,8 +386,7 @@ int TvDeviceIncreaseChannel(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
* char **errorString - errorString (in case action was unsuccessful)
|
||||
*
|
||||
*****************************************************************************/
|
||||
int TvDeviceDecreaseChannel(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
OUT char **errorString);
|
||||
int TvDeviceDecreaseChannel(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
|
||||
/******************************************************************************
|
||||
* TvDeviceSetVolume
|
||||
*
|
||||
@@ -396,8 +402,7 @@ int TvDeviceDecreaseChannel(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
* char **errorString - errorString (in case action was unsuccessful)
|
||||
*
|
||||
*****************************************************************************/
|
||||
int TvDeviceSetVolume(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
OUT char **errorString);
|
||||
int TvDeviceSetVolume(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
|
||||
|
||||
/******************************************************************************
|
||||
* TvDeviceIncreaseVolume
|
||||
@@ -412,8 +417,7 @@ int TvDeviceSetVolume(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
* IXML_Document **out - action result document
|
||||
* char **errorString - errorString (in case action was unsuccessful)
|
||||
*****************************************************************************/
|
||||
int TvDeviceIncreaseVolume(IN IXML_Document *in, OUT IXML_Document**out,
|
||||
OUT char **errorString);
|
||||
int TvDeviceIncreaseVolume(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
@@ -429,8 +433,7 @@ int TvDeviceIncreaseVolume(IN IXML_Document *in, OUT IXML_Document**out,
|
||||
* char **errorString - errorString (in case action was unsuccessful)
|
||||
*
|
||||
*****************************************************************************/
|
||||
int TvDeviceDecreaseVolume(IN IXML_Document *in, OUT IXML_Document**out,
|
||||
OUT char **errorString);
|
||||
int TvDeviceDecreaseVolume(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
|
||||
|
||||
|
||||
//Picture Service Actions
|
||||
@@ -450,8 +453,7 @@ int TvDeviceDecreaseVolume(IN IXML_Document *in, OUT IXML_Document**out,
|
||||
* char **errorString - errorString (in case action was unsuccessful)
|
||||
*
|
||||
*****************************************************************************/
|
||||
int TvDeviceSetColor(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
OUT char **errorString);
|
||||
int TvDeviceSetColor(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
@@ -466,8 +468,7 @@ int TvDeviceSetColor(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
* IXML_Document **out - action result document
|
||||
* char **errorString - errorString (in case action was unsuccessful)
|
||||
*****************************************************************************/
|
||||
int TvDeviceIncreaseColor(IN IXML_Document * in, OUT IXML_Document **out,
|
||||
OUT char **errorString);
|
||||
int TvDeviceIncreaseColor(IN IXML_Document * in, OUT IXML_Document **out, OUT char **errorString);
|
||||
|
||||
/******************************************************************************
|
||||
* TvDeviceDecreaseColor
|
||||
@@ -481,8 +482,7 @@ int TvDeviceIncreaseColor(IN IXML_Document * in, OUT IXML_Document **out,
|
||||
* IXML_Document **out - action result document
|
||||
* char **errorString - errorString (in case action was unsuccessful)
|
||||
*****************************************************************************/
|
||||
int TvDeviceDecreaseColor(IN IXML_Document * in, OUT IXML_Document **out,
|
||||
OUT char **errorString);
|
||||
int TvDeviceDecreaseColor(IN IXML_Document * in, OUT IXML_Document **out, OUT char **errorString);
|
||||
|
||||
/******************************************************************************
|
||||
* TvDeviceSetTint
|
||||
@@ -499,8 +499,7 @@ int TvDeviceDecreaseColor(IN IXML_Document * in, OUT IXML_Document **out,
|
||||
* char **errorString - errorString (in case action was unsuccessful)
|
||||
*
|
||||
*****************************************************************************/
|
||||
int TvDeviceSetTint(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
OUT char **errorString);
|
||||
int TvDeviceSetTint(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
|
||||
|
||||
/******************************************************************************
|
||||
* TvDeviceIncreaseTint
|
||||
@@ -515,8 +514,7 @@ int TvDeviceSetTint(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
* char **errorString - errorString (in case action was unsuccessful)
|
||||
*
|
||||
*****************************************************************************/
|
||||
int TvDeviceIncreaseTint(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
OUT char **errorString);
|
||||
int TvDeviceIncreaseTint(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
|
||||
|
||||
/******************************************************************************
|
||||
* TvDeviceDecreaseTint
|
||||
@@ -531,8 +529,7 @@ int TvDeviceIncreaseTint(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
* char **errorString - errorString (in case action was unsuccessful)
|
||||
*
|
||||
*****************************************************************************/
|
||||
int TvDeviceDecreaseTint(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
OUT char **errorString);
|
||||
int TvDeviceDecreaseTint(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
|
||||
|
||||
/*****************************************************************************
|
||||
* TvDeviceSetContrast
|
||||
@@ -549,8 +546,7 @@ int TvDeviceDecreaseTint(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
* char **errorString - errorString (in case action was unsuccessful)
|
||||
*
|
||||
****************************************************************************/
|
||||
int TvDeviceSetContrast(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
OUT char **errorString);
|
||||
int TvDeviceSetContrast(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
|
||||
|
||||
/******************************************************************************
|
||||
* TvDeviceIncreaseContrast
|
||||
@@ -566,8 +562,7 @@ int TvDeviceSetContrast(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
* char **errorString - errorString (in case action was unsuccessful)
|
||||
*
|
||||
*****************************************************************************/
|
||||
int TvDeviceIncreaseContrast(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
OUT char **errorString);
|
||||
int TvDeviceIncreaseContrast(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
|
||||
/******************************************************************************
|
||||
* TvDeviceDecreaseContrast
|
||||
*
|
||||
@@ -581,8 +576,7 @@ int TvDeviceIncreaseContrast(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
* char **errorString - errorString (in case action was unsuccessful)
|
||||
*
|
||||
*****************************************************************************/
|
||||
int TvDeviceDecreaseContrast(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
OUT char **errorString);
|
||||
int TvDeviceDecreaseContrast(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
|
||||
|
||||
/******************************************************************************
|
||||
* TvDeviceSetBrightness
|
||||
@@ -596,8 +590,7 @@ int TvDeviceDecreaseContrast(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
* brightness -- The brightness value to change to.
|
||||
*
|
||||
*****************************************************************************/
|
||||
int TvDeviceSetBrightness(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
OUT char **errorString);
|
||||
int TvDeviceSetBrightness(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
|
||||
|
||||
/******************************************************************************
|
||||
* TvDeviceIncreaseBrightness
|
||||
@@ -612,8 +605,7 @@ int TvDeviceSetBrightness(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
* char **errorString - errorString (in case action was unsuccessful)
|
||||
*
|
||||
*****************************************************************************/
|
||||
int TvDeviceIncreaseBrightness(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
OUT char **errorString);
|
||||
int TvDeviceIncreaseBrightness(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
|
||||
|
||||
/******************************************************************************
|
||||
* TvDeviceDecreaseBrightness
|
||||
@@ -627,8 +619,7 @@ int TvDeviceIncreaseBrightness(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
* char **errorString - errorString (in case action was unsuccessful)
|
||||
*
|
||||
*****************************************************************************/
|
||||
int TvDeviceDecreaseBrightness(IN IXML_Document *in, OUT IXML_Document **out,
|
||||
OUT char **errorString);
|
||||
int TvDeviceDecreaseBrightness(IN IXML_Document *in, OUT IXML_Document **out, OUT char **errorString);
|
||||
|
||||
int TvDeviceStart(char * ip_address, unsigned short port,char * desc_doc_name,
|
||||
char *web_dir_path, print_string pfun);
|
||||
|
@@ -149,7 +149,7 @@ void UpnpPrintf(
|
||||
ithread_mutex_lock(&GlobalDebugMutex);
|
||||
va_start(ArgList, FmtStr);
|
||||
if (!DEBUG_TARGET) {
|
||||
if( DbgFileName ) {
|
||||
if (DbgFileName) {
|
||||
UpnpDisplayFileAndLine(stdout, DbgFileName, DbgLineNo);
|
||||
}
|
||||
vfprintf(stdout, FmtStr, ArgList);
|
||||
@@ -324,32 +324,5 @@ void PrintThreadPoolStats(
|
||||
}
|
||||
|
||||
|
||||
void printNodes(IXML_Node *tmpRoot, int depth)
|
||||
{
|
||||
int i;
|
||||
IXML_NodeList *NodeList1;
|
||||
IXML_Node *ChildNode1;
|
||||
unsigned short NodeType;
|
||||
const DOMString NodeValue;
|
||||
const DOMString NodeName;
|
||||
NodeList1 = ixmlNode_getChildNodes(tmpRoot);
|
||||
for (i = 0; i < 100; ++i) {
|
||||
ChildNode1 = ixmlNodeList_item(NodeList1, i);
|
||||
if (ChildNode1 == NULL) {
|
||||
break;
|
||||
}
|
||||
|
||||
printNodes(ChildNode1, depth+1);
|
||||
NodeType = ixmlNode_getNodeType(ChildNode1);
|
||||
NodeValue = ixmlNode_getNodeValue(ChildNode1);
|
||||
NodeName = ixmlNode_getNodeName(ChildNode1);
|
||||
UpnpPrintf(UPNP_ALL, API, __FILE__, __LINE__,
|
||||
"DEPTH-%2d-IXML_Node Type %d, "
|
||||
"IXML_Node Name: %s, IXML_Node Value: %s\n",
|
||||
depth, NodeType, NodeName, NodeValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif /* DEBUG */
|
||||
|
||||
|
Reference in New Issue
Block a user