samples: Put more data in common_data.h.
This commit is contained in:
parent
bd8d6cfc8b
commit
86159bc2a6
@ -1,19 +1,83 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2010 Marcelo Roberto Jimenez <mroberto@users.sourceforge.net>
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef COMMON_DATA
|
#ifndef COMMON_DATA
|
||||||
#define COMMON_DATA
|
#define COMMON_DATA
|
||||||
|
|
||||||
#ifdef ALLOC_COMMON_DATA
|
/*!
|
||||||
|
* \file
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef ALLOC_CMD_LINE
|
||||||
|
/*! Tags for valid commands issued at the command prompt. */
|
||||||
|
enum cmdloop_tvcmds {
|
||||||
|
PRTHELP = 0,
|
||||||
|
PRTFULLHELP,
|
||||||
|
POWON,
|
||||||
|
POWOFF,
|
||||||
|
SETCHAN,
|
||||||
|
SETVOL,
|
||||||
|
SETCOL,
|
||||||
|
SETTINT,
|
||||||
|
SETCONT,
|
||||||
|
SETBRT,
|
||||||
|
CTRLACTION,
|
||||||
|
PICTACTION,
|
||||||
|
CTRLGETVAR,
|
||||||
|
PICTGETVAR,
|
||||||
|
PRTDEV,
|
||||||
|
LSTDEV,
|
||||||
|
REFRESH,
|
||||||
|
EXITCMD
|
||||||
|
};
|
||||||
|
|
||||||
|
/*! Data structure for parsing commands from the command line. */
|
||||||
|
struct cmdloop_commands {
|
||||||
|
/* the string */
|
||||||
|
const char *str;
|
||||||
|
/* the command */
|
||||||
|
int cmdnum;
|
||||||
|
/* the number of arguments */
|
||||||
|
int numargs;
|
||||||
|
/* the args */
|
||||||
|
const char *args;
|
||||||
|
} cmdloop_commands;
|
||||||
|
|
||||||
|
/*! Mappings between command text names, command tag,
|
||||||
|
* and required command arguments for command line
|
||||||
|
* commands */
|
||||||
|
static struct cmdloop_commands cmdloop_cmdlist[] = {
|
||||||
|
{"Help", PRTHELP, 1, ""},
|
||||||
|
{"HelpFull", PRTFULLHELP, 1, ""},
|
||||||
|
{"ListDev", LSTDEV, 1, ""},
|
||||||
|
{"Refresh", REFRESH, 1, ""},
|
||||||
|
{"PrintDev", PRTDEV, 2, "<devnum>"},
|
||||||
|
{"PowerOn", POWON, 2, "<devnum>"},
|
||||||
|
{"PowerOff", POWOFF, 2, "<devnum>"},
|
||||||
|
{"SetChannel", SETCHAN, 3, "<devnum> <channel (int)>"},
|
||||||
|
{"SetVolume", SETVOL, 3, "<devnum> <volume (int)>"},
|
||||||
|
{"SetColor", SETCOL, 3, "<devnum> <color (int)>"},
|
||||||
|
{"SetTint", SETTINT, 3, "<devnum> <tint (int)>"},
|
||||||
|
{"SetContrast", SETCONT, 3, "<devnum> <contrast (int)>"},
|
||||||
|
{"SetBrightness", SETBRT, 3, "<devnum> <brightness (int)>"},
|
||||||
|
{"CtrlAction", CTRLACTION, 2, "<devnum> <action (string)>"},
|
||||||
|
{"PictAction", PICTACTION, 2, "<devnum> <action (string)>"},
|
||||||
|
{"CtrlGetVar", CTRLGETVAR, 2, "<devnum> <varname (string)>"},
|
||||||
|
{"PictGetVar", PICTGETVAR, 2, "<devnum> <varname (string)>"},
|
||||||
|
{"Exit", EXITCMD, 1, ""}
|
||||||
|
};
|
||||||
|
#else /* ALLOC_CMD_LINE */
|
||||||
|
#endif /* ALLOC_CMD_LINE */
|
||||||
|
|
||||||
|
#ifdef ALLOC_COMMON_DATA
|
||||||
/*! Service types for tv services. */
|
/*! Service types for tv services. */
|
||||||
const char *TvServiceType[] = {
|
const char *TvServiceType[] = {
|
||||||
"urn:schemas-upnp-org:service:tvcontrol:1",
|
"urn:schemas-upnp-org:service:tvcontrol:1",
|
||||||
"urn:schemas-upnp-org:service:tvpicture:1"
|
"urn:schemas-upnp-org:service:tvpicture:1"
|
||||||
};
|
};
|
||||||
|
|
||||||
#else /* ALLOC_COMMON_DATA */
|
#else /* ALLOC_COMMON_DATA */
|
||||||
|
|
||||||
extern const char *TvServiceType[];
|
extern const char *TvServiceType[];
|
||||||
|
|
||||||
#endif /* ALLOC_COMMON_DATA */
|
#endif /* ALLOC_COMMON_DATA */
|
||||||
|
|
||||||
#endif /* COMMON_DATA */
|
#endif /* COMMON_DATA */
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
*
|
*
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
|
#define ALLOC_CMD_LINE
|
||||||
#define ALLOC_COMMON_DATA
|
#define ALLOC_COMMON_DATA
|
||||||
#include "common_data.h"
|
#include "common_data.h"
|
||||||
#include "sample_util.h"
|
#include "sample_util.h"
|
||||||
@ -39,50 +40,6 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
/*! Tags for valid commands issued at the command prompt. */
|
|
||||||
enum cmdloop_tvcmds {
|
|
||||||
PRTHELP = 0, PRTFULLHELP, POWON, POWOFF,
|
|
||||||
SETCHAN, SETVOL, SETCOL, SETTINT, SETCONT, SETBRT,
|
|
||||||
CTRLACTION, PICTACTION, CTRLGETVAR, PICTGETVAR,
|
|
||||||
PRTDEV, LSTDEV, REFRESH, EXITCMD
|
|
||||||
};
|
|
||||||
|
|
||||||
/*! Data structure for parsing commands from the command line. */
|
|
||||||
struct cmdloop_commands {
|
|
||||||
/* the string */
|
|
||||||
const char *str;
|
|
||||||
/* the command */
|
|
||||||
int cmdnum;
|
|
||||||
/* the number of arguments */
|
|
||||||
int numargs;
|
|
||||||
/* the args */
|
|
||||||
const char *args;
|
|
||||||
} cmdloop_commands;
|
|
||||||
|
|
||||||
/*! Mappings between command text names, command tag,
|
|
||||||
* and required command arguments for command line
|
|
||||||
* commands */
|
|
||||||
static struct cmdloop_commands cmdloop_cmdlist[] = {
|
|
||||||
{"Help", PRTHELP, 1, ""},
|
|
||||||
{"HelpFull", PRTFULLHELP, 1, ""},
|
|
||||||
{"ListDev", LSTDEV, 1, ""},
|
|
||||||
{"Refresh", REFRESH, 1, ""},
|
|
||||||
{"PrintDev", PRTDEV, 2, "<devnum>"},
|
|
||||||
{"PowerOn", POWON, 2, "<devnum>"},
|
|
||||||
{"PowerOff", POWOFF, 2, "<devnum>"},
|
|
||||||
{"SetChannel", SETCHAN, 3, "<devnum> <channel (int)>"},
|
|
||||||
{"SetVolume", SETVOL, 3, "<devnum> <volume (int)>"},
|
|
||||||
{"SetColor", SETCOL, 3, "<devnum> <color (int)>"},
|
|
||||||
{"SetTint", SETTINT, 3, "<devnum> <tint (int)>"},
|
|
||||||
{"SetContrast", SETCONT, 3, "<devnum> <contrast (int)>"},
|
|
||||||
{"SetBrightness", SETBRT, 3, "<devnum> <brightness (int)>"},
|
|
||||||
{"CtrlAction", CTRLACTION, 2, "<devnum> <action (string)>"},
|
|
||||||
{"PictAction", PICTACTION, 2, "<devnum> <action (string)>"},
|
|
||||||
{"CtrlGetVar", CTRLGETVAR, 2, "<devnum> <varname (string)>"},
|
|
||||||
{"PictGetVar", PICTGETVAR, 2, "<devnum> <varname (string)>"},
|
|
||||||
{"Exit", EXITCMD, 1, ""}
|
|
||||||
};
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Prints a string to standard out.
|
* \brief Prints a string to standard out.
|
||||||
*/
|
*/
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
*
|
*
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
|
#define ALLOC_CMD_LINE
|
||||||
#define ALLOC_COMMON_DATA
|
#define ALLOC_COMMON_DATA
|
||||||
#include "common_data.h"
|
#include "common_data.h"
|
||||||
#include "sample_util.h"
|
#include "sample_util.h"
|
||||||
@ -38,50 +39,6 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
/*! Tags for valid commands issued at the command prompt. */
|
|
||||||
enum cmdloop_tvcmds {
|
|
||||||
PRTHELP = 0, PRTFULLHELP, POWON, POWOFF,
|
|
||||||
SETCHAN, SETVOL, SETCOL, SETTINT, SETCONT, SETBRT,
|
|
||||||
CTRLACTION, PICTACTION, CTRLGETVAR, PICTGETVAR,
|
|
||||||
PRTDEV, LSTDEV, REFRESH, EXITCMD
|
|
||||||
};
|
|
||||||
|
|
||||||
/*! Data structure for parsing commands from the command line. */
|
|
||||||
struct cmdloop_commands {
|
|
||||||
/* the string */
|
|
||||||
const char *str;
|
|
||||||
/* the command */
|
|
||||||
int cmdnum;
|
|
||||||
/* the number of arguments */
|
|
||||||
int numargs;
|
|
||||||
/* the args */
|
|
||||||
const char *args;
|
|
||||||
} cmdloop_commands;
|
|
||||||
|
|
||||||
/*! Mappings between command text names, command tag,
|
|
||||||
* and required command arguments for command line
|
|
||||||
* commands */
|
|
||||||
static struct cmdloop_commands cmdloop_cmdlist[] = {
|
|
||||||
{"Help", PRTHELP, 1, ""},
|
|
||||||
{"HelpFull", PRTFULLHELP, 1, ""},
|
|
||||||
{"ListDev", LSTDEV, 1, ""},
|
|
||||||
{"Refresh", REFRESH, 1, ""},
|
|
||||||
{"PrintDev", PRTDEV, 2, "<devnum>"},
|
|
||||||
{"PowerOn", POWON, 2, "<devnum>"},
|
|
||||||
{"PowerOff", POWOFF, 2, "<devnum>"},
|
|
||||||
{"SetChannel", SETCHAN, 3, "<devnum> <channel (int)>"},
|
|
||||||
{"SetVolume", SETVOL, 3, "<devnum> <volume (int)>"},
|
|
||||||
{"SetColor", SETCOL, 3, "<devnum> <color (int)>"},
|
|
||||||
{"SetTint", SETTINT, 3, "<devnum> <tint (int)>"},
|
|
||||||
{"SetContrast", SETCONT, 3, "<devnum> <contrast (int)>"},
|
|
||||||
{"SetBrightness", SETBRT, 3, "<devnum> <brightness (int)>"},
|
|
||||||
{"CtrlAction", CTRLACTION, 2, "<devnum> <action (string)>"},
|
|
||||||
{"PictAction", PICTACTION, 2, "<devnum> <action (string)>"},
|
|
||||||
{"CtrlGetVar", CTRLGETVAR, 2, "<devnum> <varname (string)>"},
|
|
||||||
{"PictGetVar", PICTGETVAR, 2, "<devnum> <varname (string)>"},
|
|
||||||
{"Exit", EXITCMD, 1, ""}
|
|
||||||
};
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Prints a string to standard out.
|
* \brief Prints a string to standard out.
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user