M hlog/contest.c +1 -1
@@ 388,7 388,7 @@ int main(int argc, char **argv)
* 1. ncurses ui
* 2. wsjtx udp listener
*/
- ret = wsjtx_start(lua);
+ ret = wsjtx_start(lua, &contest_params);
if (ret)
goto err_script;
M hlog/contest/wsjtx.c +10 -1
@@ 34,6 34,7 @@
#include "wsjtx.h"
static struct udpsvc *svc;
+static const struct contest_params *contest_params;
#define WSJTX_HOST NULL
#define WSJTX_PORT 2237
@@ 233,6 234,12 @@ static int log_qso(struct xlua_state *lu
if (IS_ERR(qso))
return PTR_ERR(qso);
+ qso_copy(qso, contest_params->template);
+
+ /* generate a new uuid - it's ugly that we have to reach in like this */
+ xuuid_generate(&qso->uuid);
+ xuuid_unparse(&qso->uuid, qso->uuid_str);
+
/* QSO */
qso->start = msg->t5.timeon;
qso->end = msg->t5.timeoff;
@@ 410,10 417,12 @@ static void wsjtx_process(const union xs
}
}
-int wsjtx_start(struct xlua_state *lua)
+int wsjtx_start(struct xlua_state *lua, const struct contest_params *params)
{
struct udpsvc *svc;
+ contest_params = params;
+
svc = udpsvc(WSJTX_HOST, WSJTX_PORT, false, "wsjtx", wsjtx_process,
lua);
if (IS_ERR(svc)) {
M hlog/contest/wsjtx.h +2 -1
@@ 25,7 25,8 @@
#include <hlog-lua/xlua.h>
-extern int wsjtx_start(struct xlua_state *lua);
+extern int wsjtx_start(struct xlua_state *lua,
+ const struct contest_params *parms);
extern void wsjtx_stop(void);
#endif