summaryrefslogtreecommitdiff
path: root/ao-tools/ao-view/aoview_monitor.c
diff options
context:
space:
mode:
authorBdale Garbee <bdale@gag.com>2009-10-10 15:05:50 -0600
committerBdale Garbee <bdale@gag.com>2009-10-10 15:05:50 -0600
commit541da6f3bbf81be93dfe3c01f7c8cfd757b28a2b (patch)
treebd784c8aca6edc22db2cd89a38afc88182cd2256 /ao-tools/ao-view/aoview_monitor.c
parentdfc73cba1bee8b121e00e8cba45e7dfaaf79e9d8 (diff)
parent5f26ad663b3f60dddc9d967206e365f45dc4acd1 (diff)
Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
Diffstat (limited to 'ao-tools/ao-view/aoview_monitor.c')
-rw-r--r--ao-tools/ao-view/aoview_monitor.c12
1 files changed, 12 insertions, 0 deletions
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;