X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=ao-tools%2Fao-view%2Faoview_monitor.c;fp=ao-tools%2Fao-view%2Faoview_monitor.c;h=48e203209f51db2ec4c79e57bfe98fc2f48b309b;hp=8564014b31c7a9f7e4703891d526aab721f7450d;hb=e29961fdb2a48874c895829880eadbf13e094c0c;hpb=a3771bfc5ce740f9d89193e9f8b1d7987aa57264 diff --git a/ao-tools/ao-view/aoview_monitor.c b/ao-tools/ao-view/aoview_monitor.c index 8564014b..48e20320 100644 --- a/ao-tools/ao-view/aoview_monitor.c +++ b/ao-tools/ao-view/aoview_monitor.c @@ -82,6 +82,7 @@ aoview_monitor_parse(const char *input_line) char line_buf[8192], *line; struct aodata data; int tracking_pos; + int channel; /* avoid smashing our input parameter */ strncpy (line_buf, input_line, sizeof (line_buf)-1); @@ -214,15 +215,26 @@ aoview_monitor_callback(gpointer user_data, } } +void +aoview_monitor_set_channel(int channel) +{ + if (monitor_serial) + aoview_serial_printf(monitor_serial, "c r %d\n", channel); +} + gboolean aoview_monitor_connect(char *tty) { + int channel; aoview_monitor_disconnect(); monitor_serial = aoview_serial_open(tty); if (!monitor_serial) return FALSE; aoview_table_clear(); aoview_state_reset(); + channel = aoview_channel_current(); + if (channel >= 0) + aoview_monitor_set_channel(channel); aoview_serial_set_callback(monitor_serial, aoview_monitor_callback); return TRUE;