cec: added GetDeviceMenuLanguage()/cec_get_device_menu_language()
[deb_libcec.git] / src / testclient / main.cpp
index b8482d7fd422f83593ba17ce8fbddff7ee3e008e..3117ee689d5564e20e30d71f06c361a948db5742 100644 (file)
@@ -221,6 +221,9 @@ void show_console_help(void)
   "ver {addr}                get the CEC version of the specified device." << endl <<
   "[ver 0]                   get the CEC version of the TV" << endl <<
   endl <<
+  "lang {addr                get the menu language of the specified device." << endl <<
+  "[lang 0]                  get the menu language of the TV" << endl <<
+  endl <<
   "[mon] {1|0}               enable or disable CEC bus monitoring." << endl <<
   "[log] {1 - 31}            change the log level. see cectypes.h for values." << endl <<
   "[ping]                    send a ping command to the CEC adapter." << endl <<
@@ -492,6 +495,24 @@ int main (int argc, char *argv[])
         {
           parser->StartBootloader();
         }
+        else if (command == "lang")
+        {
+          CStdString strDev;
+          if (GetWord(input, strDev))
+          {
+            int iDev = atoi(strDev);
+            if (iDev >= 0 && iDev < 15)
+            {
+              CStdString strLog;
+              cec_menu_language language;
+              if (parser->GetDeviceMenuLanguage((cec_logical_address) iDev, &language))
+                strLog.Format("menu language '%s'", language.language);
+              else
+                strLog = "failed!";
+              cout << strLog.c_str() << endl;
+            }
+          }
+        }
         else if (command == "ver")
         {
           CStdString strDev;