101 #define MBG_FIRST_COPYRIGHT_YEAR 2001 102 #define MBG_LAST_COPYRIGHT_YEAR 0 // use current year by default 104 static const char *
pname =
"mbgstatus";
123 static const char *
wdays[7] = {
"Sun",
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat" };
133 static const char fmt[] =
"\n** Warning: %s\nThe command %s.\n";
139 "\"mbgirigcfg\" can be used to change the settings" );
144 "\"mbgctrl DATE=...\" can be used to set the on-board date" );
156 const char *fmt =
"%s";
178 const char *fmt =
"%s";
180 printf(
"%s %c %3i deg %02i min %06.3f sec",
198 const char *fmt =
"%s";
199 double r2d = 180 /
PI;
212 printf(
" x: %.0fm y: %.0fm z: %.0fm",
220 printf(
" lat: %+.4f lon: %+.4f alt: %.0fm",
275 printf(
", ** UTC offs not configured **" );
277 printf(
", UTC%+ih", ref_offs_h );
297 const char status_fmt[] =
"Status info: %s%s\n";
298 const char status_err[] =
"*** ";
299 const char status_ok[] =
"";
301 "ANTENNA FAULTY" :
"NO INPUT SIGNAL";
302 const char info_ok[] =
"Input signal available";
326 printf(
"Local HR time: %s", ws );
331 printf(
"%s", tail );
346 printf(
"Fast MM time: %s", ws );
347 printf(
"%s", tail );
364 printf(
"TTM time: %s", ws );
365 printf(
", TTM st: 0x%04X", ttm.
tm.
status );
366 printf(
"%s", tail );
368 printf(
"Raw GPS time: wn %u|%06lu.%07lu s", (
unsigned) ttm.
t.
wn,
370 printf(
"%s", tail );
397 printf(
"Raw IRIG time: yday %u, %02u:%02u:%02u\n",
415 pstr->
is_err ? status_err : status_ok,
458 const char *fmt =
"%s";
489 printf(
"EPLD name: \"%s\"\n", ri.
epld_name );
498 case AUTO_166: cp =
"Normal Operation";
break;
499 case WARM_166: cp =
"Warm Boot";
break;
500 case COLD_166: cp =
"Cold Boot";
break;
503 snprintf_safe( ws,
sizeof( ws ),
"%s mode of operation: %02Xh",
515 #if defined( DEBUG ) // TODO 520 int print_multi_lines = ( agi.
n_gnss_supp > 1 ) || must_print_sv_list;
524 printf( print_multi_lines ?
":\n" :
", " );
540 cp = gnss_type_names[gnss_type];
542 if ( print_multi_lines )
547 printf(
"%i %s sats tracked, %i expected to be visible\n", p_gsi->
good_svs, cp, p_gsi->
svs_in_view );
549 if ( must_print_sv_list )
555 int sat_num = p_gsi->
svs[sat_idx];
557 #if !defined( DEBUG ) 562 printf(
"%s%i", ( sat_idx == 0 ) ?
" Sats: " :
", ", sat_num );
570 printf(
"%s reception disabled by configuration\n", cp );
580 printf(
", DAC cal: %+i, fine: %+i",
614 struct tm tm = { 0 };
627 puts(
"** UTC parameters not valid" );
639 mbg_snprintf( tmp_str,
sizeof( tmp_str ),
"at UTC midnight at the end of %s, %04i-%02i-%02i",
640 wdays[tm.tm_wday], tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday );
646 printf(
"UTC correction parameters:\n" );
648 printf(
" CSUM: %04X, valid: %04X\n", utc.
csum, utc.
valid );
649 printf(
" t0t: %u|%u.%07u, A0: %g A1: %g\n",
652 printf(
" WNlsf: %u, DN: %u, offs: %i/%i\n",
659 printf(
"GPS/UTC offset transition from %is to %is due to leap second\n" 669 if ( ( utc.
WNlsf == 0 ) && ( utc.
DNt == 0 ) )
672 printf(
"Leap second information not set\n" );
680 printf(
"Last leap second probably %s\n", tmp_str );
685 printf(
"GPS/UTC offset parameter: %is, no leap second announced.\n", utc.
delta_tls );
704 printf(
"IRIG control bits: %08lX (hex, LSB first)", (
ulong) irig_ctrl_bits );
744 printf(
"Raw IRIG data:" );
746 for ( i = 0; i <
sizeof( raw_irig_data ); i++ )
747 printf(
" %02X", raw_irig_data.
data_bytes[i] );
770 printf(
"Debug status (hex): %08lX\n", (
ulong) st );
773 if ( st & ( 1
UL << i ) )
774 printf(
" %s\n", status_str[i] );
798 printf(
"On-board LAN interface settings:\n" );
801 printf(
" MAC Address: %s\n", ws );
808 printf(
" Net Mask: %s\n", ws );
811 printf(
" Broadcast Addr: %s\n", ws );
814 printf(
" Gateway: %s\n", ws );
816 printf(
" Link detected: %s\n", ( ip4_settings.
flags &
IP4_MSK_LINK ) ?
"YES" :
"NO" );
834 int must_show_slave_mode_info;
835 int must_show_master_mode_info;
836 int slave_mode_active;
837 int master_mode_active;
839 int utc_offset_valid;
857 must_show_slave_mode_info = (
verbose > 1 ) ||
860 must_show_master_mode_info = (
verbose > 1 ) ||
870 any_mode_active = slave_mode_active || master_mode_active;
875 printf(
"PTP port state:\n" );
877 printf(
" Port mode: " );
879 if ( any_mode_active )
881 "Unicast " :
"Multicast " );
884 printf(
"%s", ptp_state_strs[ptp_state.
port_state] );
888 if ( !any_mode_active || (
verbose > 1 ) )
889 printf(
" in %s role",
896 if ( !any_mode_active ||
verbose )
898 printf(
" PTP protocol: " );
909 ptp_nw_prot_strs[tmp] : str_undefined );
915 printf(
", domain %i", tmp );
919 ptp_delay_mech_names[tmp] : str_undefined );
922 printf(
", dly req. intv. 2^%i s", tmp );
928 if ( must_show_slave_mode_info )
934 printf(
" Grandmaster ID: %s\n", cp );
937 printf(
" PTP time offset: %s\n", cp );
940 printf(
" PTP path delay: %s\n", cp );
945 printf(
" Mean path delay: %s\n", cp );
948 printf(
" Delay asymmetry: %s\n", cp );
959 if ( must_show_master_mode_info ||
verbose )
960 cp =
"TAI (standard)";
963 if ( any_mode_active )
964 cp =
"arbitrary (non-standard)";
967 printf(
" PTP time scale: %s\n", cp );
974 printf(
" PTP UTC offset: " );
976 if ( !utc_offset_valid )
979 if ( utc_offset_valid || (
verbose > 1 ) )
981 printf( utc_offset_valid ?
" " :
" (" );
988 printf(
", leap second %s scheduled",
992 if ( !utc_offset_valid )
1003 printf(
"PTP clock state:\n" );
1005 for ( p_tbl = ptp_time_source_tbl; p_tbl->
name; p_tbl++ )
1011 printf(
" Clock class: %i\n", ptp_state.
clock_class );
1015 if ( ( ptp_state.
clock_accuracy >= PTP_CLOCK_ACCURACY_NUM_BIAS ) &&
1021 printf(
" Clock accuracy: %s\n", cp );
1050 static const char *warn_line =
"************************************************************************************";
1058 "** Device %s with S/N %s has a firmware version and ASIC version\n" 1059 "** which do not allow safe operation with hardware interrupts (IRQs) enabled.\n" 1061 "** Please see http://www.meinberg.de/english/info/pex-upgrades.htm\n" 1062 "** for information how the card can easily be upgraded, or contact\n" 1063 "** Meinberg support (Email: support@meinberg.de) or your local\n" 1064 "** representative.\n" 1073 "** Interrupts are currently enabled for this card (NTP daemon running?)\n" 1074 "** so other access is inhibited to prevent the system from hanging.\n" 1163 "This program prints status information for a device.\n" 1164 "The displayed information depends on the type of the card." 1194 while ( ( c = getopt( argc, argv,
"clLn:s:u:vh?" ) ) != -1 )
1211 loops = atoi( optarg );
1251 printf(
"Unique names of devices found:\n" );
1253 for ( pos = list_head; pos; pos = pos->
next )
1257 printf(
"No device found.\n" );
DMS longitude
Longitude broken down to degrees, minutes, seconds.
size_t snprint_mac_addr(char *s, size_t max_len, const MBG_MAC_ADDR *p_mac_addr)
Print a MAC address to a string.
A structure to used to read the status of the PTP protocol stack.
static const char * icode_rx_names[N_ICODE_RX]
_MBG_API_ATTR int _MBG_API mbg_get_gps_pos(MBG_DEV_HANDLE dh, POS *p)
Read the current geographic position from a GPS device.
#define _pcps_has_stat_info_svs(_d)
MBG_GNSS_MODE_SETTINGS settings
Current GNSS mode settings.
invalid time because battery had been disconnected, or absolute time can't be decoded safely ...
#define MBG_DEBUG_STATUS_STRS
Initializers for debug status bit strings.
TM_GPS tm
time converted to UTC and/or local time according to TZDL settings
double A1
+- Clock Correction Coefficient 1 [sec/sec]
static void print_dms(const char *s, const DMS *p, const char *tail)
#define _pcps_has_pzf(_d)
uint8_t port_state
one of the enumerated port states, see PTP_PORT_STATES
void pcps_status_strs(ushort status, int status_is_read, int is_gps, PCPS_STATUS_STRS *pstrs)
An entry for a table of parameters which can not be accessed by an enumerated index.
_MBG_API_ATTR int _MBG_API mbg_get_raw_irig_data(MBG_DEV_HANDLE dh, MBG_RAW_IRIG_DATA *p)
Read raw IRIG data from an IRIG receiver.
#define _pcps_time_is_read(_t)
#define MBG_FIRST_COPYRIGHT_YEAR
#define PTP_ROLE_MSK_MASTERS
Settings of an IPv4-only network interface.
#define PTP_ROLE_MSK_SLAVES
GPS UTC correction parameters.
void ctry_setup(CTRY_CODE code)
#define PCPS_IRQ_STAT_UNSAFE
static const char * ref_name[N_PCPS_REF]
uint16_t WNlsf
Week number of nearest leap second.
static unsigned int verbose
MBG_MAC_ADDR mac_addr
MAC address.
#define _pcps_has_hr_time(_d)
The structure behind the MBG_DEV_NAME_LIST_ENTRY type.
const char * str_undefined
Requested action completed successfully.
static void show_irig_ctrl_bits(MBG_DEV_HANDLE dh)
_MBG_API_ATTR int _MBG_API mbg_get_lan_if_info(MBG_DEV_HANDLE dh, LAN_IF_INFO *p)
Read LAN interface information from a device.
The number of known bits.
static int list_only_unique_names
char epld_name[(8+1)]
ASCIIZ, file name of EPLD image (optional)
static void show_irig_debug_status(MBG_DEV_HANDLE dh)
#define DEFAULT_STR_IRIG_INVT_EN
static const char * osc_name[N_GPS_OSC]
#define PTP_ROLE_STRS
Name strings for defined PTP roles.
int mbg_snprintf(char *s, size_t max_len, const char *fmt,...)
A portable, safer implementation of snprintf().
_MBG_API_ATTR int _MBG_API mbg_get_irig_rx_info(MBG_DEV_HANDLE dh, IRIG_INFO *p)
Read the current IRIG input settings plus capabilities.
int8_t delta_tlsf
Future UTC offset to GPS system time after next leap second transition [sec].
NANO_TIME offset
estimated time offset from the upstream time source
Current IRIG settings and supported codes.
#define MBG_REF_OFFS_MAX
The maximum allowed positive / negative ref offset.
bool mbg_cond_err_msg(int rc, const char *what)
Check if a value is an error code and print an associated error message.
int8_t log_delay_req_intv
number of defined protocols
MBG_GNSS_MODE_INFO gnss_mode_info
#define DEFAULT_GPS_OSC_NAMES
Oscillator type name string initializer.
_MBG_API_ATTR int _MBG_API mbg_get_utc_parm(MBG_DEV_HANDLE dh, UTC *p)
Read a UTC parameter structure from a device.
_MBG_API_ATTR int _MBG_API mbg_get_time(MBG_DEV_HANDLE dh, PCPS_TIME *p)
Read a PCPS_TIME structure returning the current date/time/status.
Unable to handle requested action, usage printed.
_MBG_API_ATTR int _MBG_API mbg_get_hr_time(MBG_DEV_HANDLE dh, PCPS_HR_TIME *p)
Read the card's current time with high resolution, including status.
see PTP_FLAG_TIMESCALE_IS_PTP
uint32_t sec
the second of that week
RI_FEATURES features
optional features, see GPS_FEATURE_MASKS
#define mbg_rc_is_success(_rc)
DMS latitude
Latitude broken down to degrees, minutes, seconds.
_MBG_API_ATTR int _MBG_API mbg_get_fast_hr_timestamp(MBG_DEV_HANDLE dh, PCPS_TIME_STAMP *p)
Read a high resolution PCPS_TIME_STAMP structure via memory mapped access.
#define _pcps_has_ptp(_d)
uint8_t delay_mech
see PTP_DELAY_MECHS
MBG_CHK_SUPP_FNC mbg_chk_dev_is_gps
Check if a device is a GPS receiver.
#define _pcps_tfom_from_irig_ctrl_bits(_p)
Extract the TFOM code from MBG_IRIG_CTRL_BITS.
uint8_t ptp_prot_version
PTP protocol version, 1, or 2, usually 2 for v2.
static IRIG_INFO irig_rx_info
uint8_t value
the parameter value
uint8_t ptp_role
one of the supported PTP roles, see PTP_ROLES
uint16_t mode
Mode of operation, see RECEIVER_MODES.
T_GPS t0t
Reference Time UTC Parameters [wn|sec].
#define DEFAULT_STR_IRIG_NOT_CFGD_EN
#define PTP_NW_PROT_STRS
Name strings for the protocols possibly used with PTP.
IP4_ADDR ip_addr
the IP address
static int max_ref_offs_h
#define N_PCPS_STATUS_STR
const char * ptp_clock_accuracy_strs[N_PTP_CLOCK_ACCURACY - PTP_CLOCK_ACCURACY_NUM_BIAS]
const char * name
the parameter name
static void print_pcps_time(const char *s, const PCPS_TIME *tp, const char *tail)
number of defined ref time sources
static void print_position(const char *s, const POS *p, const char *tail)
Summary information on all supported GNSS systems.
_MBG_API_ATTR int _MBG_API mbg_get_ptp_cfg_info(MBG_DEV_HANDLE dh, PTP_CFG_INFO *p)
Read PTP/IEEE1588 config info and current settings from a device.
uint16_t nw_prot
see PTP_NW_PROTS
double A0
+- Clock Correction Coefficient 0 [sec]
static __mbg_inline time_t cvt_to_time_t(mbg_time_t t)
PCPS_TIME_STATUS_X status
status bits, see PCPS_TIME_STATUS_FLAGS
#define GPS_SEC_BIAS
GPS epoch bias from ordinary time_t epoch.
Geographic longitude or latitude in [degrees, minutes, seconds].
uint32_t flags
see PTP_STATE_FLAGS
DAC_VAL dac_cal
Oscillator calibration DAC value ( see OSC_DAC_RANGE, OSC_DAC_BIAS )
#define _pcps_ref_offs_out_of_range(_n)
uint8_t gnss_type
GNSS type as enumerated in MBG_GNSS_TYPES.
uint8_t sec
seconds, 0..59, may be 60 for leap second
char * pcps_date_time_str(char *s, size_t max_len, const PCPS_TIME *t, int year_limit, const char *tz_str)
uint8_t domain_number
the PTP clock domain number, 0:3
const char * ptp_role_strs[N_PTP_ROLES]
#define _pcps_has_irig_time(_d)
MBG_DEV_NAME_LIST_ENTRY * next
uint16_t svs_in_view
Num. of satellites that should be visible above the horizon.
#define _pcps_has_ref_offs(_d)
A structure to used to query the current configuration and capabilities of a PTP port.
static void show_gps_pos(MBG_DEV_HANDLE dh, const char *tail)
uint16_t status
status flags, see TM_GPS_STATUS_BIT_MASKS
uint8_t min
minutes, 0..59
uint16_t prefix
'N', 'E', 'S' or 'W'
_MBG_API_ATTR int _MBG_API mbg_get_irig_time(MBG_DEV_HANDLE dh, PCPS_IRIG_TIME *p)
Read the IRIG time and day-of-year number from an IRIG receiver.
PTP_CLOCK_ID gm_id
identifier ot the upstream time source
A structure used to transmit information on date and time.
uint16_t deg
[0...90 (lat) or 0...180 (lon)]
IRIG_SETTINGS settings
current settings
uint16_t flags
see MBG_IP4_FLAG_MASKS
int main(int argc, char *argv[])
MBG_CHK_SUPP_FNC mbg_chk_dev_has_lan_intf
Check if a device supports simple LAN interface API calls.
#define DEFAULT_ICODE_RX_NAMES
Initializers for RX timecode format name strings.
#define PTP_DELAY_MECH_NAMES
Name strings for the PTP delay mechanisms.
#define _pcps_has_gps_data(_d)
Satellite information for a particular GNSS type.
_MBG_API_ATTR int _MBG_API mbg_get_sync_time(MBG_DEV_HANDLE dh, PCPS_TIME *p)
Read the time when the device has last recently synchronized.
uint16_t good_svs
Num. of satellites that can currently be received and used.
#define _pcps_is_gnss(_d)
_MBG_API_ATTR int _MBG_API mbg_get_ptp_state(MBG_DEV_HANDLE dh, PTP_STATE *p)
Read PTP/IEEE1588 status from a device.
size_t snprint_nano_time(char *s, size_t max_len, const NANO_TIME *nt)
Print nano time into string buffer.
int16_t DNt
The day number at the end of which a leap second occurs.
const char * str_not_avail
int16_t MBG_REF_OFFS
A data type used to configure the ref offset.
#define _pcps_has_stat_info(_d)
uint16_t yday
day of year, 1..365/366
#define _pcps_has_irig_ctrl_bits(_d)
#define MSK_ICODE_RX_HAS_TZI
A mask of IRIG RX formats supporting time zone information.
static int check_irq_unsafe(MBG_DEV_HANDLE dh, const PCPS_DEV *p_dev)
#define PCPS_IRQ_STAT_ENABLED
static void show_raw_irig_data(MBG_DEV_HANDLE dh)
ALL_GNSS_SAT_INFO_IDX gnss_sat_info_idx
static void show_utc_info(MBG_DEV_HANDLE dh, const PCPS_DEV *p_dev)
uint8_t osc_type
type of installed oscillator, see GPS_OSC_TYPES
static void show_time_and_status(MBG_DEV_HANDLE dh, const PCPS_DEV *pdev, const char *tail)
MBG_CHK_SUPP_FNC mbg_chk_dev_has_raw_irig_data
Check if a device supports the mbg_get_raw_irig_data call.
int snprint_gmtime_error(char *s, size_t max_len, int mbg_errno, time_t t, const char *calling_fnc)
#define MBG_LAST_COPYRIGHT_YEAR
T_GPS t
time in GPS scale and format
_MBG_API_ATTR int _MBG_API mbg_get_irq_stat_info(MBG_DEV_HANDLE dh, PCPS_IRQ_STAT_INFO *p)
Read a device's IRQ status information.
int32_t offs_from_utc
local time offset from UTC [sec]
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 MBG_SUCCESS
Error codes used with Meinberg devices and drivers.
uint32_t PCPS_IRQ_STAT_INFO
#define PTP_PORT_STATE_STRS
Name strings for the PTP port states.
_MBG_API_ATTR int _MBG_API mbg_setup_receiver_info(MBG_DEV_HANDLE dh, const PCPS_DEV *p_dev, RECEIVER_INFO *p)
Set up a RECEIVER_INFO structure for a device.
static __mbg_inline int mbg_gmtime(struct tm *p_tm, const time_t *p_time)
uint8_t time_source
see PTP_TIME_SOURCES
A geographic position represented in different formats.
uint8_t domain_number
the PTP clock domain number, 0:3
_MBG_API_ATTR void _MBG_API mbg_free_device_name_list(MBG_DEV_NAME_LIST_ENTRY *list)
Free the memory allocated for a list of MBG_DEV_NAME_LIST_ENTRY entries.
A buffer used to read raw IRIG data bits from an IRIG receiver.
#define _pcps_has_fast_hr_timestamp(_d)
Action failed for specified device.
NANO_TIME mean_path_delay
uint8_t svs[32]
IDs of the satellites actually used for navigation, 0 == not used.
#define _pcps_has_signal(_d)
IP4_ADDR netmask
the network mask
#define _pcps_has_utc_parm(_d)
#define _pcps_tfom_from_raw_irig_data(_p)
Extract the TFOM code from MBG_RAW_IRIG_DATA.
int16_t utc_offset
UTC offset observed against TAI
int16_t delay_req_intv
log2 of the delay request interval [s]
XYZ xyz
Always WGS84 ECEF coordinates.
PTP_CFG_SETTINGS settings
the current configuration
uint16_t clock_offset_scaled_log_variance
#define PTP_CLOCK_ACCURACY_STRS
Name strings for PTP accuracy classes.
_MBG_API_ATTR int _MBG_API mbg_get_debug_status(MBG_DEV_HANDLE dh, MBG_DEBUG_STATUS *p)
Read a debug status word from a device.
uint16_t icode
IRIG signal code, see ICODE_RX_CODES and ICODE_TX_CODES.
High resolution time including status and local time offset.
number of defined delay mechanisms
int snprint_utc_offs(char *s, size_t max_len, const char *info, long utc_offs)
Print a UTC offset into a string.
int8_t delta_tls
Current UTC offset to GPS system time [sec].
static MBG_REF_OFFS ref_offs
number of defined port states
PCPS_SIG_VAL signal
signal strength, see PCPS_SIG_VAL_DEFS
Local calendar date and time, plus sync status.
DAC_VAL dac_val
Oscillator fine DAC value.
LLA lla
Longitude, latitude and altitude, depending on the ellipsoid used for reference.
A high resolution time stamp.
int16_t valid
Flag indicating UTC parameters are valid.
static void show_signal(MBG_DEV_HANDLE dh, const PCPS_DEV *pdev, int signal)
int mbg_chk_get_all_gnss_info(MBG_DEV_HANDLE dh, ALL_GNSS_INFO *p_agi)
Read or setup all GNSS status information.
#define _pcps_type_name(_d)
int snprintf_safe(char *s, size_t max_len, const char *fmt,...)
A portable, safe implementation of snprintf()
IP4_ADDR gateway
the default gateway
static void show_lan_intf_state(MBG_DEV_HANDLE dh)
uint32_t gnss_set
bit mask of currently used GNSS systems, see MBG_GNSS_TYPE_MASKS
uint32_t tick
fractions of a second, 1/RECEIVER_INFO::ticks_per_sec units
_MBG_API_ATTR int _MBG_API mbg_get_gps_time(MBG_DEV_HANDLE dh, TTM *p)
Read the current board time using a TTM structure.
the number of known codes
size_t snprint_ip4_addr(char *s, size_t max_len, const IP4_ADDR *p_addr, const char *info)
Print an IPv4 address to a dotted quad formatted string.
double sec
[0...59.99999...]
static void show_ext_stat_info(MBG_DEV_HANDLE dh, const PCPS_DEV *p_dev, const char *tail)
uint32_t MBG_IRIG_CTRL_BITS
Bit coded return type for PCPS_GET_IRIG_CTRL_BITS.
static void show_sync_time(MBG_DEV_HANDLE dh, const char *tail)
#define _pcps_is_irig_rx(_d)
#define PCPS_REF_NAMES_ENG
Initializer for an array of English reference type names.
#define PTP_TIME_SOURCE_TABLE
A table of PTP time source codes plus associated name strings.
_MBG_API_ATTR int _MBG_API mbg_get_ip4_state(MBG_DEV_HANDLE dh, IP4_SETTINGS *p)
Read LAN IPv4 state from a device.
size_t snprint_octets(char *s, size_t max_len, const uint8_t *octets, int num_octets, char sep, const char *info)
Print a MAC ID or similar array of octets to a string.
int pcps_str_tm_gps_date_time(char *s, size_t max_len, const TM_GPS *t)
NANO_TIME delay_asymmetry
_MBG_API_ATTR int _MBG_API mbg_get_ref_offs(MBG_DEV_HANDLE dh, MBG_REF_OFFS *p)
Read the UTC offset configuration of the reference time from a device.
_MBG_API_ATTR int _MBG_API mbg_get_irig_ctrl_bits(MBG_DEV_HANDLE dh, MBG_IRIG_CTRL_BITS *p)
Read the control function bits received from an incoming IRIG signal.
#define _pcps_ref_type(_d)
IP4_ADDR broad_addr
the broadcast address
CSUM csum
Checksum of the remaining bytes.
#define GNSS_TYPE_STRS
Name strings for the the known satellite navigation systems.
char dev_name[40]
Readable device name (Should be MBG_DEV_NAME, which is smaller, though)
A structure used to identify a device type and supported features.
uint16_t wn
the week number since the GPS system has been put into operation
uint8_t clock_accuracy
see PTP_CLOCK_ACCURACIES
static MBG_DEV_HANDLER_FNC do_mbgstatus
uint16_t nw_prot
one of the enumerated protocols, see PTP_NW_PROTS
uint32_t MBG_DEBUG_STATUS
A data type used to read the board's debug status.
_MBG_API_ATTR int _MBG_API mbg_find_devices_with_names(MBG_DEV_NAME_LIST_ENTRY **p_list, int max_devices)
Allocate memory and set up a list of installed and supported devices.
Simple LAN interface information.
static void show_ptp_state(MBG_DEV_HANDLE dh)
static const char * pname
#define _pcps_has_stat_info_mode(_d)
PCPS_TIME_STATUS status
status bits, see PCPS_TIME_STATUS_FLAGS_COMMON
uint8_t delay_mech
see PTP_DELAY_MECHS
see PCPS_TZ_NAME_FORCE_UTC_OFFS
static void show_invt_reason(void)
static const char * wdays[7]
static char * str_raw_irig_utc_offs_hours(char *s, size_t max_len, const MBG_RAW_IRIG_DATA *p)