tv_device.h File Reference
Sample Code
`#include <stdio.h>`
`#include <signal.h>`
`#include "sample_util.h"`
`#include "ithread.h"`
`#include "upnp.h"`
`#include <stdlib.h>`
`#include <string.h>`
Include dependency graph for tv_device.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Data Structures

struct | TvService

## Functions

Device Sample Module
int | SetActionTable ( int serviceType, struct TvService *out)
| Initializes the action table for the specified service. More...
int | TvDeviceStateTableInit ( char *DescDocURL)
| Initialize the device state table for this TvDevice, pulling identifier info from the description Document. More...
int | TvDeviceHandleSubscriptionRequest ( const UpnpSubscriptionRequest *sr_event)
| Called during a subscription request callback. More...
int | TvDeviceHandleGetVarRequest ( UpnpStateVarRequest *cgv_event)
| Called during a get variable request callback. More...
int | TvDeviceHandleActionRequest ( UpnpActionRequest *ca_event)
| Called during an action request callback. More...
int | TvDeviceCallbackEventHandler ( Upnp_EventType, const void *Event, void *Cookie)
| The callback handler registered with the SDK while registering root device. More...
int | TvDeviceSetServiceTableVar ( unsigned int service, int variable, char *value)
| Update the TvDevice service state table, and notify all subscribed control points of the updated state. More...
int | TvDevicePowerOn ( IXML_Document *in, IXML_Document **out, const char **errorString)
| Turn the power on. More...
int | TvDevicePowerOff ( IXML_Document *in, IXML_Document **out, const char **errorString)
| Turn the power off. More...
int | TvDeviceSetChannel ( IXML_Document *in, IXML_Document **out, const char **errorString)
| Change the channel, update the TvDevice control service state table, and notify all subscribed control points of the updated state. More...
int | TvDeviceIncreaseChannel ( IXML_Document *in, IXML_Document **out, const char **errorString)
| Increase the channel. More...
int | TvDeviceDecreaseChannel ( IXML_Document *in, IXML_Document **out, const char **errorString)
| Decrease the channel. More...
int | TvDeviceSetVolume ( IXML_Document *in, IXML_Document **out, const char **errorString)
| Change the volume, update the TvDevice control service state table, and notify all subscribed control points of the updated state. More...
int | TvDeviceIncreaseVolume ( IXML_Document *in, IXML_Document **out, const char **errorString)
| Increase the volume. More...
int | TvDeviceDecreaseVolume ( IXML_Document *in, IXML_Document **out, const char **errorString)
| Decrease the volume. More...
int | TvDeviceSetColor ( IXML_Document *in, IXML_Document **out, const char **errorString)
| Change the color, update the TvDevice picture service state table, and notify all subscribed control points of the updated state. More...
int | TvDeviceIncreaseColor ( IXML_Document *in, IXML_Document **out, const char **errorString)
| Increase the color. More...
int | TvDeviceDecreaseColor ( IXML_Document *in, IXML_Document **out, const char **errorString)
| Decrease the color. More...
int | TvDeviceSetTint ( IXML_Document *in, IXML_Document **out, const char **errorString)
| Change the tint, update the TvDevice picture service state table, and notify all subscribed control points of the updated state. More...
int | TvDeviceIncreaseContrast ( IXML_Document *in, IXML_Document **out, const char **errorString)
| Increase the contrast. More...
int | TvDeviceDecreaseContrast ( IXML_Document *in, IXML_Document **out, const char **errorString)
| Decrease the contrast. More...
int | TvDeviceSetBrightness ( IXML_Document *in, IXML_Document **out, const char **errorString)
| Change the brightness, update the TvDevice picture service state table, and notify all subscribed control points of the updated state. More...
int | TvDeviceIncreaseBrightness ( IXML_Document *in, IXML_Document **out, const char **errorString)
| Increase brightnesss. More...
int | TvDeviceDecreaseBrightness ( IXML_Document *in, IXML_Document **out, const char **errorString)
| Decrease brightnesss. More...
int | TvDeviceStart ( char *ip_address, unsigned short port, const char *desc_doc_name, const char *web_dir_path, print_string pfun, int combo)
| Initializes the UPnP Sdk, registers the device, and sends out advertisements. More...
int | TvDeviceStop (void)
| Stops the device. Uninitializes the sdk. More...
void * | TvDeviceCommandLoop (void *args)
| Function that receives commands from the user at the command prompt during the lifetime of the device, and calls the appropriate functions for those commands. Only one command, exit, is currently defined. More...
int | device_main (int argc, char *argv[])
| Main entry point for tv device application. More...

## Device Sample API

#define | MAX_COLOR 10
#define | MIN_COLOR 1
#define | MAX_BRIGHTNESS 10
#define | MIN_BRIGHTNESS 1
#define | POWER_ON 1
#define | POWER_OFF 0
#define | MAX_TINT 10
#define | MIN_TINT 1
#define | MAX_VOLUME 10
#define | MIN_VOLUME 1
#define | MAX_CONTRAST 10
#define | MIN_CONTRAST 1
#define | MAX_CHANNEL 100
#define | MIN_CHANNEL 1
#define | TV_SERVICE_SERVCOUNT 2
#define | TV_SERVICE_CONTROL 0
#define | TV_SERVICE_PICTURE 1
#define | TV_CONTROL_VARCOUNT 3
#define | TV_CONTROL_POWER 0
#define | TV_CONTROL_CHANNEL 1
#define | TV_CONTROL_VOLUME 2
#define | TV_PICTURE_VARCOUNT 4
#define | TV_PICTURE_COLOR 0
#define | TV_PICTURE_TINT 1
#define | TV_PICTURE_CONTRAST 2
#define | TV_PICTURE_BRIGHTNESS 3
#define | TV_MAX_VAL_LEN 5
#define | TV_MAXACTIONS 12
#define | TV_MAXVARS TV_PICTURE_VARCOUNT
typedef int(* | upnp_action) (IXML_Document *request, IXML_Document **out, const char **errorString)
| Prototype for all actions. For each action that a service implements, there is a corresponding function with this prototype. More...
struct TvService | tv_service_table []
UpnpDevice_Handle | device_handle
ithread_mutex_t | TVDevMutex
int | TvDeviceIncreaseTint (IXML_Document *in, IXML_Document **out, const char **errorString)
| Increase tint. More...
int | TvDeviceDecreaseTint (IXML_Document *in, IXML_Document **out, const char **errorString)
| Decrease tint. More...
int | TvDeviceSetContrast (IXML_Document *in, IXML_Document **out, const char **errorString)
| Change the contrast, update the TvDevice picture service state table, and notify all subscribed control points of the updated state. More...