Browse Source

Display the undocumented "Friendly name" device setting.

Georgi Chorbadzhiyski 9 years ago
parent
commit
c87a7538b9
5 changed files with 7 additions and 2 deletions
  1. 1
    0
      ChangeLog
  2. 2
    0
      cmd.c
  3. 1
    0
      data.h
  4. 2
    0
      display.c
  5. 1
    2
      test/test-17.ok

+ 1
- 0
ChangeLog View File

@@ -5,6 +5,7 @@ xxxx-xx-xx : Version 0.5-dev
5 5
     --se-name, --se-connect, --se-clear, --se-lock, --se-unlock,
6 6
     --se-dir and --list-serial.
7 7
  * Add support for undocumented "Thunderbolt" port status/type.
8
+ * Display the undocumented "Friendly name" device setting.
8 9
 
9 10
 2014-11-30 : Version 0.4
10 11
  * Add videohubctrl(1) man page.

+ 2
- 0
cmd.c View File

@@ -266,6 +266,8 @@ bool parse_command(struct videohub_data *d, char *cmd) {
266 266
 			}
267 267
 			else if ((p = parse_text(line, "Model name: ")))
268 268
 				snprintf(d->device.model_name, sizeof(d->device.model_name), "%s", p);
269
+			else if ((p = parse_text(line, "Friendly name: ")))
270
+				snprintf(d->device.friendly_name, sizeof(d->device.friendly_name), "%s", p);
269 271
 			else if ((p = parse_text(line, "Unique ID: ")))
270 272
 				snprintf(d->device.unique_id, sizeof(d->device.unique_id) , "%s", p);
271 273
 			else if ((p = parse_text(line, "Video inputs: ")))

+ 1
- 0
data.h View File

@@ -25,6 +25,7 @@ struct device_desc {
25 25
 	bool			needs_fw_update;
26 26
 	char			protocol_ver[16];
27 27
 	char			model_name[MAX_NAME_LEN];
28
+	char			friendly_name[MAX_NAME_LEN];
28 29
 	char			unique_id[MAX_NAME_LEN];
29 30
 	unsigned int	num_video_processing_units;
30 31
 };

+ 2
- 0
display.c View File

@@ -45,6 +45,8 @@ void print_device_info(struct videohub_data *d) {
45 45
 	printf("  | %-26s | %-34s |\n", "Device address", d->dev_host);
46 46
 	printf("  | %-26s | %-34s |\n", "Device port", d->dev_port);
47 47
 	printf("  | %-26s | %-34s |\n", "Model name", d->device.model_name);
48
+	if (d->device.friendly_name[0])
49
+		printf("  | %-26s | %-34s |\n", "Friendly name", d->device.friendly_name);
48 50
 	printf("  | %-26s | %-34s |\n", "Unique ID", d->device.unique_id);
49 51
 	printf("  | %-26s | %-34s |\n", "Protocol", d->device.protocol_ver);
50 52
 	printf("  | %-26s | %-34u |\n", "Video inputs", d->inputs.num);

+ 1
- 2
test/test-17.ok View File

@@ -1,5 +1,3 @@
1
-WARNING: VIDEOHUB DEVICE command sent unknown line: 'Friendly name: SDI router on the 5th floor'
2
-Please report this line to author's email: georgi@unixsol.org
3 1
 WARNING: VIDEOHUB DEVICE command sent unknown line: 'Debug mode: true'
4 2
 Please report this line to author's email: georgi@unixsol.org
5 3
 WARNING: VIDEOHUB DEVICE command sent unknown line: 'Debug mode: yes'
@@ -96,6 +94,7 @@ Device info
96 94
   | Device address             | sdi-matrix                         |
97 95
   | Device port                | 9990                               |
98 96
   | Model name                 | Blackmagic Workgroup Videohub      |
97
+  | Friendly name              | SDI router on the 5th floor        |
99 98
   | Unique ID                  | 465647757584                       |
100 99
   | Protocol                   | 2.4                                |
101 100
   | Video inputs               | 16                                 |

Loading…
Cancel
Save