Commit c26838e3 authored by Matteo Quintiliani's avatar Matteo Quintiliani
Browse files

Merge branch 'release/2.1.7'

parents 5e4c2ffb e4070b3a
......@@ -2,6 +2,14 @@
nmxptool Release History
#########################
* Release 2.1.7-dev (2021/02/04)
- New nmxptool option:
-I, --slink_network_id When sending data to SeedLink as a plug-in.
Use unambiguous station ID (net.station).
Following the change in SeisComp, add possibility to define the station ID also declaring the network code.
See release/jakarta/2020.330. Use unambiguous station ID (net.station)
https://github.com/SeisComP3/seiscomp3/commit/04f52aed7f589ac872f4be34b0d7f0c247c2a79b
* Release 2.1.6 (2021/01/26)
- Add make rules to install nmxptool binary and templates in Seiscomp2 and Seiscomp3.
......
......@@ -9,7 +9,7 @@ m4_define([full_package_name], [nmxptool])
dnl These three define the plug-in version number
m4_define([major_version], [2])
m4_define([minor_version], [1])
m4_define([micro_version], [6])
m4_define([micro_version], [7])
# Comment build_version for stable release
# m4_define([build_version], [dev])
......
* template: $template
plugin $seedlink.source.id cmd="$seedlink.plugin_dir/nmxptool -H $sources.nmxp.address -P $sources.nmxp.port -N IV -F $pkgroot/nmxptool_channelfile_$sources.nmxp.address\.$sources.nmxp.port\.txt -v 16 -k"
plugin $seedlink.source.id cmd="$seedlink.plugin_dir/nmxptool -H $sources.nmxp.address -P $sources.nmxp.port -N IV -F $pkgroot/nmxptool_channelfile_$sources.nmxp.address\.$sources.nmxp.port\.txt -v 16 --slink_network_id -k"
timeout = 600
start_retry = 30
shutdown_wait = 15
......@@ -80,6 +80,11 @@ void *nmxptool_print_info_raw_stream(void *arg);
int nmxptool_print_seq_no(NMXP_DATA_PROCESS *pd);
void nmxptool_str_time_to_filename(char *str_time);
#ifdef HAVE_SEEDLINK
#define MAX_LEN_STATION_ID 64
int seedlink_station_id(NMXP_DATA_PROCESS *pd, NMXPTOOL_PARAMS *params, char *station_id, int size);
#endif
#ifdef HAVE_LIBMSEED
int nmxptool_write_miniseed(NMXP_DATA_PROCESS *pd);
int nmxptool_log_miniseed(const char *s);
......@@ -1532,6 +1537,18 @@ static void CloseConnectionHandler(int sig) {
#ifdef HAVE_SEEDLINK
int seedlink_station_id(NMXP_DATA_PROCESS *pd, NMXPTOOL_PARAMS *params, char *station_id, int size) {
int ret = 0;
if(params->flag_slink_network_id) {
ret = snprintf(station_id, size, "%s.%s", pd->network, pd->station);
} else {
ret = snprintf(station_id, size, "%s", pd->station);
}
return ret;
}
#endif
#ifdef HAVE_LIBMSEED
int nmxptool_write_miniseed(NMXP_DATA_PROCESS *pd) {
......@@ -1555,7 +1572,11 @@ int nmxptool_write_miniseed(NMXP_DATA_PROCESS *pd) {
void nmxptool_msr_send_mseed_handler (char *record, int reclen, void *handlerdata) {
int ret = 0;
NMXP_DATA_PROCESS *pd = handlerdata;
ret = send_mseed(pd->station, record, reclen);
char station_id[MAX_LEN_STATION_ID];
seedlink_station_id(pd, &params, station_id, MAX_LEN_STATION_ID);
ret = send_mseed(station_id, record, reclen);
if ( ret <= 0 ) {
nmxp_log(NMXP_LOG_ERR, NMXP_LOG_D_PACKETMAN,
"send_mseed() for %s.%s.%s\n", pd->network, pd->station, pd->channel);
......@@ -1648,8 +1669,11 @@ int nmxptool_print_seq_no(NMXP_DATA_PROCESS *pd) {
int nmxptool_send_raw_depoch(NMXP_DATA_PROCESS *pd) {
/* TODO Set values */
const int usec_correction = 0;
char station_id[MAX_LEN_STATION_ID];
seedlink_station_id(pd, &params, station_id, MAX_LEN_STATION_ID);
return send_raw_depoch(pd->station, pd->channel, pd->time, usec_correction, pd->timing_quality,
return send_raw_depoch(station_id, pd->channel, pd->time, usec_correction, pd->timing_quality,
pd->pDataPtr, pd->nSamp);
}
#endif
......
......@@ -67,6 +67,7 @@ const NMXPTOOL_PARAMS NMXPTOOL_PARAMS_DEFAULT =
0,
0,
0,
0,
0
};
......@@ -385,6 +386,10 @@ SeedLink arguments:\n");
Not usable together with -k.\n");
#endif
nmxp_log(NMXP_LOG_NORM_NO, NMXP_LOG_D_ANY, "\
-I, --slink_network_id When sending data to SeedLink as a plug-in.\n\
Use unambiguous station ID (net.station).\n");
nmxp_log(NMXP_LOG_NORM_NO, NMXP_LOG_D_ANY, "\
-Q, --timing_quality=TQ This value is used for the functions send_raw*().\n\
TQ is %d or in [%d..%d] (default %d).\n",
......@@ -709,6 +714,9 @@ int nmxptool_getopt_long(int argc, char **argv, NMXPTOOL_PARAMS *params)
{"slinkms", required_argument, NULL, 'K'},
#endif
#endif
#ifdef HAVE_SEEDLINK
{"slink_network_id", no_argument, NULL, 'I'},
#endif
#ifdef HAVE_SEEDLINK
{"timing_quality", required_argument, NULL, 'Q'},
#endif
......@@ -972,6 +980,12 @@ int nmxptool_getopt_long(int argc, char **argv, NMXPTOOL_PARAMS *params)
#endif
#endif
#ifdef HAVE_SEEDLINK
case 'I':
params->flag_slink_network_id = 1;
break;
#endif
#ifdef HAVE_SEEDLINK
case 'Q':
if(nmxptool_parse_int(optarg, &(params->timing_quality)) == 0) {
......@@ -1263,6 +1277,7 @@ void nmxptool_log_params(NMXPTOOL_PARAMS *params) {
int flag_writefile: %d\n\
int flag_slink: %d\n\
int flag_slinkms: %d\n\
int flag_slink_network_id: %d\n\
int flag_buffered: %d\n\
int flag_logdata: %d\n\
int flag_logsample: %d\n\
......@@ -1276,6 +1291,7 @@ void nmxptool_log_params(NMXPTOOL_PARAMS *params) {
params->flag_writefile,
params->flag_slink,
params->flag_slinkms,
params->flag_slink_network_id,
params->flag_buffered,
params->flag_logdata,
params->flag_logsample
......@@ -1413,6 +1429,18 @@ int nmxptool_check_params(NMXPTOOL_PARAMS *params) {
nmxp_log(NMXP_LOG_WARN, NMXP_LOG_D_ANY, "<timeoutrecv> ignored since not defined --stc=-1.\n");
}
#ifdef HAVE_SEEDLINK
if( params->flag_slink_network_id == 1
&& (
params->flag_slink == 0
&& params->flag_slinkms == 0
)
) {
ret = -1;
nmxp_log(NMXP_LOG_NORM_NO, NMXP_LOG_D_ANY, "<slink_network_id> is used only by -k or -K options.\n");
}
#endif
#ifdef HAVE_SEEDLINK
if( params->timing_quality != DEFAULT_TIMING_QUALITY &&
( params->timing_quality < DEFAULT_TIMING_QUALITY_MINIMUM || params->timing_quality > DEFAULT_TIMING_QUALITY_MAXIMUM) ) {
......
......@@ -149,6 +149,7 @@ typedef struct {
int flag_writefile;
int flag_slink;
int flag_slinkms;
int flag_slink_network_id;
int flag_buffered;
int flag_logdata;
int flag_logsample;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment