Skip to content

Commit 960a266

Browse files
committed
rtkrcv: add a 'mark' command to log a marker
1 parent 5d50e1a commit 960a266

1 file changed

Lines changed: 31 additions & 8 deletions

File tree

app/consapp/rtkrcv/rtkrcv.c

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ static const char *helptxt[]={
156156
"error : show error/warning messages",
157157
"option [opt] : show option(s)",
158158
"set opt [val] : set option",
159+
"mark [name] [comment] : log a marker",
159160
"load [file] : load options from file",
160161
"save [file] : save options to file",
161162
"log [file|off] : start/stop log to file",
@@ -1247,6 +1248,24 @@ static void cmd_set(char **args, int narg, vt_t *vt)
12471248
}
12481249
vt_printf(vt,"\n");
12491250
}
1251+
/* Mark command ------------------------------------------------------------*/
1252+
static void cmd_mark(char **args, int narg, vt_t *vt)
1253+
{
1254+
trace(3,"cmd_mark:\n");
1255+
1256+
char markername[128], markercomment[256];
1257+
markername[0] = '\0';
1258+
markercomment[0] = '\0';
1259+
1260+
if (narg > 1)
1261+
strncpy(markername, args[1], sizeof(markername) - 1);
1262+
if (narg > 2)
1263+
strncpy(markercomment, args[2], sizeof(markercomment) - 1);
1264+
1265+
rtksvrmark(&svr, markername, markercomment);
1266+
1267+
vt_printf(vt,"\n");
1268+
}
12501269
/* load command --------------------------------------------------------------*/
12511270
static void cmd_load(char **args, int narg, vt_t *vt)
12521271
{
@@ -1341,8 +1360,8 @@ static void *con_thread(void *arg)
13411360
{
13421361
const char *cmds[]={
13431362
"start","stop","restart","solution","status","satellite","observ",
1344-
"navidata","stream","ssr","error","option","set","load","save","log",
1345-
"help","?","exit","shutdown",""
1363+
"navidata","stream","ssr","error","option","set",
1364+
"mark","load","save","log","help","?","exit","shutdown",""
13461365
};
13471366
con_t *con=(con_t *)arg;
13481367
int i,j,narg;
@@ -1401,15 +1420,16 @@ static void *con_thread(void *arg)
14011420
case 10: cmd_error (args,narg,con->vt); break;
14021421
case 11: cmd_option (args,narg,con->vt); break;
14031422
case 12: cmd_set (args,narg,con->vt); break;
1404-
case 13: cmd_load (args,narg,con->vt); break;
1405-
case 14: cmd_save (args,narg,con->vt); break;
1406-
case 15: cmd_log (args,narg,con->vt); break;
1407-
case 16: cmd_help (args,narg,con->vt); break;
1423+
case 13: cmd_mark (args,narg,con->vt); break;
1424+
case 14: cmd_load (args,narg,con->vt); break;
1425+
case 15: cmd_save (args,narg,con->vt); break;
1426+
case 16: cmd_log (args,narg,con->vt); break;
14081427
case 17: cmd_help (args,narg,con->vt); break;
1409-
case 18: /* exit */
1428+
case 18: cmd_help (args,narg,con->vt); break;
1429+
case 19: /* exit */
14101430
if (con->vt->type) con->state=0;
14111431
break;
1412-
case 19: /* shutdown */
1432+
case 20: /* shutdown */
14131433
if (!strcmp(args[0],"shutdown")) {
14141434
vt_printf(con->vt,"rtk server shutdown ...\n");
14151435
sleepms(1000);
@@ -1634,6 +1654,9 @@ static void deamonise(void)
16341654
* prompt message is shown to input the value. The change of the
16351655
* processing option is not enabled before RTK server is restarted.
16361656
*
1657+
* mark [name] [comment]
1658+
* Log a marker.
1659+
*
16371660
* load [file]
16381661
* Load processing options from file. Without option, default file
16391662
* rtkrcv.conf is used. To enable the changes, restart RTK server.

0 commit comments

Comments
 (0)