diff options
author | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2021-05-06 11:52:01 +0200 |
---|---|---|
committer | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2021-05-06 11:52:01 +0200 |
commit | 2735ec27e99879d3fdc57c79cb8b27c4a85730f9 (patch) | |
tree | f46782bde7bc7c0da6ff54f7f5f3b8e6389d1e09 | |
parent | e949a98f6bb1b0a62d794c1e08e5201c6c9bc849 (diff) | |
download | v4l-utils-2735ec27e99879d3fdc57c79cb8b27c4a85730f9.tar.gz |
utils/cec: fix inconsistent Vendor ID reporting
Either report it as '0x010203 (Name)' or '0x010203, 66051',
depending on whether the Vendor ID is a vendor that is known
by libcecutil.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r-- | utils/cec-compliance/cec-compliance.cpp | 11 | ||||
-rw-r--r-- | utils/cec-ctl/cec-ctl.cpp | 2 | ||||
-rw-r--r-- | utils/libcecutil/cec-info.cpp | 2 | ||||
-rw-r--r-- | utils/libcecutil/cec-log.cpp | 2 |
4 files changed, 8 insertions, 9 deletions
diff --git a/utils/cec-compliance/cec-compliance.cpp b/utils/cec-compliance/cec-compliance.cpp index 9a9d03fe..b292e541 100644 --- a/utils/cec-compliance/cec-compliance.cpp +++ b/utils/cec-compliance/cec-compliance.cpp @@ -1051,16 +1051,15 @@ static void topology_probe_device(struct node *node, unsigned i, unsigned la) printf("%s\n", cec_status2s(msg).c_str()); node->remote[i].vendor_id = CEC_VENDOR_ID_NONE; } else { - node->remote[i].vendor_id = (msg.msg[2] << 16) | - (msg.msg[3] << 8) | msg.msg[4]; + __u32 vendor_id = (msg.msg[2] << 16) | (msg.msg[3] << 8) | msg.msg[4]; + node->remote[i].vendor_id = vendor_id; - const char *vendor = cec_vendor2s(node->remote[i].vendor_id); + const char *vendor = cec_vendor2s(vendor_id); if (vendor) - printf("0x%06x (%s)\n", - node->remote[i].vendor_id, vendor); + printf("0x%06x (%s)\n", node->remote[i].vendor_id, vendor); else - printf("0x%06x\n", node->remote[i].vendor_id); + printf("0x%06x, %u\n", vendor_id, vendor_id); } cec_msg_init(&msg, la, i); diff --git a/utils/cec-ctl/cec-ctl.cpp b/utils/cec-ctl/cec-ctl.cpp index c17265a5..b1db4aac 100644 --- a/utils/cec-ctl/cec-ctl.cpp +++ b/utils/cec-ctl/cec-ctl.cpp @@ -568,7 +568,7 @@ static int showTopologyDevice(struct node *node, unsigned i, unsigned la) const char *vendor = cec_vendor2s(vendor_id); if (vendor) - printf("0x%06x, %s\n", vendor_id, vendor); + printf("0x%06x (%s)\n", vendor_id, vendor); else printf("0x%06x, %u\n", vendor_id, vendor_id); } diff --git a/utils/libcecutil/cec-info.cpp b/utils/libcecutil/cec-info.cpp index 0172e853..8b3c55e8 100644 --- a/utils/libcecutil/cec-info.cpp +++ b/utils/libcecutil/cec-info.cpp @@ -429,7 +429,7 @@ void cec_driver_info(const struct cec_caps &caps, const char *vendor = cec_vendor2s(laddrs.vendor_id); if (vendor) - printf("\tVendor ID : 0x%06x, %s\n", + printf("\tVendor ID : 0x%06x (%s)\n", laddrs.vendor_id, vendor); else printf("\tVendor ID : 0x%06x, %u\n", diff --git a/utils/libcecutil/cec-log.cpp b/utils/libcecutil/cec-log.cpp index 3f263860..0ee63de6 100644 --- a/utils/libcecutil/cec-log.cpp +++ b/utils/libcecutil/cec-log.cpp @@ -232,7 +232,7 @@ static void log_vendor_id(const char *arg_name, __u32 vendor_id) const char *vendor = cec_vendor2s(vendor_id); if (vendor) - printf("\t%s: 0x%06x, %s\n", arg_name, vendor_id, vendor); + printf("\t%s: 0x%06x (%s)\n", arg_name, vendor_id, vendor); else printf("\t%s: 0x%06x, %u\n", arg_name, vendor_id, vendor_id); } |