This makes ao-view disable the radio so that the channel change has an
immediate effect rather than waiting for a packet on the old channel.
Note that this should also be fixed in the TM code itself so that this
change wouldn't be required.
Signed-off-by: Keith Packard <keithp@keithp.com>
void
aoview_monitor_set_channel(int channel)
{
void
aoview_monitor_set_channel(int channel)
{
+ if (monitor_serial) {
+ aoview_serial_printf(monitor_serial, "m 0\n");
aoview_serial_printf(monitor_serial, "c r %d\n", channel);
aoview_serial_printf(monitor_serial, "c r %d\n", channel);
+ aoview_serial_printf(monitor_serial, "m 1\n");
+ }
aoview_table_clear();
aoview_state_reset();
channel = aoview_channel_current();
aoview_table_clear();
aoview_state_reset();
channel = aoview_channel_current();
- if (channel >= 0)
- aoview_monitor_set_channel(channel);
- aoview_serial_printf(monitor_serial, "m 1\n");
+ aoview_monitor_set_channel(channel);
aoview_serial_set_callback(monitor_serial,
aoview_monitor_callback);
return TRUE;
aoview_serial_set_callback(monitor_serial,
aoview_monitor_callback);
return TRUE;