aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2016-07-22 13:12:29 +0200
committerHans Verkuil <hans.verkuil@cisco.com>2016-07-22 13:12:29 +0200
commit09959c8d4713d4e6217d53fd3ae1196f6d3a7778 (patch)
tree8822acf6478787553d14eeb5d6110fb1d557063d
parentb627fb2441468d9ffe39be8aebf2a394ad11ae9c (diff)
cec-ctl: add menu language and power status to the remote device info
Attempt to query the menu language and power status. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
-rw-r--r--utils/cec-ctl/cec-ctl.cpp40
1 files changed, 39 insertions, 1 deletions
diff --git a/utils/cec-ctl/cec-ctl.cpp b/utils/cec-ctl/cec-ctl.cpp
index 1fcf5e0d..90e4c2c0 100644
--- a/utils/cec-ctl/cec-ctl.cpp
+++ b/utils/cec-ctl/cec-ctl.cpp
@@ -811,6 +811,22 @@ static std::string caps2s(unsigned caps)
return s;
}
+static const char *power_status2s(__u8 power_status)
+{
+ switch (power_status) {
+ case CEC_OP_POWER_STATUS_ON:
+ return "On";
+ case CEC_OP_POWER_STATUS_STANDBY:
+ return "Standby";
+ case CEC_OP_POWER_STATUS_TO_ON:
+ return "In transition Standby to On";
+ case CEC_OP_POWER_STATUS_TO_STANDBY:
+ return "In transition On to Standby";
+ default:
+ return "Unknown";
+ }
+}
+
static const char *version2s(unsigned version)
{
switch (version) {
@@ -1107,6 +1123,28 @@ static int showTopologyDevice(struct node *node, unsigned i, unsigned la)
cec_ops_set_osd_name(&msg, osd_name);
printf("\t\tOSD Name : %s\n",
(!cec_msg_status_is_ok(&msg)) ? status2s(msg).c_str() : osd_name);
+
+ cec_msg_init(&msg, la, i);
+ cec_msg_get_menu_language(&msg, true);
+ doioctl(node, CEC_TRANSMIT, &msg);
+ if (cec_msg_status_is_ok(&msg)) {
+ char language[4];
+
+ cec_ops_set_menu_language(&msg, language);
+ language[3] = 0;
+ printf("\t\tMenu Language : %s\n", language);
+ }
+
+ cec_msg_init(&msg, la, i);
+ cec_msg_give_device_power_status(&msg, true);
+ doioctl(node, CEC_TRANSMIT, &msg);
+ if (cec_msg_status_is_ok(&msg)) {
+ __u8 pwr;
+
+ cec_ops_report_power_status(&msg, &pwr);
+ printf("\t\tPower Status : %s\n",
+ power_status2s(pwr));
+ }
return 0;
}
@@ -1533,7 +1571,7 @@ int main(int argc, char **argv)
if (!is_dev_feat) {
if (byte & 0x40) {
- printf("\t RC Source Profile :\n%s\n",
+ printf("\t RC Source Profile :\n%s",
rc_src_prof2s(byte).c_str());
} else {
const char *s = "Reserved";

Privacy Policy