1 #ifndef UPNP_TV_DEVICE_H
2 #define UPNP_TV_DEVICE_H
67 #define MAX_BRIGHTNESS 10
68 #define MIN_BRIGHTNESS 1
83 #define MAX_CONTRAST 10
84 #define MIN_CONTRAST 1
87 #define MAX_CHANNEL 100
91 #define TV_SERVICE_SERVCOUNT 2
94 #define TV_SERVICE_CONTROL 0
97 #define TV_SERVICE_PICTURE 1
100 #define TV_CONTROL_VARCOUNT 3
103 #define TV_CONTROL_POWER 0
106 #define TV_CONTROL_CHANNEL 1
109 #define TV_CONTROL_VOLUME 2
112 #define TV_PICTURE_VARCOUNT 4
115 #define TV_PICTURE_COLOR 0
118 #define TV_PICTURE_TINT 1
121 #define TV_PICTURE_CONTRAST 2
124 #define TV_PICTURE_BRIGHTNESS 3
127 #define TV_MAX_VAL_LEN 5
130 #define TV_MAXACTIONS 12
133 #define TV_MAXVARS TV_PICTURE_VARCOUNT
135 #define IP_MODE_IPV4 1
136 #define IP_MODE_IPV6_LLA 2
137 #define IP_MODE_IPV6_ULA_GUA 3
155 const char **errorString);
274 unsigned int service,
293 const char **errorString);
304 const char **errorString);
317 const char **errorString);
328 const char **errorString);
339 const char **errorString);
352 const char **errorString);
363 const char **errorString);
374 const char **errorString);
389 const char **errorString);
400 const char **errorString);
411 const char **errorString);
424 const char **errorString);
435 const char **errorString);
446 const char **errorString);
459 const char **errorString);
470 const char **errorString);
481 const char **errorString);
494 const char **errorString);
505 const char **errorString);
516 const char **errorString);
531 const char *desc_doc_name,
534 const char *web_dir_path,
int TvDeviceStart(char *iface, unsigned short port, const char *desc_doc_name, const char *web_dir_path, int ip_mode, print_string pfun, int combo)
Initializes the UPnP Sdk, registers the device, and sends out advertisements.
Definition: tv_device.c:1357
int TvDeviceIncreaseChannel(IXML_Document *in, IXML_Document **out, const char **errorString)
Increase the channel.
Definition: tv_device.c:716
int SetActionTable(int serviceType, struct TvService *out)
Initializes the action table for the specified service.
Definition: tv_device.c:170
int TvDeviceHandleGetVarRequest(UpnpStateVarRequest *cgv_event)
Called during a get variable request callback.
Definition: tv_device.c:363
Definition: UpnpSubscriptionRequest.c:18
int TvDevicePowerOff(IXML_Document *in, IXML_Document **out, const char **errorString)
Turn the power off.
Definition: tv_device.c:593
const char * VariableName[4]
Definition: tv_device.h:167
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...
Definition: tv_device.c:722
UpnpDevice_Handle device_handle
Definition: tv_device.c:77
int TvDevicePowerOn(IXML_Document *in, IXML_Document **out, const char **errorString)
Turn the power on.
Definition: tv_device.c:567
int TvDeviceDecreaseContrast(IXML_Document *in, IXML_Document **out, const char **errorString)
Decrease the contrast.
Definition: tv_device.c:1202
int TvDeviceHandleActionRequest(UpnpActionRequest *ca_event)
Called during an action request callback.
Definition: tv_device.c:419
int TvDeviceIncreaseVolume(IXML_Document *in, IXML_Document **out, const char **errorString)
Increase the volume.
Definition: tv_device.c:820
char UDN[NAME_SIZE]
Definition: tv_device.h:161
int TvDeviceIncreaseTint(IXML_Document *in, IXML_Document **out, const char **errorString)
Increase tint.
Definition: tv_device.c:1056
int TvDeviceStateTableInit(char *DescDocURL)
Initialize the device state table for this TvDevice, pulling identifier info from the description Doc...
Definition: tv_device.c:225
struct TvService tv_service_table[]
Definition: tv_device.c:74
int TvDeviceIncreaseContrast(IXML_Document *in, IXML_Document **out, const char **errorString)
Increase the contrast.
Definition: tv_device.c:1196
#define TV_MAXVARS
Definition: tv_device.h:133
Definition: UpnpActionRequest.c:18
char ServiceId[NAME_SIZE]
Definition: tv_device.h:163
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 contro...
Definition: tv_device.c:618
void(* print_string)(const char *string,...)
Prototype for displaying strings. All printing done by the device, control point, and sample util...
Definition: sample_util.h:162
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 con...
Definition: tv_device.c:1208
int device_main(int argc, char *argv[])
Main entry point for tv device application.
Definition: tv_device.c:1530
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 p...
Definition: tv_device.c:941
#define TV_MAXACTIONS
Definition: tv_device.h:130
int TvDeviceHandleSubscriptionRequest(const UpnpSubscriptionRequest *sr_event)
Called during a subscription request callback.
Definition: tv_device.c:307
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 functi...
Definition: tv_device.h:149
int TvDeviceDecreaseBrightness(IXML_Document *in, IXML_Document **out, const char **errorString)
Decrease brightnesss.
Definition: tv_device.c:1313
int UpnpDevice_Handle
Returned when a device application registers with UpnpRegisterRootDevice, UpnpRegisterRootDevice2, UpnpRegisterRootDevice3 or UpnpRegisterRootDevice4.
Definition: upnp.h:439
int TvDeviceDecreaseVolume(IXML_Document *in, IXML_Document **out, const char **errorString)
Decrease the volume.
Definition: tv_device.c:826
int TvDeviceIncreaseColor(IXML_Document *in, IXML_Document **out, const char **errorString)
Increase the color.
Definition: tv_device.c:935
const char * ActionNames[12]
Definition: tv_device.h:171
int TvDeviceDecreaseChannel(IXML_Document *in, IXML_Document **out, const char **errorString)
Decrease the channel.
Definition: tv_device.c:710
int TvDeviceDecreaseColor(IXML_Document *in, IXML_Document **out, const char **errorString)
Decrease the color.
Definition: tv_device.c:929
int TvDeviceCallbackEventHandler(Upnp_EventType, const void *Event, void *Cookie)
The callback handler registered with the SDK while registering root device.
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 contr...
Definition: tv_device.c:1096
void * TvDeviceCommandLoop(void *args)
Function that receives commands from the user at the command prompt during the lifetime of the device...
Definition: tv_device.c:1495
Definition: tv_device.h:158
int TvDeviceSetServiceTableVar(unsigned int service, int variable, char *value)
Update the TvDevice service state table, and notify all subscribed control points of the updated stat...
Definition: tv_device.c:506
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 ...
Definition: tv_device.c:832
Data structure representing the DOM Document.
Definition: ixml.h:159
int TvDeviceIncreaseBrightness(IXML_Document *in, IXML_Document **out, const char **errorString)
Increase brightnesss.
Definition: tv_device.c:1307
upnp_action actions[12]
Definition: tv_device.h:173
Definition: UpnpStateVarRequest.c:18
int VariableCount
Definition: tv_device.h:175
char * VariableStrVal[4]
Definition: tv_device.h:169
int TvDeviceStop(void)
Stops the device. Uninitializes the sdk.
Definition: tv_device.c:1485
char ServiceType[NAME_SIZE]
Definition: tv_device.h:165
int TvDeviceDecreaseTint(IXML_Document *in, IXML_Document **out, const char **errorString)
Decrease tint.
Definition: tv_device.c:1075
ithread_mutex_t TVDevMutex
Definition: tv_device.c:83