@@ 148,16 148,8 @@ static int start_listeners(uint32_t rig_
goto err_rig;
}
- ret = wsjtx_start();
- if (ret)
- goto err_loc;
-
return 0;
-err_loc:
- if (gpsd_port)
- location_stop();
-
err_rig:
rig_stop();
@@ 169,7 161,6 @@ err:
static void stop_listeners(const char *gpsd_port)
{
- wsjtx_stop();
if (gpsd_port)
location_stop();
rig_stop();
@@ 389,11 380,26 @@ int main(int argc, char **argv)
goto err_free;
}
- if (!export)
+ if (!export) {
+ /*
+ * Operating in a contest. Start all the "subsystems" that
+ * can log entries. Namely, start:
+ *
+ * 1. ncurses ui
+ * 2. wsjtx udp listener
+ */
+ ret = wsjtx_start();
+ if (ret)
+ goto err_script;
+
ret = contest_ui_run(lua, &contest_params, wfields, nwfields);
- else
+
+ wsjtx_stop();
+ } else {
ret = do_export(lua, &contest_params, export);
+ }
+err_script:
xlua_close(lua);
err_free: