117
117
#include "morse.h"
118
118
#include "mheard.h"
119
119
#include "ax25_link.h"
120
+ #include "dtime_now.h"
120
121
121
122
122
123
//static int idx_decoded = 0;
@@ -163,8 +164,8 @@ static void __cpuid(int cpuinfo[4], int infotype){
163
164
164
165
static struct audio_s audio_config ;
165
166
static struct tt_config_s tt_config ;
166
- // struct digi_config_s digi_config ;
167
- //struct cdigi_config_s cdigi_config;
167
+ static struct misc_config_s misc_config ;
168
+
168
169
169
170
static const int audio_amplitude = 100 ; /* % of audio sample range. */
170
171
/* This translates to +-32k for 16 bit samples. */
@@ -178,9 +179,6 @@ static int q_d_opt = 0; /* "-q d" Quiet, suppress the printing of decoded of A
178
179
179
180
180
181
181
- static struct misc_config_s misc_config ;
182
-
183
-
184
182
int main (int argc , char * argv [])
185
183
{
186
184
int err ;
@@ -197,7 +195,7 @@ int main (int argc, char *argv[])
197
195
char l_opt_logdir [80 ];
198
196
char L_opt_logfile [80 ];
199
197
char input_file [80 ];
200
- // char timestamp[16 ];
198
+ char T_opt_timestamp [ 40 ];
201
199
202
200
int t_opt = 1 ; /* Text color option. */
203
201
int a_opt = 0 ; /* "-a n" interval, in seconds, for audio statistics report. 0 for none. */
@@ -219,6 +217,7 @@ int main (int argc, char *argv[])
219
217
strlcpy (l_opt_logdir , "" , sizeof (l_opt_logdir ));
220
218
strlcpy (L_opt_logfile , "" , sizeof (L_opt_logfile ));
221
219
strlcpy (P_opt , "" , sizeof (P_opt ));
220
+ strlcpy (T_opt_timestamp , "" , sizeof (T_opt_timestamp ));
222
221
223
222
#if __WIN32__
224
223
@@ -263,26 +262,21 @@ int main (int argc, char *argv[])
263
262
264
263
text_color_init (t_opt );
265
264
text_color_set (DW_COLOR_INFO );
266
- // dw_printf ("Dire Wolf version %d.%d (%s) Beta Test\n", MAJOR_VERSION, MINOR_VERSION, __DATE__);
267
- dw_printf ("Dire Wolf DEVELOPMENT version %d.%d %s (%s)\n" , MAJOR_VERSION , MINOR_VERSION , "C" , __DATE__ );
265
+ dw_printf ("Dire Wolf version %d.%d (%s) Beta Test\n" , MAJOR_VERSION , MINOR_VERSION , __DATE__ );
266
+ // dw_printf ("Dire Wolf DEVELOPMENT version %d.%d %s (%s)\n", MAJOR_VERSION, MINOR_VERSION, "C", __DATE__);
268
267
//dw_printf ("Dire Wolf version %d.%d\n", MAJOR_VERSION, MINOR_VERSION);
269
268
270
- // FIXME: temp test
271
-
272
- // timestamp_now (timestamp, sizeof(timestamp), 1);
273
- // dw_printf ("%s\n", timestamp);
274
-
275
-
276
-
277
-
278
269
279
- #if defined(ENABLE_GPSD ) || defined(USE_HAMLIB )
270
+ #if defined(ENABLE_GPSD ) || defined(USE_HAMLIB ) || defined( USE_CM108 )
280
271
dw_printf ("Includes optional support for: " );
281
272
#if defined(ENABLE_GPSD )
282
273
dw_printf (" gpsd" );
283
274
#endif
284
275
#if defined(USE_HAMLIB )
285
276
dw_printf (" hamlib" );
277
+ #endif
278
+ #if defined(USE_CM108 )
279
+ dw_printf (" cm108-ptt" );
286
280
#endif
287
281
dw_printf ("\n" );
288
282
#endif
@@ -358,7 +352,7 @@ int main (int argc, char *argv[])
358
352
359
353
/* ':' following option character means arg is required. */
360
354
361
- c = getopt_long (argc , argv , "P:B:D:c:pxr:b:n:d:q:t:Ul:L:Sa:E:" ,
355
+ c = getopt_long (argc , argv , "P:B:D:c:pxr:b:n:d:q:t:Ul:L:Sa:E:T: " ,
362
356
long_options , & option_index );
363
357
if (c == -1 )
364
358
break ;
@@ -573,6 +567,10 @@ int main (int argc, char *argv[])
573
567
}
574
568
break ;
575
569
570
+ case 'T' : /* -T for receive timestamp. */
571
+ strlcpy (T_opt_timestamp , optarg , sizeof (T_opt_timestamp ));
572
+ break ;
573
+
576
574
default :
577
575
578
576
/* Should not be here. */
@@ -676,6 +674,8 @@ int main (int argc, char *argv[])
676
674
audio_config .achan [0 ].decimate = D_opt ;
677
675
}
678
676
677
+ strlcpy (audio_config .timestamp_format , T_opt_timestamp , sizeof (audio_config .timestamp_format ));
678
+
679
679
// temp - only xmit errors.
680
680
681
681
audio_config .xmit_error_rate = E_tx_opt ;
@@ -965,9 +965,21 @@ void app_process_rec_packet (int chan, int subchan, int slice, packet_t pp, alev
965
965
966
966
// -1 for APRStt DTMF decoder.
967
967
968
+ char ts [100 ]; // optional time stamp
969
+
970
+ if (strlen (audio_config .timestamp_format ) > 0 ) {
971
+ char tstmp [100 ];
972
+ timestamp_user_format (tstmp , sizeof (tstmp ), audio_config .timestamp_format );
973
+ strlcpy (ts , " " , sizeof (ts )); // space after channel.
974
+ strlcat (ts , tstmp , sizeof (ts ));
975
+ }
976
+ else {
977
+ strlcpy (ts , "" , sizeof (ts ));
978
+ }
979
+
968
980
if (subchan == -1 ) {
969
981
text_color_set (DW_COLOR_REC );
970
- dw_printf ("[%d.dtmf] " , chan );
982
+ dw_printf ("[%d.dtmf%s ] " , chan , ts );
971
983
}
972
984
else {
973
985
if (ax25_is_aprs (pp )) {
@@ -978,16 +990,16 @@ void app_process_rec_packet (int chan, int subchan, int slice, packet_t pp, alev
978
990
}
979
991
980
992
if (audio_config .achan [chan ].num_subchan > 1 && audio_config .achan [chan ].num_slicers == 1 ) {
981
- dw_printf ("[%d.%d] " , chan , subchan );
993
+ dw_printf ("[%d.%d%s ] " , chan , subchan , ts );
982
994
}
983
995
else if (audio_config .achan [chan ].num_subchan == 1 && audio_config .achan [chan ].num_slicers > 1 ) {
984
- dw_printf ("[%d.%d] " , chan , slice );
996
+ dw_printf ("[%d.%d%s ] " , chan , slice , ts );
985
997
}
986
998
else if (audio_config .achan [chan ].num_subchan > 1 && audio_config .achan [chan ].num_slicers > 1 ) {
987
- dw_printf ("[%d.%d.%d] " , chan , subchan , slice );
999
+ dw_printf ("[%d.%d.%d%s ] " , chan , subchan , slice , ts );
988
1000
}
989
1001
else {
990
- dw_printf ("[%d] " , chan );
1002
+ dw_printf ("[%d%s ] " , chan , ts );
991
1003
}
992
1004
}
993
1005
@@ -1011,7 +1023,7 @@ void app_process_rec_packet (int chan, int subchan, int slice, packet_t pp, alev
1011
1023
dw_printf ("(%s)" , desc );
1012
1024
if (ftype == frame_type_U_XID ) {
1013
1025
struct xid_param_s param ;
1014
- char info2text [100 ];
1026
+ char info2text [150 ];
1015
1027
1016
1028
xid_parse (pinfo , info_len , & param , info2text , sizeof (info2text ));
1017
1029
dw_printf (" %s\n" , info2text );
@@ -1271,6 +1283,7 @@ static void usage (char **argv)
1271
1283
dw_printf (" -x Send Xmit level calibration tones.\n" );
1272
1284
dw_printf (" -U Print UTF-8 test string and exit.\n" );
1273
1285
dw_printf (" -S Print symbol tables and exit.\n" );
1286
+ dw_printf (" -T fmt Time stamp format for sent and received frames.\n" );
1274
1287
dw_printf ("\n" );
1275
1288
1276
1289
dw_printf ("After any options, there can be a single command line argument for the source of\n" );
0 commit comments