Browse Source

In test mode print device info after commands are executed.

Georgi Chorbadzhiyski 9 years ago
parent
commit
a4275361ae
1 changed files with 11 additions and 4 deletions
  1. 11
    4
      videohubctrl.c

+ 11
- 4
videohubctrl.c View File

@@ -227,6 +227,13 @@ static void check_number_of_ports(struct port_set *p) {
227 227
 			p->num, ARRAY_SIZE(p->port));
228 228
 }
229 229
 
230
+static void print_device_full(struct videohub_data *d) {
231
+	print_device_info(d);
232
+	print_device_video_inputs(d);
233
+	print_device_video_outputs(d);
234
+	fflush(stdout);
235
+}
236
+
230 237
 static int read_device_command_stream(struct videohub_data *d) {
231 238
 	int ret, ncommands = 0;
232 239
 	char buf[8192 + 1];
@@ -302,6 +309,9 @@ int main(int argc, char **argv) {
302 309
 				read_device_command_stream(data);
303 310
 			}
304 311
 		}
312
+		// Show the result after commands
313
+		if (test_data)
314
+			print_device_full(data);
305 315
 	} else if (show_monitor) {
306 316
 		while (1) {
307 317
 			int sleeps = 0;
@@ -327,10 +337,7 @@ int main(int argc, char **argv) {
327 337
 	} else if (show_backup) {
328 338
 		print_device_backup(data);
329 339
 	} else if (show_info) {
330
-		print_device_info(data);
331
-		print_device_video_inputs(data);
332
-		print_device_video_outputs(data);
333
-		fflush(stdout);
340
+		print_device_full(data);
334 341
 	}
335 342
 
336 343
 	shutdown_fd(&data->dev_fd);

Loading…
Cancel
Save