|
@@ -259,13 +259,21 @@ int main(int argc, char **argv) {
|
259
|
259
|
//print_device_settings(data);
|
260
|
260
|
} else if (show_monitor) {
|
261
|
261
|
while (1) {
|
|
262
|
+ int sleeps = 0;
|
262
|
263
|
printf("\e[2J\e[H"); // Clear screen
|
|
264
|
+ time_t now = time(NULL);
|
|
265
|
+ struct tm *tm = localtime(&now);
|
|
266
|
+ printf("Last update: %s\n", asctime(tm));
|
263
|
267
|
print_device_info(data);
|
264
|
268
|
print_device_video_inputs(data);
|
265
|
269
|
print_device_video_outputs(data);
|
266
|
270
|
fflush(stdout);
|
267
|
271
|
do {
|
268
|
|
- sleep(1);
|
|
272
|
+ usleep(500000);
|
|
273
|
+ if (++sleeps >= 20) {
|
|
274
|
+ char *ping_cmd = "PING:\n\n";
|
|
275
|
+ fdwrite(data->dev_fd, ping_cmd, strlen(ping_cmd));
|
|
276
|
+ }
|
269
|
277
|
} while (read_device_command_stream(data) == 0);
|
270
|
278
|
}
|
271
|
279
|
} else if (show_list) {
|