Browse Source

Preparation for serial commands support.

Georgi Chorbadzhiyski 9 years ago
parent
commit
a331d546b5
4 changed files with 5 additions and 4 deletions
  1. 1
    1
      cmd.c
  2. 1
    1
      data.h
  3. 2
    2
      display.c
  4. 1
    0
      videohubctrl.c

+ 1
- 1
cmd.c View File

@@ -210,7 +210,7 @@ bool parse_command(struct videohub_data *d, char *cmd) {
210 210
 			if ((p = parse_text(line, "Video monitoring outputs: ")))
211 211
 				d->mon_outputs.num = strtoul(p, NULL, 10);
212 212
 			if ((p = parse_text(line, "Serial ports: ")))
213
-				d->device.num_serial_ports = strtoul(p, NULL, 10);
213
+				d->serial.num = strtoul(p, NULL, 10);
214 214
 			break;
215 215
 		case CMD_NAK:
216 216
 			ret = false;

+ 1
- 1
data.h View File

@@ -26,7 +26,6 @@ struct device_desc {
26 26
 	char			model_name[MAX_NAME_LEN];
27 27
 	char			unique_id[MAX_NAME_LEN];
28 28
 	unsigned int	num_video_processing_units;
29
-	unsigned int	num_serial_ports;
30 29
 };
31 30
 
32 31
 enum port_lock {
@@ -58,6 +57,7 @@ struct videohub_data {
58 57
 	struct port_set			inputs;
59 58
 	struct port_set			outputs;
60 59
 	struct port_set			mon_outputs;
60
+	struct port_set			serial;
61 61
 };
62 62
 
63 63
 extern int debug;

+ 2
- 2
display.c View File

@@ -45,8 +45,8 @@ void print_device_info(struct videohub_data *d) {
45 45
 	printf("  | %-26s | %-26s |\n", "Protocol", d->device.protocol_ver);
46 46
 	printf("  | %-26s | %-26u |\n", "Video inputs", d->inputs.num);
47 47
 	printf("  | %-26s | %-26u |\n", "Video outputs", d->outputs.num);
48
-	if (d->device.num_serial_ports)
49
-		printf("  | %-26s | %-26u |\n", "Serial ports", d->device.num_serial_ports);
48
+	if (d->serial.num)
49
+		printf("  | %-26s | %-26u |\n", "Serial ports", d->serial.num);
50 50
 	if (d->device.num_video_processing_units)
51 51
 		printf("  | %-26s | %-26u |\n", "Video processing units", d->device.num_video_processing_units);
52 52
 	if (d->mon_outputs.num)

+ 1
- 0
videohubctrl.c View File

@@ -305,6 +305,7 @@ int main(int argc, char **argv) {
305 305
 	check_number_of_ports(&data->inputs);
306 306
 	check_number_of_ports(&data->outputs);
307 307
 	check_number_of_ports(&data->mon_outputs);
308
+	check_number_of_ports(&data->serial);
308 309
 
309 310
 	if (num_parsed_cmds) {
310 311
 		unsigned int i;

Loading…
Cancel
Save