mbgtools-lx
4.2.8
|
#include <mbgdevio.h>
#include <mbgutil.h>
#include <mbgtime.h>
#include <pcpslstr.h>
#include <toolutil.h>
#include <lan_util.h>
#include <deviohlp.h>
#include <timeutil.h>
#include <str_util.h>
#include <nanotime.h>
#include <stdio.h>
#include <stdlib.h>
Go to the source code of this file.
Macros | |
#define | MBG_FIRST_COPYRIGHT_YEAR 2001 |
#define | MBG_LAST_COPYRIGHT_YEAR 0 |
Functions | |
static void | show_invt_reason (void) |
static void | print_pcps_time (const char *s, const PCPS_TIME *tp, const char *tail) |
static void | print_dms (const char *s, const DMS *p, const char *tail) |
static void | print_position (const char *s, const POS *p, const char *tail) |
static void | show_signal (MBG_DEV_HANDLE dh, const PCPS_DEV *pdev, int signal) |
static void | show_time_and_status (MBG_DEV_HANDLE dh, const PCPS_DEV *pdev, const char *tail) |
static void | show_sync_time (MBG_DEV_HANDLE dh, const char *tail) |
static void | show_ext_stat_info (MBG_DEV_HANDLE dh, const PCPS_DEV *p_dev, const char *tail) |
static void | show_gps_pos (MBG_DEV_HANDLE dh, const char *tail) |
static void | show_utc_info (MBG_DEV_HANDLE dh, const PCPS_DEV *p_dev) |
static void | show_irig_ctrl_bits (MBG_DEV_HANDLE dh) |
static char * | str_raw_irig_utc_offs_hours (char *s, size_t max_len, const MBG_RAW_IRIG_DATA *p) |
static void | show_raw_irig_data (MBG_DEV_HANDLE dh) |
static void | show_irig_debug_status (MBG_DEV_HANDLE dh) |
static void | show_lan_intf_state (MBG_DEV_HANDLE dh) |
static void | show_ptp_state (MBG_DEV_HANDLE dh) |
static int | check_irq_unsafe (MBG_DEV_HANDLE dh, const PCPS_DEV *p_dev) |
static int | do_mbgstatus (MBG_DEV_HANDLE dh, const PCPS_DEV *p_dev) |
static void | usage (void) |
int | main (int argc, char *argv[]) |
Variables | |
static const char * | pname = "mbgstatus" |
static int | loops |
static int | list_only |
static int | list_only_unique_names |
static long | sleep_secs |
static long | sleep_usecs |
static unsigned int | verbose |
static const char * | ref_name [N_PCPS_REF] = PCPS_REF_NAMES_ENG |
static const char * | icode_rx_names [N_ICODE_RX] = DEFAULT_ICODE_RX_NAMES |
static const char * | osc_name [N_GPS_OSC] = DEFAULT_GPS_OSC_NAMES |
static int | year_limit = 1990 |
static int | max_ref_offs_h = MBG_REF_OFFS_MAX / MINS_PER_HOUR |
static int | invt_reason |
static const char * | wdays [7] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" } |
LANGUAGE | language |
CTRY | ctry |
static MBG_DEV_HANDLER_FNC | do_mbgstatus |
#define MBG_FIRST_COPYRIGHT_YEAR 2001 |
Definition at line 101 of file mbgstatus.c.
Referenced by main().
#define MBG_LAST_COPYRIGHT_YEAR 0 |
Definition at line 102 of file mbgstatus.c.
Referenced by main().
|
static |
Definition at line 1039 of file mbgstatus.c.
References _pcps_sernum, _pcps_type_name, mbg_cond_err_msg(), mbg_get_irq_stat_info(), PCPS_IRQ_STAT_ENABLED, and PCPS_IRQ_STAT_UNSAFE.
Referenced by do_mbgstatus().
|
static |
Definition at line 1091 of file mbgstatus.c.
References _pcps_has_gps_data, _pcps_has_irig_ctrl_bits, _pcps_has_ptp, _pcps_has_utc_parm, _pcps_is_gps, _pcps_is_irig_rx, check_irq_unsafe(), list_only, loops, mbg_chk_dev_has_lan_intf, mbg_chk_dev_has_raw_irig_data, MBG_SUCCESS, show_ext_stat_info(), show_gps_pos(), show_invt_reason(), show_irig_ctrl_bits(), show_irig_debug_status(), show_lan_intf_state(), show_ptp_state(), show_raw_irig_data(), show_sync_time(), show_time_and_status(), show_utc_info(), sleep_secs, sleep_usecs, and verbose.
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 1181 of file mbgstatus.c.
References CHK_DEV_ALL_DEVICES, ctry_setup(), _MBG_DEV_NAME_LIST_ENTRY::dev_name, do_mbgstatus, CTRY::dt_fmt, DT_FMT_YYYYMMDD, CTRY::dt_sep, language, list_only, list_only_unique_names, LNG_ENGLISH, loops, MBG_EXIT_CODE_FAIL, MBG_EXIT_CODE_SUCCESS, MBG_EXIT_CODE_USAGE, mbg_find_devices_with_names(), MBG_FIRST_COPYRIGHT_YEAR, mbg_free_device_name_list(), mbg_handle_devices(), MBG_LAST_COPYRIGHT_YEAR, mbg_print_program_info(), mbg_rc_is_success, must_print_usage, N_SUPP_DEV_BUS, _MBG_DEV_NAME_LIST_ENTRY::next, pcps_date_time_dist, pname, sleep_secs, sleep_usecs, usage(), and verbose.
|
static |
Definition at line 176 of file mbgstatus.c.
References DMS::deg, DMS::min, DMS::prefix, and DMS::sec.
Referenced by print_position().
|
static |
Definition at line 154 of file mbgstatus.c.
References _pcps_time_is_read, pcps_date_time_str(), pcps_tz_name(), PCPS_TZ_NAME_FORCE_UTC_OFFS, PCPS_TIME::status, verbose, and year_limit.
Referenced by show_sync_time(), and show_time_and_status().
|
static |
Definition at line 196 of file mbgstatus.c.
References ALT, LAT, POS::latitude, POS::lla, LON, POS::longitude, PI, print_dms(), r2d, verbose, XP, POS::xyz, YP, and ZP.
Referenced by show_gps_pos().
|
static |
Definition at line 456 of file mbgstatus.c.
References _pcps_has_stat_info, _pcps_has_stat_info_mode, _pcps_has_stat_info_svs, _pcps_is_gnss, AUTO_166, COLD_166, STAT_INFO::dac_cal, STAT_INFO::dac_val, RECEIVER_INFO::epld_name, RECEIVER_INFO::features, ALL_GNSS_INFO::gnss_mode_info, ALL_GNSS_INFO::gnss_sat_info_idx, MBG_GNSS_MODE_SETTINGS::gnss_set, GNSS_SAT_INFO::gnss_type, GNSS_TYPE_STRS, GNSS_SAT_INFO::good_svs, GPS_OSC_UNKNOWN, MAX_USED_SATS, mbg_chk_dev_is_gps, mbg_chk_get_all_gnss_info(), mbg_cond_err_msg(), mbg_rc_is_success, mbg_setup_receiver_info(), mbg_snprintf(), STAT_INFO::mode, ALL_GNSS_INFO::n_gnss_supp, N_GNSS_TYPES, N_GPS_OSC, OSC_DAC_BIAS, osc_name, RECEIVER_INFO::osc_type, MBG_GNSS_MODE_INFO::settings, snprintf_safe(), ALL_GNSS_INFO::stat_info, str_unknown, GNSS_SAT_INFO::svs, GNSS_SAT_INFO::svs_in_view, verbose, and WARM_166.
Referenced by do_mbgstatus().
|
static |
Definition at line 596 of file mbgstatus.c.
References mbg_cond_err_msg(), mbg_get_gps_pos(), and print_position().
Referenced by do_mbgstatus().
|
static |
Definition at line 131 of file mbgstatus.c.
References DEFAULT_STR_IRIG_INVT_EN, DEFAULT_STR_IRIG_NOT_CFGD_EN, and invt_reason.
Referenced by do_mbgstatus().
|
static |
Definition at line 695 of file mbgstatus.c.
References _pcps_tfom_from_irig_ctrl_bits, mbg_cond_err_msg(), and mbg_get_irig_ctrl_bits().
Referenced by do_mbgstatus().
|
static |
Definition at line 759 of file mbgstatus.c.
References mbg_cond_err_msg(), MBG_DEBUG_STATUS_STRS, mbg_get_debug_status(), and N_MBG_DEBUG_BIT.
Referenced by do_mbgstatus().
|
static |
Definition at line 781 of file mbgstatus.c.
References IP4_SETTINGS::broad_addr, IP4_SETTINGS::flags, IP4_SETTINGS::gateway, IP4_MSK_DHCP, IP4_MSK_LINK, IP4_SETTINGS::ip_addr, LAN_IF_INFO::mac_addr, mbg_cond_err_msg(), mbg_get_ip4_state(), mbg_get_lan_if_info(), IP4_SETTINGS::netmask, snprint_ip4_addr(), and snprint_mac_addr().
Referenced by do_mbgstatus().
|
static |
Definition at line 823 of file mbgstatus.c.
References PTP_CLOCK_ID::b, PTP_STATE::clock_accuracy, PTP_STATE::clock_class, PTP_STATE::clock_offset_scaled_log_variance, PTP_STATE::delay_asymmetry, PTP_STATE::delay_mech, PTP_CFG_SETTINGS::delay_mech, PTP_CFG_SETTINGS::delay_req_intv, PTP_STATE::domain_number, PTP_CFG_SETTINGS::domain_number, PTP_STATE::flags, PTP_STATE::gm_id, PTP_STATE::log_delay_req_intv, MAC_SEP_CHAR_ALT, mbg_cond_err_msg(), mbg_get_ptp_cfg_info(), mbg_get_ptp_state(), PTP_STATE::mean_path_delay, N_PTP_CLOCK_ACCURACY, N_PTP_DELAY_MECH, N_PTP_NW_PROT, N_PTP_PORT_STATE, N_PTP_ROLES, PTP_TABLE::name, PTP_STATE::nw_prot, PTP_CFG_SETTINGS::nw_prot, PTP_STATE::offset, PTP_STATE::path_delay, PTP_STATE::port_state, PTP_CLOCK_ACCURACY_NUM_BIAS, ptp_clock_accuracy_strs, PTP_CLOCK_ACCURACY_STRS, PTP_DELAY_MECH_NAMES, PTP_FLAG_MSK_IS_UNICAST, PTP_FLAG_MSK_LS_ANN, PTP_FLAG_MSK_LS_ANN_NEG, PTP_FLAG_MSK_ONE_STEP, PTP_FLAG_MSK_TIMESCALE_IS_PTP, PTP_FLAG_MSK_UTC_VALID, PTP_NW_PROT_STRS, PTP_PORT_STATE_MASTER, PTP_PORT_STATE_PASSIVE, PTP_PORT_STATE_PRE_MASTER, PTP_PORT_STATE_SLAVE, PTP_PORT_STATE_STRS, PTP_PORT_STATE_UNCALIBRATED, PTP_STATE::ptp_prot_version, PTP_CFG_SETTINGS::ptp_role, PTP_ROLE_MSK_MASTERS, PTP_ROLE_MSK_SLAVES, ptp_role_strs, PTP_ROLE_STRS, PTP_TIME_SOURCE_TABLE, PTP_CFG_INFO::settings, snprint_nano_time(), snprint_octets(), str_not_avail, str_undefined, str_unknown, PTP_STATE::time_source, PTP_STATE::utc_offset, PTP_TABLE::value, and verbose.
Referenced by do_mbgstatus().
|
static |
Definition at line 733 of file mbgstatus.c.
References _pcps_tfom_from_raw_irig_data, MBG_RAW_IRIG_DATA::data_bytes, mbg_cond_err_msg(), mbg_get_raw_irig_data(), and str_raw_irig_utc_offs_hours().
Referenced by do_mbgstatus().
|
static |
Definition at line 237 of file mbgstatus.c.
References _pcps_has_pzf, _pcps_has_ref_offs, _pcps_is_irig_rx, _pcps_ref_type, IRIG_SETTINGS::icode, icode_rx_names, irig_rx_info, max_ref_offs_h, mbg_get_irig_rx_info(), mbg_get_ref_offs(), MBG_SUCCESS, MINS_PER_HOUR, MSK_ICODE_RX_HAS_TZI, N_ICODE_RX, N_PCPS_REF, PCPS_REF_NONE, PCPS_SIG_MAX, ref_name, ref_offs, and IRIG_INFO::settings.
Referenced by show_time_and_status().
|
static |
Definition at line 441 of file mbgstatus.c.
References mbg_cond_err_msg(), mbg_get_sync_time(), and print_pcps_time().
Referenced by do_mbgstatus().
|
static |
Definition at line 295 of file mbgstatus.c.
References _pcps_has_fast_hr_timestamp, _pcps_has_hr_time, _pcps_has_irig_time, _pcps_has_pzf, _pcps_has_signal, _pcps_is_gps, _pcps_is_irig_rx, _pcps_is_lwr, _pcps_ref_offs_out_of_range, _pcps_time_is_read, PCPS_STATUS_STR::cp, PCPS_IRIG_TIME::hour, invt_reason, PCPS_STATUS_STR::is_err, mbg_cond_err_msg(), mbg_get_fast_hr_timestamp(), mbg_get_gps_time(), mbg_get_hr_time(), mbg_get_irig_time(), mbg_get_ref_offs(), mbg_get_time(), mbg_show_pzf_corr_info(), mbg_snprint_hr_time(), mbg_snprint_hr_tstamp(), PCPS_IRIG_TIME::min, N_PCPS_STATUS_STR, TM_GPS::offs_from_utc, PCPS_INVT, PCPS_SIG_BIAS, PCPS_SIG_ERR, PCPS_SIG_MAX, pcps_status_strs(), pcps_str_tm_gps_date_time(), print_pcps_time(), ref_offs, PCPS_STATUS_STRS::s, PCPS_IRIG_TIME::sec, T_GPS::sec, show_signal(), PCPS_TIME::signal, snprint_utc_offs(), PCPS_HR_TIME::status, PCPS_TIME::status, TM_GPS::status, TTM::t, T_GPS::tick, TTM::tm, verbose, T_GPS::wn, and PCPS_IRIG_TIME::yday.
Referenced by do_mbgstatus().
|
static |
Definition at line 611 of file mbgstatus.c.
References UTC::A0, UTC::A1, UTC::csum, cvt_to_time_t(), UTC::delta_tls, UTC::delta_tlsf, UTC::DNt, GPS_SEC_BIAS, mbg_cond_err_msg(), mbg_get_utc_parm(), mbg_gmtime(), mbg_rc_is_success, mbg_snprintf(), T_GPS::sec, SECS_PER_DAY, SECS_PER_WEEK, snprint_gmtime_error(), UTC::t0t, T_GPS::tick, UTC::valid, verbose, wdays, T_GPS::wn, and UTC::WNlsf.
Referenced by do_mbgstatus().
|
static |
Definition at line 713 of file mbgstatus.c.
References MBG_RAW_IRIG_DATA::data_bytes, and mbg_snprintf().
Referenced by show_raw_irig_data().
|
static |
Definition at line 1160 of file mbgstatus.c.
References mbg_print_device_options(), mbg_print_help_options(), mbg_print_opt_info(), mbg_print_usage_intro(), and pname.
Referenced by main().
CTRY ctry |
Definition at line 126 of file mbgstatus.c.
Referenced by ctry_next(), and ctry_setup().
|
static |
Definition at line 1155 of file mbgstatus.c.
Referenced by main().
|
static |
Definition at line 115 of file mbgstatus.c.
Referenced by show_signal().
|
static |
Definition at line 121 of file mbgstatus.c.
Referenced by show_invt_reason(), and show_time_and_status().
LANGUAGE language |
Definition at line 125 of file mbgstatus.c.
Referenced by ctry_setup(), main(), pcps_date_time_str(), pcps_str_tm_gps_date_time(), and pcps_tzcode_str().
|
static |
Definition at line 108 of file mbgstatus.c.
Referenced by do_mbgstatus(), and main().
|
static |
Definition at line 109 of file mbgstatus.c.
Referenced by main().
|
static |
Definition at line 107 of file mbgstatus.c.
Referenced by do_mbgstatus(), and main().
|
static |
Definition at line 120 of file mbgstatus.c.
Referenced by show_signal().
|
static |
Definition at line 116 of file mbgstatus.c.
Referenced by show_ext_stat_info().
|
static |
Definition at line 104 of file mbgstatus.c.
|
static |
Definition at line 114 of file mbgstatus.c.
Referenced by show_signal().
|
static |
Definition at line 110 of file mbgstatus.c.
Referenced by do_mbgstatus(), and main().
|
static |
Definition at line 111 of file mbgstatus.c.
Referenced by do_mbgstatus(), and main().
|
static |
Definition at line 112 of file mbgstatus.c.
Referenced by do_mbgstatus(), main(), print_pcps_time(), print_position(), show_ext_stat_info(), show_ptp_state(), show_time_and_status(), and show_utc_info().
|
static |
Definition at line 123 of file mbgstatus.c.
Referenced by show_utc_info().
|
static |
Definition at line 118 of file mbgstatus.c.
Referenced by pcps_str_tm_gps_date_time(), and print_pcps_time().