mbgtools-lx  4.2.8
pcpslstr.c
Go to the documentation of this file.
1 
2 /**************************************************************************
3  *
4  * $Id: pcpslstr.c 1.27 2018/12/11 16:02:28 martin EXP $
5  *
6  * Copyright (c) Meinberg Funkuhren, Bad Pyrmont, Germany
7  *
8  * Description:
9  * Functions generating commonly used multi-language strings used
10  * with programs for Meinberg radio clocks.
11  *
12  * -----------------------------------------------------------------------
13  * $Log: pcpslstr.c $
14  * Revision 1.27 2018/12/11 16:02:28 martin
15  * Use standard int types for more compatibility.
16  * Revision 1.26 2018/01/15 18:24:57Z martin
17  * Moved snprint_utc_offs() to timeutil.c.
18  * New function pcps_str_tm_gps_date_time().
19  * Revision 1.25 2017/07/05 07:43:53 martin
20  * Use safe string functions from str_util.c.
21  * Started to add doxygen comments.
22  * Revision 1.24 2014/03/13 14:32:27 martin
23  * Fixed compiler warning.
24  * Revision 1.23 2012/10/15 13:09:35Z martin
25  * Added function sprint_utc_offs().
26  * Cleaned up get_tz_name().
27  * Fixed potential compiler warning for sprintf().
28  * Fixed build under FreeBSD.
29  * Revision 1.22 2010/06/25 13:57:57Z daniel
30  * Account for time zone offsets with minutes other than 0.
31  * Revision 1.21 2009/03/19 08:06:58Z daniel
32  * Added function pcps_tz_name_hr_status() to
33  * handle different time scales.
34  * Revision 1.20 2008/11/14 12:12:26Z martin
35  * Made some parameters for some functions const.
36  * Revision 1.19 2008/07/18 10:50:46Z martin
37  * Use _snwprintf with underscore for MS compilers.
38  * Revision 1.18 2008/01/30 14:51:12Z martin
39  * Fixed gcc compiler warnings.
40  * Revision 1.17 2008/01/17 09:08:12 daniel
41  * Added function pcps_date_time_wstr().
42  * Changed function pcps_tz_name() to support MSF related time zones.
43  * Exclude functions using wchar_t from build if wide chars are
44  * not supported by the target environment.
45  * Revision 1.16 2007/08/14 09:08:25Z martin
46  * Addad a workaround for older Borland compilers which don't
47  * like "const" inside structures.
48  * Revision 1.15 2007/07/20 10:55:27Z martin
49  * Some modifications to avoid compiler warnings.
50  * Revision 1.14 2007/03/30 13:23:42 martin
51  * In pcps_status_strs() handle case where time has been
52  * set manually.
53  * Revision 1.13 2007/03/29 12:58:18Z martin
54  * Moved some definitions to the header file to make them public.
55  * Revision 1.12 2006/05/04 14:56:03Z martin
56  * Strings returned by inv_str() ar surrounded by "**"s.
57  * Revision 1.11 2004/11/09 15:06:44Z martin
58  * Type cast to avoid warning with format string.
59  * Revision 1.10 2004/08/18 14:58:02 martin
60  * pcps_tz_name() now expects a flags parameter which controls
61  * the format of the output string.
62  * Revision 1.9 2004/04/28 08:06:12Z martin
63  * Append DST status to TZ names labeled "UTC+xh"
64  * in pcps_tz_name().
65  * Revision 1.8 2003/04/15 10:46:31Z martin
66  * Pass RECEIVER_INFO to pcps_serial_str().
67  * Revision 1.7 2002/12/18 09:57:03Z martin
68  * Made some vaiables and definitions global.
69  * Revision 1.6 2002/02/19 10:03:16Z MARTIN
70  * New function pcps_serial_str().
71  * Revision 1.5 2001/09/17 13:17:40 MARTIN
72  * New function pcps_tz_name_from_status() which should be used
73  * instead of pcps_tz_name() if offset from UTC is not known.
74  * New function pcps_status_strs().
75  * Enhanced language support.
76  * Don't require myutil.h anymore.
77  * Added some comments.
78  * Source code cleanup.
79  * Revision 1.4 2001/08/14 11:32:24 MARTIN
80  * Modified pcps_date_time_str() to allow for variable
81  * spacing between date, time, and time zone..
82  * Revision 1.3 2001/02/28 15:47:29 MARTIN
83  * Replaced access to some structure elements by new macro calls.
84  * Revision 1.2 2000/08/31 14:03:46 MARTIN
85  * Modified initializers for tzcode_name for non CPP-compilers.
86  * Revision 1.1 2000/07/21 12:14:01 MARTIN
87  * Initial revision
88  *
89  **************************************************************************/
90 
91 #define _PCPSLSTR
92  #include <pcpslstr.h>
93 #undef _PCPSLSTR
94 
95 #include <pcpsutil.h>
96 #include <mbgtime.h>
97 #include <timeutil.h>
98 #include <ctry.h>
99 
100 #include <stdio.h>
101 #include <string.h>
102 #include <stdlib.h>
103 
104 
105 #define _eos( _s ) ( &(_s)[strlen( _s )] )
106 
107 typedef struct
108 {
109  #if defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x0500 )
110  // old BCs don't like "const" inside the structure
111  LSTR ok;
112  LSTR err;
113  #else
116  #endif
117 } CLSTR_STATUS;
118 
119 
120 static const char tz_name_utc[] = TZ_NAME_UTC;
121 static CLSTR str_dst = { "DST", "Sommerzeit" };
122 
123 
124 
125 /*HDR*/
131 const char *inv_str( void )
132 {
133  static CLSTR s = { "** invalid **", "** ung" LCUE "ltig **" };
134 
135  return _lstr( s );
136 
137 } // inv_str
138 
139 
140 
141 static /*HDR*/
158 const char *get_tz_name( PCPS_TIME_STATUS_X pcps_status, long utc_offs,
159  ulong flags, int is_msf )
160 {
161  static char ws[40];
162  const char *cp = NULL;
163  size_t n = 0;
164 
165  if ( ( pcps_status & PCPS_UTC ) && ( utc_offs == 0 ) )
166  return tz_name_utc; // no offset, no DST
167 
168  if ( pcps_status & PCPS_DL_ENB )
169  {
170  if ( utc_offs == ( 2 * SECS_PER_HOUR ) )
171  {
172  cp = _lstr( lstr_cest );
173  goto check_flags;
174  }
175  else
176  if ( ( utc_offs == SECS_PER_HOUR ) && is_msf )
177  {
178  cp = _lstr( lstr_bst );
179  goto check_flags;
180  }
181  }
182 
183  if ( !( pcps_status & PCPS_DL_ENB ) )
184  {
185  if ( utc_offs == SECS_PER_HOUR )
186  {
187  cp = _lstr( lstr_cet );
188  goto check_flags;
189  }
190  else
191  if ( ( utc_offs == 0 ) && is_msf )
192  {
193  cp = _lstr( lstr_gmt );
194  goto check_flags;
195  }
196  }
197 
198  n = snprint_utc_offs( ws, sizeof( ws ), tz_name_utc, utc_offs );
199 
200 check_flags:
201  if ( cp )
202  {
203  if ( flags == 0 )
204  return cp;
205 
206  n = sn_cpy_str_safe( ws, sizeof( ws ), cp );
207 
208  if ( flags & PCPS_TZ_NAME_FORCE_UTC_OFFS )
209  {
210  n += snprintf_safe( &ws[n], sizeof( ws ) - n, "%*c(", pcps_time_tz_dist, ' ' );
211  n += snprint_utc_offs( &ws[n], sizeof( ws ) - n, tz_name_utc, utc_offs );
212  n += sn_cpy_char_safe( &ws[n], sizeof( ws ) - n, ')' );
213  }
214  }
215 
216  if ( flags & PCPS_TZ_NAME_APP_DST )
217  {
218  if ( pcps_status & PCPS_DL_ENB )
219  snprintf_safe( &ws[n], sizeof( ws ) - n, ",%*c%s", pcps_time_tz_dist,
220  ' ', _lstr( str_dst ) );
221  }
222 
223  return ws;
224 
225 } // get_tz_name
226 
227 
228 
229 /*HDR*/
245 const char *pcps_tz_name( const PCPS_TIME *t, ulong flags, int is_msf )
246 {
247  return get_tz_name( t->status, t->offs_utc * SECS_PER_HOUR, flags, is_msf );
248 
249 } // pcps_tz_name
250 
251 
252 
253 /*HDR*/
269 const char *pcps_tz_name_from_hr_time( const PCPS_HR_TIME *hrt, ushort flags, int is_msf )
270 {
271  return get_tz_name( hrt->status, hrt->utc_offs, flags, is_msf );
272 
273 } // pcps_tz_name_from_hr_time
274 
275 
276 
277 /*HDR*/
296 const char *pcps_tz_name_hr_status( const PCPS_HR_TIME *t, ushort flags, int is_msf )
297 {
298  static char ws[40];
299 
300  if ( t->status & PCPS_SCALE_GPS )
301  strncpy_safe( ws, "GPS", sizeof( ws ) );
302  else
303  if ( t->status & PCPS_SCALE_TAI )
304  strncpy_safe( ws, "TAI", sizeof( ws ) );
305  else
306  return pcps_tz_name_from_hr_time( t, flags, is_msf );
307 
308  return ws;
309 
310 } // pcps_tz_name_hr_status
311 
312 
313 
314 /*HDR*/
333 {
334  if ( status & PCPS_UTC )
335  return tz_name_utc;
336 
337  return ( status & PCPS_DL_ENB ) ? _lstr( str_dst ) : "";
338 
339 } // pcps_tz_name_from_status
340 
341 
342 
343 /*HDR*/
344 char *pcps_date_time_str( char *s, size_t max_len, const PCPS_TIME *t,
345  int year_limit, const char *tz_str )
346 {
347  if ( !_pcps_time_is_read( t ) )
348  strncpy_safe( s, str_not_avail, max_len );
349  else
350  {
351  size_t n;
352  int i;
353 
354  _pcps_snprint_wday( s, max_len, t, language );
355  n = strlen( s );
356 
357  n += sn_cpy_char_safe( &s[n], max_len - n, ',' );
358 
359  for ( i = 0; i < pcps_wday_date_dist; i++ )
360  n += sn_cpy_char_safe( &s[n], max_len - n, ' ' );
361 
362  _pcps_snprint_date( &s[n], max_len - n, t, year_limit );
363  n = strlen( s );
364 
365  for ( i = 0; i < pcps_date_time_dist; i++ )
366  n += sn_cpy_char_safe( &s[n], max_len - n, ' ' );
367 
368  _pcps_snprint_time_long( &s[n], max_len - n, t );
369  n = strlen( s );
370 
371  if ( tz_str )
372  {
373  for ( i = 0; i < pcps_time_tz_dist; i++ )
374  n += sn_cpy_char_safe( &s[n], max_len - n, ' ' );
375 
376  n += sn_cpy_str_safe( &s[n], max_len - n, tz_str );
377  }
378  }
379 
380  return s;
381 
382 } // pcps_date_time_str
383 
384 
385 
386 /*HDR*/
387 int pcps_str_tm_gps_date_time( char *s, size_t max_len, const TM_GPS *t )
388 {
389  size_t n;
390  int i;
391 
392  n = snprint_ctry_wday( s, max_len, t->wday, language );
393  n += sn_cpy_str_safe( &s[n], max_len - n, ", " );
394 
395  n += snprintf_safe( &s[n], max_len - n, "%04i-%02i-%02i",
396  t->year, t->month, t->mday );
397 
398  for ( i = 0; i < pcps_wday_date_dist; i++ )
399  n += sn_cpy_char_safe( &s[n], max_len - n, ' ' );
400 
401  n += snprintf_safe( &s[n], max_len - n, "%02i:%02i:%02i.%07i",
402  t->hour, t->min, t->sec, t->frac );
403 
404  return _int_from_size_t ( n );
405 
406 } // pcps_str_tm_gps_date_time
407 
408 
409 
410 #if MBG_TGT_HAS_WCHAR_T && defined( MBG_TGT_WIN32 )
411 
412 /*HDR*/
413 wchar_t *pcps_date_time_wstr( wchar_t *ws, size_t count, const PCPS_TIME *t,
414  ushort year_limit, const wchar_t *tz_str )
415 {
416  //#error Remove this error directive and check if the function works properly.
417  char tmp_str[80];
418 
419  pcps_date_time_str( tmp_str, sizeof( tmp_str ), t, year_limit, NULL );
420 
421  mbstowcs( ws, tmp_str, count );
422  ws[count - 1] = L'0'; // force terminating 0
423 
424  if ( tz_str )
425  {
426  size_t n = wcslen( ws );
427  _snwprintf( &ws[n], count - n, L" %s", tz_str );
428  ws[count - 1] = L'0'; // force terminating 0
429  }
430 
431  return ws;
432 
433 } // pcps_date_time_wstr
434 
435 #endif // MBG_TGT_HAS_WCHAR
436 
437 
438 
439 static /*HDR*/
440 void pcps_setup_status_str( PCPS_STATUS_STR *pstr, int err_cond,
441  CLSTR_STATUS *pss )
442 {
443  pstr->is_err = err_cond != 0;
444  pstr->cp = _lstr( pstr->is_err ? pss->err : pss->ok );
445 
446 } // pcps_setup_status_str
447 
448 
449 
450 // to return status strings to be displayed depending on the
451 // a clocks PCPS_TIME.status.
452 
453 /*HDR*/
454 void pcps_status_strs( ushort status, int status_is_read,
455  int is_gps, PCPS_STATUS_STRS *pstrs )
456 {
457  CLSTR clstr_time_inval = DEFAULT_STR_TIME_INVAL;
458  CLSTR clstr_set_manually = DEFAULT_STR_SET_MANUALLY;
459 
460  CLSTR_STATUS lstr_dcf_has_syncd =
462 
463  CLSTR_STATUS lstr_gps_syncd =
465 
466  CLSTR_STATUS lstr_dcf_not_free_running =
468 
469  CLSTR_STATUS lstr_gps_pos =
471 
472  CLSTR clstr_ann_dst = DEFAULT_STR_ANN_DST;
473  CLSTR clstr_ann_ls = DEFAULT_STR_ANN_LS;
474 
475  PCPS_STATUS_STRS tmp_strs;
476  PCPS_STATUS_STR *pstr = &tmp_strs.s[0];
477 
478  memset( &tmp_strs, 0, sizeof( tmp_strs ) );
479 
480  if ( !status_is_read )
481  pstr->cp = str_not_avail;
482  else
483  {
484  if ( status & PCPS_INVT )
485  {
486  pstr->cp = _lstr( clstr_time_inval );
487  pstr->is_err = 1;
488  }
489  else
490  if ( status & PCPS_IFTM )
491  {
492  pstr->cp = _lstr( clstr_set_manually );
493  pstr->is_err = 1;
494  }
495  else
496  {
497  pcps_setup_status_str( pstr, ( status & PCPS_SYNCD ) == 0,
498  is_gps ? &lstr_gps_syncd : &lstr_dcf_has_syncd );
499 
500  pstr++;
501 
502  pcps_setup_status_str( pstr, ( status & PCPS_FREER ) != 0,
503  is_gps ? &lstr_gps_pos : &lstr_dcf_not_free_running );
504  }
505 
506  pstr++;
507 
508  if ( status & PCPS_DL_ANN )
509  pstr->cp = _lstr( clstr_ann_dst );
510  else
511  if ( status & PCPS_LS_ANN )
512  pstr->cp = _lstr( clstr_ann_ls );
513  }
514 
515  *pstrs = tmp_strs;
516 
517 } // pcps_status_strs
518 
519 
520 
521 /*HDR*/
522 char *pcps_port_str( char *s, size_t max_len, const PCPS_DEV *pdev )
523 {
524  ushort port = _pcps_short_port_base( pdev, 0 );
525 
526  size_t n = snprintf_safe( s, max_len, "%3Xh", port );
527 
528  port = _pcps_short_port_base( pdev, 1 );
529 
530  if ( port )
531  snprintf_safe( &s[n], max_len - n, ", %3Xh", port );
532 
533  return s;
534 
535 } // pcps_port_str
536 
537 
538 
539 /*HDR*/
540 const char *pcps_tzcode_str( PCPS_TZCODE tzcode )
541 {
542  if ( language < N_LNG && tzcode < N_PCPS_TZCODE )
543  return tzcode_name[tzcode][language];
544 
545  return inv_str();
546 
547 } // pcps_tzcode_str
548 
549 
550 
551 /*HDR*/
552 char *pcps_serial_str( char *s, size_t max_len, int i, const RECEIVER_PORT_CFG *p,
553  const RECEIVER_INFO *p_ri, int short_strs )
554 {
555  const PORT_SETTINGS *p_ps = &p->pii[i].port_info.port_settings;
556  const STR_TYPE_INFO *p_sti = &p->stii[p_ps->str_type].str_type_info;
557  size_t n;
558 
559  n = snprintf_safe( s, max_len, "%lu,%s", (ulong) p_ps->parm.baud_rate, p_ps->parm.framing );
560 
561  if ( short_strs )
562  n += snprintf_safe( &s[n], max_len - n, ",%s", short_mode_name[p_ps->mode] );
563  else
564  {
565  if ( p_ri->n_str_type > 1 )
566  n += snprintf_safe( &s[n], max_len - n, ", %s", p_sti->long_name );
567 
568  n += snprintf_safe( &s[n], max_len - n, ", %s", _lstr( mode_name[p_ps->mode] ) );
569  }
570 
571  return s;
572 
573 } // pcps_serial_str
574 
575 
uint8_t PCPS_TZCODE
Type of variable to hold a TZ code.
Definition: pcpsdefs.h:1432
invalid time because battery had been disconnected, or absolute time can&#39;t be decoded safely ...
Definition: pcpsdefs.h:1261
#define DEFAULT_STR_GPS_NOT_SYNCD
Definition: pcpslstr.h:334
uint8_t n_str_type
max num of string types supported by any port
Definition: gpsdefs.h:888
COM_PARM parm
transmission speed, framing, etc.
Definition: gpsdefs.h:3509
time stamp is GPS scale
Definition: pcpsdefs.h:1275
CLSTR lstr_cet
void pcps_status_strs(ushort status, int status_is_read, int is_gps, PCPS_STATUS_STRS *pstrs)
Definition: pcpslstr.c:454
const char * pcps_tz_name_from_hr_time(const PCPS_HR_TIME *hrt, ushort flags, int is_msf)
Return a static time zone string depending on the UTC offset from a PCPS_HR_TIME structure.
Definition: pcpslstr.c:269
the number of valid codes
Definition: pcpsdefs.h:1444
#define LCUE
Definition: charcode.h:194
const char *const CLSTR[N_LNG]
Definition: ctry.h:118
#define _pcps_time_is_read(_t)
Definition: pcpsdev.h:1344
char * strncpy_safe(char *dst, const char *src, size_t max_len)
A portable, safe implementation of strncpy()
Definition: str_util.c:247
int32_t frac
fractions of a second, 1/RECEIVER_INFO::ticks_per_sec units
Definition: gpsdefs.h:2603
#define DEFAULT_STR_SET_MANUALLY
Definition: pcpslstr.h:291
Information on a supported string format.
Definition: gpsdefs.h:3704
char * LSTR[N_LNG]
Definition: ctry.h:114
LANGUAGE language
Definition: mbgstatus.c:125
Local date and time computed from GPS time.
Definition: gpsdefs.h:2593
Configuration settings of a serial port.
Definition: gpsdefs.h:3507
#define TZ_NAME_UTC
Definition: pcpslstr.h:413
#define DEFAULT_STR_GPS_POS_OK
Definition: pcpslstr.h:341
int8_t sec
seconds, 0..59, or 60 in case of inserted leap second
Definition: gpsdefs.h:2602
CLSTR tzcode_name[N_PCPS_TZCODE]
#define _int_from_size_t(_n)
Definition: words.h:662
CLSTR ok
Definition: pcpslstr.c:114
int sn_cpy_str_safe(char *dst, size_t max_len, const char *src)
A function to copy a string safely, returning the number of characters copied.
Definition: str_util.c:276
char * pcps_port_str(char *s, size_t max_len, const PCPS_DEV *pdev)
Definition: pcpslstr.c:522
static void pcps_setup_status_str(PCPS_STATUS_STR *pstr, int err_cond, CLSTR_STATUS *pss)
Definition: pcpslstr.c:440
#define DEFAULT_STR_GPS_POS_NOT_OK
Definition: pcpslstr.h:348
int8_t mday
day of month, 1..31
Definition: gpsdefs.h:2597
const char * short_mode_name[N_STR_MODE]
char long_name[23]
long name of the string format
Definition: gpsdefs.h:3707
int16_t year
year number, 0..9999
Definition: gpsdefs.h:2595
int8_t hour
hours, 0..23
Definition: gpsdefs.h:2600
unsigned short ushort
Definition: words.h:282
int8_t min
minutes, 0..59
Definition: gpsdefs.h:2601
#define DEFAULT_STR_ANN_LS
Definition: pcpslstr.h:362
int32_t utc_offs
UTC offs [sec] (loc_time = tstamp + utc_offs)
Definition: pcpsdefs.h:1088
const char * pcps_tzcode_str(PCPS_TZCODE tzcode)
Definition: pcpslstr.c:540
#define _pcps_snprint_time_long(_s, _sz, _t)
Definition: pcpslstr.h:899
const char * pcps_tz_name_from_status(PCPS_TIME_STATUS_X status)
Return a static time zone string depending on the UTC offset from a PCPS_HR_TIME structure.
Definition: pcpslstr.c:332
int pcps_date_time_dist
PCPS_TIME_STATUS_X status
status bits, see PCPS_TIME_STATUS_FLAGS
Definition: pcpsdefs.h:1089
#define SECS_PER_HOUR
Definition: mbgtime.h:242
char framing[4]
ASCIIZ framing string, e.g. "8N1" or "7E2", see MBG_FRAMING_STRS.
Definition: gpsdefs.h:3205
#define DEFAULT_STR_TIME_INVAL
Definition: pcpslstr.h:284
uint8_t str_type
index of the supported time string formats, see STR_TYPE_INFO_IDX
Definition: gpsdefs.h:3511
char * pcps_date_time_str(char *s, size_t max_len, const PCPS_TIME *t, int year_limit, const char *tz_str)
Definition: pcpslstr.c:344
static const char tz_name_utc[]
Definition: pcpslstr.c:120
char * pcps_date_time_wstr(char *ws, size_t count, const PCPS_TIME *t, ushort year_limit, const char *tz_str)
daylight saving currently enabled
Definition: pcpsdefs.h:1255
char * pcps_serial_str(char *s, size_t max_len, int i, const RECEIVER_PORT_CFG *p, const RECEIVER_INFO *p_ri, int short_strs)
Definition: pcpslstr.c:552
#define _pcps_snprint_wday(_s, _sz, _t, _l)
Definition: pcpslstr.h:889
#define DEFAULT_STR_DCF_NOT_FREE_RUNNING
Definition: pcpslstr.h:320
#define _pcps_short_port_base(_d, _n)
Definition: pcpsdev.h:1109
returned time is always UTC instead of some local time
Definition: pcpsdefs.h:1258
static const char * get_tz_name(PCPS_TIME_STATUS_X pcps_status, long utc_offs, ulong flags, int is_msf)
Return a static string with the name of the timezone, depending on the UTC offset.
Definition: pcpslstr.c:158
const char * str_not_avail
long wave or time code receiver has sync&#39;ed at least once after pwr up, sat receiver is synchronized ...
Definition: pcpsdefs.h:1256
int pcps_time_tz_dist
the current time has been set by an API call, for very old clocks see REV_PCPS_IFTM_PC31PS31 ...
Definition: pcpsdefs.h:1260
int pcps_wday_date_dist
#define DEFAULT_STR_ANN_DST
Definition: pcpslstr.h:355
int8_t offs_utc
[hours], 0 if not _pcps_has_utc_offs
Definition: pcpsdefs.h:1142
CLSTR lstr_bst
const char * pcps_tz_name(const PCPS_TIME *t, ulong flags, int is_msf)
Return a static time zone string depending on the UTC offset from a PCPS_TIME structure.
Definition: pcpslstr.c:245
#define DEFAULT_STR_DCF_HAS_SYNCD
Definition: pcpslstr.h:299
const char * pcps_tz_name_hr_status(const PCPS_HR_TIME *t, ushort flags, int is_msf)
Return a static time zone string depending on the UTC offset from a PCPS_HR_TIME structure.
Definition: pcpslstr.c:296
Definition: ctry.h:106
a change in daylight saving status is announced
Definition: pcpsdefs.h:1257
#define _pcps_snprint_date(_s, _sz, _t, _yl)
Definition: pcpslstr.h:892
static CLSTR str_dst
Definition: pcpslstr.c:121
uint8_t mode
string mode, see STR_MODES
Definition: gpsdefs.h:3510
PCPS_STATUS_STR s[3]
Definition: pcpslstr.h:207
High resolution time including status and local time offset.
Definition: pcpsdefs.h:1085
int8_t wday
day of week, 0..6 == Sun..Sat
Definition: gpsdefs.h:2599
int snprint_utc_offs(char *s, size_t max_len, const char *info, long utc_offs)
Print a UTC offset into a string.
Definition: timeutil.c:211
CLSTR lstr_cest
Local calendar date and time, plus sync status.
Definition: pcpsdefs.h:1128
uint16_t PCPS_TIME_STATUS_X
Extended status code.
Definition: pcpsdefs.h:1022
time stamp is TAI scale
Definition: pcpsdefs.h:1276
const char * cp
Definition: pcpslstr.h:201
#define _lstr(_s)
Definition: ctry.h:199
ALL_PORT_INFO_IDX pii
all serial port configuration settings
Definition: cfg_hlp.h:192
int snprintf_safe(char *s, size_t max_len, const char *fmt,...)
A portable, safe implementation of snprintf()
Definition: str_util.c:156
const char * inv_str(void)
Return a language dependend string for "invalid".
Definition: pcpslstr.c:131
#define DEFAULT_STR_DCF_FREE_RUNNING
Definition: pcpslstr.h:313
CLSTR err
Definition: pcpslstr.c:115
CLSTR lstr_gmt
int snprint_ctry_wday(char *s, size_t max_len, int wday, LANGUAGE language)
Definition: ctrydttm.c:86
int pcps_str_tm_gps_date_time(char *s, size_t max_len, const TM_GPS *t)
Definition: pcpslstr.c:387
static int year_limit
Definition: mbgstatus.c:118
long wave or time code receiver running on xtal, satellite receiver has not verified its position ...
Definition: pcpsdefs.h:1254
int8_t month
month, 1..12
Definition: gpsdefs.h:2596
unsigned long ulong
Definition: words.h:292
see PCPS_TZ_NAME_APP_DST
Definition: pcpslstr.h:190
#define DEFAULT_STR_GPS_SYNCD
Definition: pcpslstr.h:327
BAUD_RATE baud_rate
transmission speed, e.g. 19200L, see MBG_BAUD_RATES
Definition: gpsdefs.h:3204
A structure used to identify a device type and supported features.
Definition: gpsdefs.h:873
Device info structure.
Definition: pcpsdev.h:1043
PCPS_TIME_STATUS status
status bits, see PCPS_TIME_STATUS_FLAGS_COMMON
Definition: pcpsdefs.h:1140
leap second announced, for very old clocks see REV_PCPS_LS_ANN_PC31PS31
Definition: pcpsdefs.h:1259
int sn_cpy_char_safe(char *dst, size_t max_len, char c)
A function to copy a character safely to a string buffer.
Definition: str_util.c:306
ALL_STR_TYPE_INFO_IDX stii
all supported serial string types
Definition: cfg_hlp.h:193
see PCPS_TZ_NAME_FORCE_UTC_OFFS
Definition: pcpslstr.h:189
const char * mode_name[N_STR_MODE][N_LNG]
#define DEFAULT_STR_DCF_HAS_NOT_SYNCD
Definition: pcpslstr.h:306
All configuration parameters for all serial ports.
Definition: cfg_hlp.h:190