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