From: Lars Op den Kamp Date: Fri, 14 Oct 2011 09:15:10 +0000 (+0200) Subject: cec: added 'pa' command to cec-client, to change the physical address X-Git-Tag: upstream/2.2.0~1^2~230 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=a424ebac32d153a4de9d176bd31e2da85c35c648;p=deb_libcec.git cec: added 'pa' command to cec-client, to change the physical address --- 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();