repositories
/
deb_libcec.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
0e19714
)
cec: added physical address option to testclient. credits @joshua-nord. closes #3
author
Lars Op den Kamp
<lars@opdenkamp.eu>
Tue, 15 Nov 2011 23:01:45 +0000
(
00:01
+0100)
committer
Lars Op den Kamp
<lars@opdenkamp.eu>
Tue, 15 Nov 2011 23:03:32 +0000
(
00:03
+0100)
src/testclient/main.cpp
patch
|
blob
|
blame
|
history
diff --git
a/src/testclient/main.cpp
b/src/testclient/main.cpp
index 2e35dce4e5e32491a4a20d7191c79b0fb48aa68b..b06ef1dffc886f9194eef2fe3047e2aa4aa35b46 100644
(file)
--- a/
src/testclient/main.cpp
+++ b/
src/testclient/main.cpp
@@
-180,6
+180,7
@@
void ShowHelpCommandLine(const char* strExec)
" -h --help Shows this help text" << endl <<
" -l --list-devices List all devices on this system" << endl <<
" -t --type {p|r|t|a} The device type to use. More than one is possible." << endl <<
" -h --help Shows this help text" << endl <<
" -l --list-devices List all devices on this system" << endl <<
" -t --type {p|r|t|a} The device type to use. More than one is possible." << endl <<
+ " -p --physical {hex-address} The physical address to use for the primary logical device." << endl <<
" -f --log-file {file} Writes all libCEC log message to a file" << endl <<
" -sf --short-log-file {file} Writes all libCEC log message without timestamps" << endl <<
" and log levels to a file." << endl <<
" -f --log-file {file} Writes all libCEC log message to a file" << endl <<
" -sf --short-log-file {file} Writes all libCEC log message without timestamps" << endl <<
" and log levels to a file." << endl <<
@@
-268,6
+269,7
@@
void ShowHelpConsole(void)
int main (int argc, char *argv[])
{
int main (int argc, char *argv[])
{
+ int iPhysicalAddress = -1;
cec_device_type_list typeList;
typeList.Clear();
cec_device_type_list typeList;
typeList.Clear();
@@
-378,6
+380,19
@@
int main (int argc, char *argv[])
ShowHelpCommandLine(argv[0]);
return 0;
}
ShowHelpCommandLine(argv[0]);
return 0;
}
+ else if (!strcmp(argv[iArgPtr], "-p") ||
+ !strcmp(argv[iArgPtr], "--physical"))
+ {
+ if (argc >= iArgPtr + 2)
+ {
+ if (sscanf(argv[iArgPtr + 1], "%x", &iPhysicalAddress))
+ cout << "using physical address '" << std::hex << iPhysicalAddress << "'" << endl;
+ else
+ cout << "== skipped physical address parameter: invalid physical address '" << argv[iArgPtr + 1] << "' ==" << endl;
+ ++iArgPtr;
+ }
+ ++iArgPtr;
+ }
else
{
g_strPort = argv[iArgPtr++];
else
{
g_strPort = argv[iArgPtr++];
@@
-454,6
+469,12
@@
int main (int argc, char *argv[])
{
cout << "cec device opened" << endl;
{
cout << "cec device opened" << endl;
+ if (-1 != iPhysicalAddress)
+ {
+ parser->SetPhysicalAddress(iPhysicalAddress);
+ FlushLog(parser);
+ }
+
parser->PowerOnDevices(CECDEVICE_TV);
FlushLog(parser);
parser->PowerOnDevices(CECDEVICE_TV);
FlushLog(parser);