105 #define _eos( _s ) ( &(_s)[strlen( _s )] ) 109 #if defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x0500 ) 133 static CLSTR s = {
"** invalid **",
"** ung" LCUE "ltig **" };
159 ulong flags,
int is_msf )
162 const char *cp = NULL;
165 if ( ( pcps_status &
PCPS_UTC ) && ( utc_offs == 0 ) )
183 if ( !( pcps_status & PCPS_DL_ENB ) )
191 if ( ( utc_offs == 0 ) && is_msf )
218 if ( pcps_status & PCPS_DL_ENB )
401 n +=
snprintf_safe( &s[n], max_len - n,
"%02i:%02i:%02i.%07i",
410 #if MBG_TGT_HAS_WCHAR_T && defined( MBG_TGT_WIN32 ) 421 mbstowcs( ws, tmp_str, count );
422 ws[count - 1] = L
'0';
426 size_t n = wcslen( ws );
427 _snwprintf( &ws[n], count - n, L
" %s", tz_str );
428 ws[count - 1] = L
'0';
435 #endif // MBG_TGT_HAS_WCHAR 443 pstr->
is_err = err_cond != 0;
478 memset( &tmp_strs, 0,
sizeof( tmp_strs ) );
480 if ( !status_is_read )
486 pstr->
cp =
_lstr( clstr_time_inval );
492 pstr->
cp =
_lstr( clstr_set_manually );
498 is_gps ? &lstr_gps_syncd : &lstr_dcf_has_syncd );
503 is_gps ? &lstr_gps_pos : &lstr_dcf_not_free_running );
509 pstr->
cp =
_lstr( clstr_ann_dst );
512 pstr->
cp =
_lstr( clstr_ann_ls );
uint8_t PCPS_TZCODE
Type of variable to hold a TZ code.
invalid time because battery had been disconnected, or absolute time can't be decoded safely ...
#define DEFAULT_STR_GPS_NOT_SYNCD
uint8_t n_str_type
max num of string types supported by any port
COM_PARM parm
transmission speed, framing, etc.
void pcps_status_strs(ushort status, int status_is_read, int is_gps, PCPS_STATUS_STRS *pstrs)
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.
the number of valid codes
const char *const CLSTR[N_LNG]
#define _pcps_time_is_read(_t)
char * strncpy_safe(char *dst, const char *src, size_t max_len)
A portable, safe implementation of strncpy()
int32_t frac
fractions of a second, 1/RECEIVER_INFO::ticks_per_sec units
#define DEFAULT_STR_SET_MANUALLY
Information on a supported string format.
Local date and time computed from GPS time.
Configuration settings of a serial port.
#define DEFAULT_STR_GPS_POS_OK
int8_t sec
seconds, 0..59, or 60 in case of inserted leap second
CLSTR tzcode_name[N_PCPS_TZCODE]
#define _int_from_size_t(_n)
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.
char * pcps_port_str(char *s, size_t max_len, const PCPS_DEV *pdev)
static void pcps_setup_status_str(PCPS_STATUS_STR *pstr, int err_cond, CLSTR_STATUS *pss)
#define DEFAULT_STR_GPS_POS_NOT_OK
int8_t mday
day of month, 1..31
const char * short_mode_name[N_STR_MODE]
char long_name[23]
long name of the string format
int16_t year
year number, 0..9999
#define DEFAULT_STR_ANN_LS
int32_t utc_offs
UTC offs [sec] (loc_time = tstamp + utc_offs)
const char * pcps_tzcode_str(PCPS_TZCODE tzcode)
#define _pcps_snprint_time_long(_s, _sz, _t)
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.
PCPS_TIME_STATUS_X status
status bits, see PCPS_TIME_STATUS_FLAGS
char framing[4]
ASCIIZ framing string, e.g. "8N1" or "7E2", see MBG_FRAMING_STRS.
#define DEFAULT_STR_TIME_INVAL
uint8_t str_type
index of the supported time string formats, see STR_TYPE_INFO_IDX
char * pcps_date_time_str(char *s, size_t max_len, const PCPS_TIME *t, int year_limit, const char *tz_str)
static const char tz_name_utc[]
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
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)
#define _pcps_snprint_wday(_s, _sz, _t, _l)
#define DEFAULT_STR_DCF_NOT_FREE_RUNNING
#define _pcps_short_port_base(_d, _n)
returned time is always UTC instead of some local time
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.
const char * str_not_avail
long wave or time code receiver has sync'ed at least once after pwr up, sat receiver is synchronized ...
the current time has been set by an API call, for very old clocks see REV_PCPS_IFTM_PC31PS31 ...
#define DEFAULT_STR_ANN_DST
int8_t offs_utc
[hours], 0 if not _pcps_has_utc_offs
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.
#define DEFAULT_STR_DCF_HAS_SYNCD
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.
a change in daylight saving status is announced
#define _pcps_snprint_date(_s, _sz, _t, _yl)
uint8_t mode
string mode, see STR_MODES
High resolution time including status and local time offset.
int8_t wday
day of week, 0..6 == Sun..Sat
int snprint_utc_offs(char *s, size_t max_len, const char *info, long utc_offs)
Print a UTC offset into a string.
Local calendar date and time, plus sync status.
uint16_t PCPS_TIME_STATUS_X
Extended status code.
ALL_PORT_INFO_IDX pii
all serial port configuration settings
int snprintf_safe(char *s, size_t max_len, const char *fmt,...)
A portable, safe implementation of snprintf()
const char * inv_str(void)
Return a language dependend string for "invalid".
#define DEFAULT_STR_DCF_FREE_RUNNING
int snprint_ctry_wday(char *s, size_t max_len, int wday, LANGUAGE language)
int pcps_str_tm_gps_date_time(char *s, size_t max_len, const TM_GPS *t)
long wave or time code receiver running on xtal, satellite receiver has not verified its position ...
#define DEFAULT_STR_GPS_SYNCD
BAUD_RATE baud_rate
transmission speed, e.g. 19200L, see MBG_BAUD_RATES
A structure used to identify a device type and supported features.
PCPS_TIME_STATUS status
status bits, see PCPS_TIME_STATUS_FLAGS_COMMON
leap second announced, for very old clocks see REV_PCPS_LS_ANN_PC31PS31
int sn_cpy_char_safe(char *dst, size_t max_len, char c)
A function to copy a character safely to a string buffer.
ALL_STR_TYPE_INFO_IDX stii
all supported serial string types
see PCPS_TZ_NAME_FORCE_UTC_OFFS
const char * mode_name[N_STR_MODE][N_LNG]
#define DEFAULT_STR_DCF_HAS_NOT_SYNCD
All configuration parameters for all serial ports.