From a424ebac32d153a4de9d176bd31e2da85c35c648 Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Fri, 14 Oct 2011 11:15:10 +0200 Subject: [PATCH] cec: added 'pa' command to cec-client, to change the physical address --- src/testclient/main.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/testclient/main.cpp b/src/testclient/main.cpp index 1d9f4a9..cd83f10 100644 --- a/src/testclient/main.cpp +++ b/src/testclient/main.cpp @@ -180,6 +180,9 @@ void show_console_help(void) "la {logical_address} change the logical address of the CEC adapter." << endl << "[la 4] logical address 4" << endl << endl << + "pa {physical_address} change the physical address of the CEC adapter." << endl << + "[pa 10 00] physical address 1.0.0.0" << endl << + endl << "[ping] send a ping command to the CEC adapter." << endl << "[bl] to let the adapter enter the bootloader, to upgrade" << endl << " the flash rom." << endl << @@ -325,6 +328,17 @@ int main (int argc, char *argv[]) parser->SetLogicalAddress((cec_logical_address) atoi(strvalue.c_str())); } } + else if (command == "pa") + { + string strB1, strB2; + uint8_t iB1, iB2; + if (GetWord(input, strB1) && HexStrToInt(strB1, iB1) && + GetWord(input, strB2) && HexStrToInt(strB2, iB2)) + { + uint16_t iPhysicalAddress = ((uint16_t)iB1 << 8) + iB2; + parser->SetPhysicalAddress(iPhysicalAddress); + } + } else if (command == "ping") { parser->PingAdapter(); -- 2.34.1