cec: added GetDeviceVendorId()/cec_get_device_vendor_id()
[deb_libcec.git] / src / testclient / main.cpp
index 9952a8c77e514c59cbc27d017ef61ee458017045..38f6b5bd8eaaba8832890680da9e27d7325a827f 100644 (file)
@@ -221,7 +221,10 @@ 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 <<
+  "ven {addr}                get the vendor ID of the specified device." << endl <<
+  "[ven 0]                   get the vendor ID 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 <<
@@ -517,6 +520,21 @@ int main (int argc, char *argv[])
             }
           }
         }
+        else if (command == "ven")
+        {
+          CStdString strDev;
+          if (GetWord(input, strDev))
+          {
+            int iDev = atoi(strDev);
+            if (iDev >= 0 && iDev < 15)
+            {
+              uint64_t iVendor = parser->GetDeviceVendorId((cec_logical_address) iDev);
+              CStdString strLog;
+              strLog.Format("vendor id: %06x", iVendor);
+              cout << strLog.c_str() << endl;
+            }
+          }
+        }
         else if (command == "ver")
         {
           CStdString strDev;