mbgtools-lx
4.2.8
|
#include <mbgdevio.h>
#include <deviohlp.h>
#include <pcpsmktm.h>
#include <pcpsutil.h>
#include <cfg_hlp.h>
#include <myutil.h>
#include <gpsutils.h>
#include <cnv_wday.h>
#include <toolutil.h>
#include <ptp_util.h>
#include <lan_util.h>
#include <str_util.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <ctype.h>
Go to the source code of this file.
Data Structures | |
struct | OPT_HANDLER_SPEC_S |
struct | INDENTS |
struct | EF_INFO |
struct | IP4_INFO |
Macros | |
#define | MBG_FIRST_COPYRIGHT_YEAR 2001 |
#define | MBG_LAST_COPYRIGHT_YEAR 0 |
#define | RC_USAGE 1 |
#define | _get_time_scale_name(_i) ( ( (_i) < N_MBG_TIME_SCALE ) ? time_scale_names[_i] : str_unknown ) |
#define | _get_pout_mode_name(_i) ( ( (_i) < N_POUT_MODES ) ? pout_mode_names_eng[_i] : str_unknown ) |
#define | SHOW_INDENT_1 " " |
#define | SHOW_INDENT_2 " " |
#define | N_EF_INFO 3 |
#define | N_IP4_INFO 4 |
#define | _ptp_role_name(_i) ( ( (_i) < N_PTP_ROLES ) ? ptp_roles[_i] : str_unknown ) |
#define | _ptp_role_name_short(_i) ( ( (_i) < N_PTP_ROLES ) ? ptp_roles_short[_i] : str_unknown ) |
Typedefs | |
typedef int | CTRL_FLAGS |
A type used to pass print control flags to functions. More... | |
typedef int | HELP_FNC(MBG_DEV_HANDLE, const PCPS_DEV *, const struct OPT_HANDLER_SPEC_S *, CTRL_FLAGS) |
typedef int | SET_FNC(MBG_DEV_HANDLE, const char *, int) |
typedef int | SHOW_FNC(MBG_DEV_HANDLE, const struct OPT_HANDLER_SPEC_S *, const PCPS_DEV *, const char *) |
typedef struct OPT_HANDLER_SPEC_S | OPT_HANDLER_SPEC |
typedef const char *() | STR_FNC(int idx) |
Enumerations | |
enum | CTRL_FLAG_MASKS { CTRL_PRINT_ALL = 0x01, CTRL_PRINT_NEWLINES = 0x02, CTRL_PRINT_IDX = 0x04, CTRL_PRINT_ERR = 0x08, CTRL_PRINT_PLUS = 0x10, CTRL_NOT_SUPP = 0x20 } |
flag masks used with CTRL_FLAGS More... | |
enum | OPT_FLAG_BITS { OPT_SUPP_CMD_IDX_BIT, N_OPT_FLAG_BITS } |
enum | OPT_FLAG_MASKS { OPT_SUPP_CMD_IDX = ( 1UL << OPT_SUPP_CMD_IDX_BIT ) } |
Functions | |
static int | usage_line (const INDENTS *p_ind, const OPT_HANDLER_SPEC *p_opt, const char *cmd_parm, const char *cmd_comment_fmt,...) |
static int | print_indent (int i) |
static int | usage_note (int indent, const char *fmt,...) |
static void | print_bit_mask_list (const char *info_1, const char *info_2, uint32_t supp_mask, int n_known, const char *const names[], STR_FNC *s_fnc, int inst_idx, CTRL_FLAGS ctrl_flags, const INDENTS *p_ind) |
static void | err_msg (const PCPS_DEV *p_dev, const char *msg) |
static int | set_tz_code (MBG_DEV_HANDLE dh, PCPS_TZCODE tzcode, const char *s) |
static int | set_gps_tzdl (MBG_DEV_HANDLE dh, const TZDL *tzdl, const char *info) |
static int | set_timezone (MBG_DEV_HANDLE dh, const char *tz_name, const PCPS_DEV *p_dev) |
static int | show_tzdl_offs (MBG_DEV_HANDLE dh, const char *info) |
static int | set_tzdl_offs (MBG_DEV_HANDLE dh, const char *s) |
static int | show_synth (MBG_DEV_HANDLE dh, const char *info) |
static int | set_synth (MBG_DEV_HANDLE dh, const char *s) |
static int | show_lan_intf (MBG_DEV_HANDLE dh, const PCPS_DEV *p_dev, const char *info) |
static const char * | intv_str (int i) |
static int | show_ptp_cfg (MBG_DEV_HANDLE dh, const PCPS_DEV *p_dev, const char *info) |
static int | get_chk_str_table_idx (const char *s, const char *tbl[], int n_entries, uint32_t supp_mask, const char *info) |
Lookup a string in a string table and return the table index. More... | |
static int | chk_parm_name (const char *arg, const char *id, char **p) |
Lookup a parameter in an argument list and check if a colon is appended. More... | |
static int | chk_tbl_parm (const char *arg, const char *id, const char *tbl[], int n_entries, uint32_t supp_mask, const char *info) |
Lookup a parameter in an argument list and check if the value string is valid. More... | |
static int | chk_int16_parm (const char *arg, const char *id, int16_t *p, int16_t range_min, int16_t range_max, int is_supported, const char *info) |
Lookup an int16_t parameter in an argument list. More... | |
static int | set_ptp_cfg (MBG_DEV_HANDLE dh, const char *arg, const PCPS_DEV *p_dev) |
static int | ip4_check_parm (const char *s, IP4_INFO *p) |
static int | set_lan_intf (MBG_DEV_HANDLE dh, const char *arg, const PCPS_DEV *p_dev) |
static int | set_gps_pos (MBG_DEV_HANDLE dh, const char *gp) |
static int | set_date_time (MBG_DEV_HANDLE dh, const PCPS_DEV *p_dev, const char *sdate, const char *stime) |
static int | check_setup_receiver_info (MBG_DEV_HANDLE dh, RECEIVER_INFO *p_ri) |
static int | check_get_receiver_port_cfg (MBG_DEV_HANDLE dh, RECEIVER_PORT_CFG *p_rpcfg, const PCPS_DEV *p_dev, RECEIVER_INFO *p_ri) |
static int | snprint_port_cfg (char *s, int sz, unsigned int port_num, const RECEIVER_PORT_CFG *p_rpcfg) |
static void | show_serial_settings (MBG_DEV_HANDLE dh, const RECEIVER_PORT_CFG *p_rpcfg, const RECEIVER_INFO *p_ri) |
static void | print_port_info_errors (const char *port_name, unsigned int port_num, int flags, const RECEIVER_PORT_CFG *p_rpcfg) |
static int | save_serial_settings (MBG_DEV_HANDLE dh, unsigned int port_num, const char *parm_str, const PCPS_DEV *p_dev, const RECEIVER_INFO *p_ri) |
static int | check_get_pout_cfg (MBG_DEV_HANDLE dh, ALL_POUT_INFO_IDX api, RECEIVER_INFO *p_ri) |
static int | help_pout_arg (MBG_DEV_HANDLE dh, const PCPS_DEV *p_dev, const OPT_HANDLER_SPEC *p_opt, CTRL_FLAGS ctrl_flags) |
static int | eval_pout (MBG_DEV_HANDLE dh, const char *s, int inst_num) |
static int | show_pout (MBG_DEV_HANDLE dh, const OPT_HANDLER_SPEC *p_opt, const PCPS_DEV *p_devx, const char *cmd_info) |
static void | printf_ef (uint16_t flag, const char *info) |
static int | show_enable_flags (MBG_DEV_HANDLE dh, const PCPS_DEV *p_dev, const char *info) |
static int | ef_check_parm (const char *s, EF_INFO *p) |
static int | set_enable_flags (MBG_DEV_HANDLE dh, const char *arg, const PCPS_DEV *p_dev) |
static int | send_gps_cmd (MBG_DEV_HANDLE dh, ushort cmd) |
static int | show_ant_cable_len (MBG_DEV_HANDLE dh, const char *info) |
static int | set_ant_cable_len (MBG_DEV_HANDLE dh, const char *s) |
static int | set_event_time (MBG_DEV_HANDLE dh, const char *s) |
static int | get_n_time_scale (MBG_DEV_HANDLE dh, MBG_TIME_SCALE_INFO *p_tsci) |
static int | show_time_scale (MBG_DEV_HANDLE dh, const PCPS_DEV *p_dev, const char *info) |
static int | set_time_scale (MBG_DEV_HANDLE dh, const char *arg, const PCPS_DEV *p_dev) |
static void | usage (MBG_DEV_HANDLE dh, PCPS_DEV *p_dev, RECEIVER_INFO *p_ri, RECEIVER_PORT_CFG *p_rpcfg) |
static const char * | str_parm_p (const char *s, const char *keyword) |
static int | check_cmd_line (int argc, char *argv[], MBG_DEV_HANDLE dh, const PCPS_DEV *p_dev, RECEIVER_INFO *p_ri, RECEIVER_PORT_CFG *p_rpcfg) |
int | main (int argc, char *argv[]) |
Variables | |
static const char * | pname = "mbgctrl" |
static char * | dev_name |
static int | err_unicast_nsupp |
static const char | str_spc_not [] = " not" |
static const char | str_spc_not_supp [] = " (not supported)" |
static const char | str_spc_wildcard [] = " (wildcard)" |
static TZDL | tzdl_utc = DEFAULT_TZDL_UTC |
static TZDL | tzdl_cet_cest = DEFAULT_TZDL_CET_CEST_EN |
static TZDL | tzdl_eet_eest = DEFAULT_TZDL_EET_EEST_EN |
static long | max_tzdl_offs = 0x7FFFFFFFL |
static const char | tz_info_utc [] = TZ_INFO_UTC |
static const char | tz_info_cet_cest [] = TZ_INFO_CET_CEST_EN |
static const char | tz_info_eet_eest [] = TZ_INFO_EET_EEST_EN |
static const char * | mode_names [N_STR_MODE] = DEFAULT_ENG_MODE_NAMES |
static const char * | time_scale_names [N_MBG_TIME_SCALE] = MBG_TIME_SCALE_STRS |
static const char *const | pout_mode_names_eng [N_POUT_MODES] = DEFAULT_ENG_POUT_NAMES |
static const char | no_gps_cmd [] = "does not support GPS commands" |
static const char | no_tzdl [] = "does not support configurable time zone" |
static const char | no_tz [] = "does not support time zones" |
static const char | no_synth [] = "has no synthesizer output" |
static const char | no_event_time [] = "does not support event times" |
static const char | no_enable_flags [] = "does not support enable flags" |
static const char | no_time_scale [] = "does not support a configurable time scale" |
static const char | no_lan_intf [] = "has no LAN interface" |
static const char | no_ptp [] = "does not provide PTP" |
static const char | no_cab_len [] = "does not support antenna signal delay compensation" |
OPT_HANDLER_SPEC | ohs_pout |
const INDENTS | usage_indents = { 2, 4, 6, 30 } |
const INDENTS | usage_indents_detailed = { 4, 6, 8, 30 } |
const INDENTS | show_indents = { 2, 4, 0, 0 } |
static const char | ef_name_serial [] = "SERIAL" |
static const char | ef_name_pulses [] = "PULSES" |
static const char | ef_name_synth [] = "SYNTH" |
static const char | ip4_name_ip [] = "IP" |
static const char | ip4_name_nm [] = "NM" |
static const char | ip4_name_ba [] = "BA" |
static const char | ip4_name_gw [] = "GW" |
static const char | ptp_name_net [] = "NP" |
static const char | ptp_name_del [] = "DM" |
static const char | ptp_name_dom [] = "DO" |
static const char | ptp_name_v1 [] = "HW" |
static const char | ptp_name_role [] = "ROLE" |
static const char | ptp_name_gmip [] = "GMIP" |
static const char | ptp_name_gmid [] = "GMID" |
static const char | ptp_name_pid [] = "PID" |
static const char | ptp_name_smi [] = "SMI" |
static const char | ptp_name_ami [] = "AMI" |
static const char | ptp_name_dri [] = "DRI" |
static const char | ptp_name_dur [] = "DUR" |
static const char * | delay_mech [] = PTP_DELAY_MECH_NAMES |
static const char * | nw_prot [] = PTP_NW_PROT_STRS |
static const char * | nw_prot_short [] = PTP_NW_PROT_STRS_SHORT |
static const char * | ptp_roles [] = PTP_ROLE_STRS |
static const char * | ptp_roles_short [] = PTP_ROLE_STRS_SHORT |
static const PTP_CLOCK_ID | clock_id_wildcard = PTP_CLOCK_ID_WILDCARD |
static const char | pout_name_mode [] = "MODE" |
static const char | pout_name_len [] = "LEN" |
static const char | pout_name_inv [] = "INV" |
static const char | pout_name_ois [] = "OIS" |
static const char | pout_name_shift [] = "SHIFT" |
#define _get_pout_mode_name | ( | _i | ) | ( ( (_i) < N_POUT_MODES ) ? pout_mode_names_eng[_i] : str_unknown ) |
Definition at line 157 of file mbgctrl.c.
Referenced by eval_pout(), and show_pout().
#define _get_time_scale_name | ( | _i | ) | ( ( (_i) < N_MBG_TIME_SCALE ) ? time_scale_names[_i] : str_unknown ) |
Definition at line 152 of file mbgctrl.c.
Referenced by show_time_scale(), and usage().
#define _ptp_role_name | ( | _i | ) | ( ( (_i) < N_PTP_ROLES ) ? ptp_roles[_i] : str_unknown ) |
Definition at line 316 of file mbgctrl.c.
Referenced by show_ptp_cfg().
#define _ptp_role_name_short | ( | _i | ) | ( ( (_i) < N_PTP_ROLES ) ? ptp_roles_short[_i] : str_unknown ) |
Definition at line 319 of file mbgctrl.c.
Referenced by show_ptp_cfg().
#define MBG_FIRST_COPYRIGHT_YEAR 2001 |
#define N_EF_INFO 3 |
Definition at line 268 of file mbgctrl.c.
Referenced by set_enable_flags().
#define N_IP4_INFO 4 |
Definition at line 281 of file mbgctrl.c.
Referenced by set_lan_intf().
#define RC_USAGE 1 |
Definition at line 127 of file mbgctrl.c.
Referenced by check_cmd_line(), and set_timezone().
typedef int CTRL_FLAGS |
A type used to pass print control flags to functions.
typedef int HELP_FNC(MBG_DEV_HANDLE, const PCPS_DEV *, const struct OPT_HANDLER_SPEC_S *, CTRL_FLAGS) |
typedef struct OPT_HANDLER_SPEC_S OPT_HANDLER_SPEC |
typedef int SET_FNC(MBG_DEV_HANDLE, const char *, int) |
typedef int SHOW_FNC(MBG_DEV_HANDLE, const struct OPT_HANDLER_SPEC_S *, const PCPS_DEV *, const char *) |
enum CTRL_FLAG_MASKS |
flag masks used with CTRL_FLAGS
Enumerator | |
---|---|
CTRL_PRINT_ALL | |
CTRL_PRINT_NEWLINES | |
CTRL_PRINT_IDX | |
CTRL_PRINT_ERR | |
CTRL_PRINT_PLUS | |
CTRL_NOT_SUPP |
enum OPT_FLAG_BITS |
enum OPT_FLAG_MASKS |
|
static |
Definition at line 2890 of file mbgctrl.c.
References _pcps_has_cab_len, _pcps_has_event_time, _pcps_has_gps_data, _pcps_has_lan_intf, _pcps_has_ptp, _pcps_has_synth, _pcps_has_time_scale, _pcps_has_tzdl, _pcps_is_gps, check_get_receiver_port_cfg(), check_setup_receiver_info(), dev_name, err_msg(), eval_pout(), MBG_ERR_GENERIC, MBG_ERR_PARM_FMT, mbg_rc_is_error, MBG_SUCCESS, must_print_usage, RECEIVER_INFO::n_com_ports, RECEIVER_INFO::n_prg_out, no_cab_len, no_enable_flags, no_event_time, no_gps_cmd, no_lan_intf, no_ptp, no_synth, no_time_scale, no_tzdl, PC_GPS_CMD_BOOT, PC_GPS_CMD_INIT_SYS, RC_USAGE, save_serial_settings(), send_gps_cmd(), set_ant_cable_len(), set_date_time(), set_enable_flags(), set_event_time(), set_gps_pos(), set_lan_intf(), set_ptp_cfg(), set_synth(), set_time_scale(), set_timezone(), set_tzdl_offs(), show_ant_cable_len(), show_enable_flags(), show_lan_intf(), show_pout(), show_ptp_cfg(), show_serial_settings(), show_synth(), show_time_scale(), show_tzdl_offs(), and str_parm_p().
Referenced by main().
|
static |
Definition at line 1916 of file mbgctrl.c.
References check_setup_receiver_info(), mbg_cond_err_msg(), mbg_get_gps_all_pout_info(), mbg_rc_is_success, and RECEIVER_INFO::n_prg_out.
Referenced by eval_pout(), help_pout_arg(), and show_pout().
|
static |
Definition at line 1688 of file mbgctrl.c.
References check_setup_receiver_info(), mbg_cond_err_msg(), mbg_get_serial_settings(), mbg_rc_is_error, mbg_rc_is_success, RECEIVER_INFO::n_com_ports, and RECEIVER_PORT_CFG::pii.
Referenced by check_cmd_line(), and usage().
|
static |
Definition at line 1667 of file mbgctrl.c.
References mbg_cond_err_msg(), mbg_setup_receiver_info(), MBG_SUCCESS, RECEIVER_INFO::model_code, and RECEIVER_INFO::ticks_per_sec.
Referenced by check_cmd_line(), check_get_pout_cfg(), and check_get_receiver_port_cfg().
|
static |
Lookup an int16_t parameter in an argument list.
Check and save the numeric parameter if in a valid range.
arg | An argument list of the form: "name:val,name:val,..." |
id | The name of the argument to be checked. |
p | A pointer to a variable where the parameter value is saved if valid |
range_min | The minimum allowed value for the parameter |
range_max | The maximum allowed value for the parameter |
is_supported | A flag indicating if the parameter is actually supported |
info | A descriptive name of the parameter |
Definition at line 969 of file mbgctrl.c.
References chk_parm_name(), err_unicast_nsupp, MBG_ERR_RANGE, and mbg_rc_is_error.
Referenced by set_ptp_cfg().
|
static |
Lookup a parameter in an argument list and check if a colon is appended.
arg | An argument list of the form: "name:val,name:val,..." |
id | A parameter name searched for in the argument list |
p | A pointer to a (char *) which is set to the beginning of the value part of a parameter string |
*p
is set to the parameter value, else to NULL. MBG_ERR_PARM_FMT if syntax error, i.e. missing colon. Definition at line 884 of file mbgctrl.c.
References MBG_ERR_PARM_FMT, and MBG_SUCCESS.
Referenced by chk_int16_parm(), chk_tbl_parm(), eval_pout(), and set_ptp_cfg().
|
static |
Lookup a parameter in an argument list and check if the value string is valid.
This function expects that the parameter value is a known string which can be found in a table of known strings. A bit mask indicates if a string with a given table index is supported, or not.
arg | An argument list of the form: "name:val,name:val,..." |
id | The name of the argument to be checked. |
tbl | A table of strings with predefined parameter values |
n_entries | The number of strings in the string table |
supp_mask | A string with a given index is only supported if the corresponding bit is set in this mask. |
info | A descriptive name of the parameter which is to be set to the index of the searched string |
Definition at line 928 of file mbgctrl.c.
References chk_parm_name(), and get_chk_str_table_idx().
Referenced by set_ptp_cfg().
|
static |
Definition at line 2427 of file mbgctrl.c.
References _int_from_size_t, EF_OFF, EF_INFO::flags, MBG_ERR_CFG, EF_INFO::name, and EF_INFO::on_flags.
Referenced by set_enable_flags().
|
static |
Definition at line 514 of file mbgctrl.c.
Referenced by check_cmd_line(), and set_timezone().
|
static |
Definition at line 2036 of file mbgctrl.c.
References _get_pout_mode_name, _is_supported, check_get_pout_cfg(), chk_parm_name(), DEFAULT_POUT_PULSE_SHIFT_MAX, DEFAULT_POUT_PULSE_SHIFT_MIN, POUT_SETTINGS::flags, POUT_INFO::flags, MAX_POUT_PULSE_LEN, mbg_cond_err_msg(), MBG_ERR_CFG, mbg_rc_is_error, mbg_set_gps_pout_settings(), MBG_SUCCESS, POUT_SETTINGS::mode, POUT_SETTINGS::mode_param, N_POUT_MODES, POUT_SETTINGS::pout_data, POUT_FIXED_PULSE_LEN, POUT_IF_SYNC_ONLY, POUT_INVERTED, POUT_MODES_DATA_PULSE_SHIFT, POUT_MODES_MODE_PARAM_AS_PULSE_LEN, pout_name_inv, pout_name_len, pout_name_mode, pout_name_ois, pout_name_shift, POUT_NOT_INVERTIBLE, POUT_INFO::pout_settings, POUT_SUPP_IF_SYNC_ONLY, POUT_SUPP_PULSE_SHIFT, POUT_DATA::pulse_shift, POUT_INFO::pulse_shift_res, str_empty, str_spc_not, and POUT_INFO::supp_modes.
Referenced by check_cmd_line().
|
static |
Lookup a string in a string table and return the table index.
s | The string to be searched for in the string table |
tbl | A table of strings to be searched |
n_entries | The number of strings in the string table |
supp_mask | A string with a given index is only supported if the corresponding bit is set in this mask. |
info | A descriptive name of the parameter which is to be set to the index of the searched string |
Definition at line 846 of file mbgctrl.c.
Referenced by chk_tbl_parm().
|
static |
Definition at line 2590 of file mbgctrl.c.
References MBG_TIME_SCALE_INFO::max_settings, mbg_chk_dev_has_time_scale, mbg_cond_err_msg(), MBG_ERR_NOT_SUPP_BY_DEV, mbg_get_time_scale_info(), mbg_rc_is_error, MBG_SUCCESS, and MBG_TIME_SCALE_SETTINGS::scale.
Referenced by usage().
|
static |
Definition at line 1940 of file mbgctrl.c.
References check_get_pout_cfg(), CTRL_PRINT_IDX, DEFAULT_POUT_PULSE_SHIFT_MAX, DEFAULT_POUT_PULSE_SHIFT_MIN, POUT_INFO::flags, INDENTS::indent_2, MBG_INVALID_DEV_HANDLE, mbg_rc_is_error, MBG_SUCCESS, N_MBG_TIME_SCALE, N_POUT_MODES, pi, POUT_FIXED_PULSE_LEN, pout_mode_names_eng, POUT_NOT_INVERTIBLE, POUT_SUPP_PULSE_SHIFT, print_bit_mask_list(), POUT_INFO::pulse_shift_res, str_empty, str_spc_not, POUT_INFO::supp_modes, time_scale_names, usage_indents, usage_indents_detailed, usage_line(), and usage_note().
Referenced by usage().
|
static |
Definition at line 735 of file mbgctrl.c.
References snprintf_safe(), and str_empty.
Referenced by show_ptp_cfg().
|
static |
Definition at line 1314 of file mbgctrl.c.
References _int_from_size_t, IP4_INFO::addr, MBG_ERR_CFG, IP4_INFO::name, and str_to_ip4_addr().
Referenced by set_lan_intf().
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 3408 of file mbgctrl.c.
References check_cmd_line(), dev_name, mbg_close_device(), MBG_EXIT_CODE_FAIL, MBG_EXIT_CODE_SUCCESS, MBG_EXIT_CODE_USAGE, MBG_FIRST_COPYRIGHT_YEAR, mbg_get_show_dev_info(), MBG_INVALID_DEV_HANDLE, MBG_LAST_COPYRIGHT_YEAR, mbg_open_device_by_param_chk(), mbg_print_program_info(), mbg_rc_is_error, pname, and usage().
|
static |
Definition at line 425 of file mbgctrl.c.
References CTRL_PRINT_ALL, CTRL_PRINT_IDX, CTRL_PRINT_NEWLINES, CTRL_PRINT_PLUS, INDENTS::indent_2, INDENTS::indent_3, print_indent(), and str_empty.
Referenced by help_pout_arg().
|
static |
Definition at line 388 of file mbgctrl.c.
References str_empty.
Referenced by print_bit_mask_list(), show_pout(), and usage_note().
|
static |
Definition at line 1753 of file mbgctrl.c.
References COM_PARM::baud_rate, COM_PARM::framing, COM_PARM::handshake, MBG_PS_MSK_BAUD_RATE, MBG_PS_MSK_BAUD_RATE_OVR_SW, MBG_PS_MSK_FRAMING, MBG_PS_MSK_FRAMING_OVR_SW, MBG_PS_MSK_HS, MBG_PS_MSK_HS_OVR_SW, MBG_PS_MSK_STR_MODE, MBG_PS_MSK_STR_MODE_OVR_SW, MBG_PS_MSK_STR_TYPE, MBG_PS_MSK_STR_TYPE_OVR_DEV, PORT_SETTINGS::mode, mode_names, N_STR_MODE, PORT_SETTINGS::parm, RECEIVER_PORT_CFG::pii, PORT_INFO::port_settings, RECEIVER_PORT_CFG::stii, and PORT_SETTINGS::str_type.
Referenced by save_serial_settings().
|
static |
|
static |
Definition at line 1811 of file mbgctrl.c.
References COM_PARM::baud_rate, check_valid_port_info(), OPT_HANDLER_SPEC_S::flags, COM_PARM::framing, COM_PARM::handshake, HS_NONE, mbg_cond_err_msg(), MBG_ERR_CFG, mbg_get_serial_settings(), mbg_save_serial_settings(), MBG_SUCCESS, PORT_SETTINGS::mode, RECEIVER_INFO::n_str_type, PORT_SETTINGS::parm, RECEIVER_PORT_CFG::pii, PORT_INFO::port_settings, print_port_info_errors(), snprint_port_cfg(), RECEIVER_PORT_CFG::stii, and PORT_SETTINGS::str_type.
Referenced by check_cmd_line().
|
static |
Definition at line 2515 of file mbgctrl.c.
References mbg_cond_err_msg(), mbg_set_gps_cmd(), and MBG_SUCCESS.
Referenced by check_cmd_line().
|
static |
Definition at line 2548 of file mbgctrl.c.
References mbg_cond_err_msg(), mbg_set_gps_ant_cable_len(), and MBG_SUCCESS.
Referenced by check_cmd_line().
|
static |
Definition at line 1510 of file mbgctrl.c.
References _pcps_is_gps, _wday_sun06_to_mon17, TTM::channel, TM_GPS::frac, PCPS_TIME::hour, PCPS_STIME::hour, TM_GPS::hour, mbg_cond_err_msg(), MBG_ERR_CFG, mbg_get_time(), mbg_set_gps_time(), mbg_set_time(), MBG_SUCCESS, PCPS_TIME::mday, PCPS_STIME::mday, TM_GPS::mday, PCPS_TIME::min, PCPS_STIME::min, TM_GPS::min, PCPS_TIME::month, PCPS_STIME::month, TM_GPS::month, TM_GPS::offs_from_utc, PCPS_TIME::sec, PCPS_STIME::sec, TM_GPS::sec, PCPS_TIME::sec100, PCPS_STIME::sec100, TM_GPS::status, PCPS_TIME_UNION::stime, PCPS_TIME_UNION::t, TTM::tm, TM_DL_ENB, TM_LOCAL, TM_UTC, PCPS_STIME::wday, PCPS_TIME::year, PCPS_STIME::year, and TM_GPS::year.
Referenced by check_cmd_line().
|
static |
Definition at line 2457 of file mbgctrl.c.
References ef_check_parm(), ef_name_pulses, ef_name_serial, ef_name_synth, EF_PULSES_BOTH, EF_SERIAL_BOTH, EF_SYNTH, mbg_cond_err_msg(), MBG_ERR_CFG, mbg_get_gps_enable_flags(), mbg_set_gps_enable_flags(), MBG_SUCCESS, N_EF_INFO, ENABLE_FLAGS::pulses, ENABLE_FLAGS::serial, and ENABLE_FLAGS::synth.
Referenced by check_cmd_line().
|
static |
Definition at line 2563 of file mbgctrl.c.
References PCPS_TIME_STAMP::frac, mbg_cond_err_msg(), mbg_set_event_time(), mbg_snprint_hr_tstamp(), MBG_SUCCESS, and PCPS_TIME_STAMP::sec.
Referenced by check_cmd_line().
|
static |
Definition at line 1459 of file mbgctrl.c.
References ALT, LAT, LON, mbg_cond_err_msg(), MBG_ERR_CFG, mbg_set_gps_pos_lla(), PI, and r2d.
Referenced by check_cmd_line().
|
static |
Definition at line 539 of file mbgctrl.c.
References mbg_cond_err_msg(), mbg_set_gps_tzdl(), and MBG_SUCCESS.
Referenced by set_timezone(), and set_tzdl_offs().
|
static |
Definition at line 1344 of file mbgctrl.c.
References IP4_SETTINGS::broad_addr, IP4_SETTINGS::flags, IP4_SETTINGS::gateway, ip4_check_parm(), IP4_MSK_DHCP, ip4_name_ba, ip4_name_gw, ip4_name_ip, ip4_name_nm, IP4_SETTINGS::ip_addr, mbg_cond_err_msg(), MBG_ERR_CFG, mbg_get_ip4_settings(), mbg_set_ip4_settings(), MBG_SUCCESS, N_IP4_INFO, IP4_SETTINGS::netmask, and snprint_ip4_addr().
Referenced by check_cmd_line().
|
static |
Definition at line 1004 of file mbgctrl.c.
References ALL_PTP_CFG_INFO::all_ptp_uc_master_info_idx, PTP_CFG_SETTINGS::ann_intv, PTP_UC_MASTER_SETTINGS::ann_intv, PTP_UC_MASTER_CFG_LIMITS::ann_intv_max, PTP_UC_MASTER_CFG_LIMITS::ann_intv_min, PTP_CLOCK_ID::b, chk_int16_parm(), chk_parm_name(), chk_tbl_parm(), clock_id_wildcard, delay_mech, PTP_CFG_SETTINGS::delay_mech, PTP_CFG_SETTINGS::delay_req_intv, PTP_UC_MASTER_SETTINGS::delay_req_intv, PTP_UC_MASTER_CFG_LIMITS::delay_req_intv_max, PTP_UC_MASTER_CFG_LIMITS::delay_req_intv_min, PTP_CFG_SETTINGS::domain_number, err_unicast_nsupp, PTP_CFG_SETTINGS::flags, get_supp_ptp_role_mask(), PTP_UC_MASTER_SETTINGS::gm_clock_id, PTP_UC_MASTER_SETTINGS::gm_host, PTP_UC_MASTER_SETTINGS::gm_port_id, MAC_SEP_CHAR, mbg_cond_err_msg(), MBG_ERR_CFG, mbg_get_all_ptp_cfg_info(), mbg_rc_is_error, mbg_save_all_ptp_cfg_info(), MBG_SUCCESS, PTP_UC_MASTER_SETTINGS::message_duration, N_PTP_DELAY_MECH, N_PTP_NW_PROT, N_PTP_ROLES, PTP_CFG_SETTINGS::nw_prot, nw_prot_short, ALL_PTP_CFG_INFO::ptp_cfg_info, PTP_CFG_MSK_SUPPORT_PTP_UNICAST, PTP_CFG_MSK_V1_HW_COMPAT, ptp_name_ami, ptp_name_del, ptp_name_dom, ptp_name_dri, ptp_name_dur, ptp_name_gmid, ptp_name_gmip, ptp_name_net, ptp_name_pid, ptp_name_role, ptp_name_smi, ptp_name_v1, PTP_PORT_ID_WILDCARD, PTP_CFG_SETTINGS::ptp_role, PTP_ROLE_MULTICAST_SLAVE, ptp_roles_short, ALL_PTP_CFG_INFO::ptp_uc_master_cfg_limits, PTP_UC_MSG_DURATION_MAX, PTP_UC_MSG_DURATION_MIN, PTP_CFG_INFO::settings, PTP_UC_MASTER_INFO::settings, snprint_ip4_addr(), snprint_octets(), str_empty, str_spc_wildcard, str_to_ip4_addr(), str_to_octets(), PTP_CFG_INFO::supp_delay_mech, PTP_CFG_INFO::supp_flags, PTP_CFG_INFO::supp_nw_prot, PTP_CFG_SETTINGS::sync_intv, PTP_UC_MASTER_SETTINGS::sync_intv, PTP_UC_MASTER_CFG_LIMITS::sync_intv_max, and PTP_UC_MASTER_CFG_LIMITS::sync_intv_min.
Referenced by check_cmd_line().
|
static |
Definition at line 667 of file mbgctrl.c.
References SYNTH::freq, MBG_ERR_INV_PARM, mbg_set_synth(), SYNTH::phase, and SYNTH::range.
Referenced by check_cmd_line().
|
static |
Definition at line 2645 of file mbgctrl.c.
References MBG_TIME_SCALE_INFO::max_settings, mbg_cond_err_msg(), MBG_ERR_CFG, mbg_get_time_scale_info(), mbg_set_time_scale_settings(), MBG_SUCCESS, MBG_TIME_SCALE_SETTINGS::scale, MBG_TIME_SCALE_INFO::settings, and MBG_TIME_SCALE_INFO::supp_scales.
Referenced by check_cmd_line().
|
static |
Definition at line 556 of file mbgctrl.c.
References _pcps_has_tzcode, _pcps_has_tzdl, err_msg(), MBG_SUCCESS, no_tz, PCPS_TZCODE_MEZMESZ, PCPS_TZCODE_OEZ, PCPS_TZCODE_UTC, RC_USAGE, set_gps_tzdl(), set_tz_code(), tz_info_cet_cest, tz_info_eet_eest, tz_info_utc, tzdl_cet_cest, tzdl_eet_eest, and tzdl_utc.
Referenced by check_cmd_line().
|
static |
Definition at line 523 of file mbgctrl.c.
References mbg_cond_err_msg(), mbg_set_tzcode(), and MBG_SUCCESS.
Referenced by set_timezone().
|
static |
Definition at line 622 of file mbgctrl.c.
References max_tzdl_offs, MBG_ERR_CFG, TZDL::offs, set_gps_tzdl(), and tzdl_utc.
Referenced by check_cmd_line().
|
static |
Definition at line 2531 of file mbgctrl.c.
References mbg_cond_err_msg(), mbg_get_gps_ant_cable_len(), and MBG_SUCCESS.
Referenced by check_cmd_line().
|
static |
Definition at line 2397 of file mbgctrl.c.
References _pcps_has_synth, ef_name_pulses, ef_name_serial, ef_name_synth, mbg_cond_err_msg(), mbg_get_gps_enable_flags(), MBG_SUCCESS, printf_ef(), ENABLE_FLAGS::pulses, ENABLE_FLAGS::serial, and ENABLE_FLAGS::synth.
Referenced by check_cmd_line().
|
static |
Definition at line 697 of file mbgctrl.c.
References IP4_SETTINGS::broad_addr, IP4_SETTINGS::flags, IP4_SETTINGS::gateway, IP4_MSK_DHCP, IP4_SETTINGS::ip_addr, mbg_cond_err_msg(), mbg_get_ip4_settings(), MBG_SUCCESS, IP4_SETTINGS::netmask, and snprint_ip4_addr().
Referenced by check_cmd_line().
|
static |
Definition at line 2297 of file mbgctrl.c.
References _get_pout_mode_name, _is_supported, check_get_pout_cfg(), POUT_SETTINGS::flags, POUT_INFO::flags, INDENTS::indent_1, INDENTS::indent_2, mbg_cond_err_msg(), MBG_SUCCESS, POUT_SETTINGS::mode, POUT_SETTINGS::mode_param, pi, POUT_SETTINGS::pout_data, POUT_FIXED_PULSE_LEN, POUT_IF_SYNC_ONLY, POUT_INVERTED, POUT_MODES_DATA_PULSE_SHIFT, POUT_MODES_MODE_PARAM_AS_PULSE_LEN, POUT_MODES_SUPP_IF_SYNC_ONLY, POUT_MODES_TIMEOUT, POUT_NOT_INVERTIBLE, POUT_INFO::pout_settings, POUT_SUPP_IF_SYNC_ONLY, POUT_SUPP_PULSE_SHIFT, print_indent(), POUT_DATA::pulse_shift, POUT_INFO::pulse_shift_res, show_indents, snprintf_safe(), str_empty, str_not_spc, str_spc_not_supp, and POUT_SETTINGS::timeout.
Referenced by check_cmd_line().
|
static |
Definition at line 757 of file mbgctrl.c.
References _ptp_role_name, _ptp_role_name_short, ALL_PTP_CFG_INFO::all_ptp_uc_master_info_idx, PTP_CFG_SETTINGS::ann_intv, PTP_UC_MASTER_SETTINGS::ann_intv, PTP_CLOCK_ID::b, delay_mech, PTP_CFG_SETTINGS::delay_mech, PTP_CFG_SETTINGS::delay_req_intv, PTP_UC_MASTER_SETTINGS::delay_req_intv, PTP_CFG_SETTINGS::domain_number, PTP_CFG_SETTINGS::flags, PTP_UC_MASTER_SETTINGS::gm_clock_id, PTP_UC_MASTER_SETTINGS::gm_host, PTP_UC_MASTER_SETTINGS::gm_port_id, intv_str(), MAC_SEP_CHAR, mbg_cond_err_msg(), mbg_get_all_ptp_cfg_info(), MBG_SUCCESS, PTP_UC_MASTER_SETTINGS::message_duration, PTP_UC_MASTER_CFG_LIMITS::n_supp_master, nw_prot, PTP_CFG_SETTINGS::nw_prot, nw_prot_short, pi, ALL_PTP_CFG_INFO::ptp_cfg_info, PTP_CFG_MSK_SUPPORT_PTP_UNICAST, PTP_CFG_MSK_V1_HW_COMPAT, PTP_PORT_ID_WILDCARD, PTP_CFG_SETTINGS::ptp_role, PTP_ROLE_MULTICAST_SLAVE, ALL_PTP_CFG_INFO::ptp_uc_master_cfg_limits, PTP_CFG_INFO::settings, snprint_octets(), str_empty, str_spc_wildcard, PTP_CFG_INFO::supp_flags, PTP_CFG_SETTINGS::sync_intv, and PTP_UC_MASTER_SETTINGS::sync_intv.
Referenced by check_cmd_line().
|
static |
Definition at line 1736 of file mbgctrl.c.
References RECEIVER_INFO::n_com_ports, and snprint_port_cfg().
Referenced by check_cmd_line().
|
static |
Definition at line 643 of file mbgctrl.c.
References SYNTH::freq, mbg_cond_err_msg(), mbg_get_synth(), MBG_SUCCESS, SYNTH::phase, and SYNTH::range.
Referenced by check_cmd_line().
|
static |
Definition at line 2623 of file mbgctrl.c.
References _get_time_scale_name, mbg_cond_err_msg(), mbg_get_time_scale_info(), MBG_SUCCESS, MBG_TIME_SCALE_SETTINGS::scale, and MBG_TIME_SCALE_INFO::settings.
Referenced by check_cmd_line().
|
static |
Definition at line 605 of file mbgctrl.c.
References mbg_cond_err_msg(), mbg_get_gps_tzdl(), MBG_SUCCESS, and TZDL::offs.
Referenced by check_cmd_line().
|
static |
Definition at line 1717 of file mbgctrl.c.
References COM_PARM::baud_rate, COM_PARM::framing, PORT_SETTINGS::mode, mode_names, PORT_SETTINGS::parm, RECEIVER_PORT_CFG::pii, RECEIVER_PORT_CFG::stii, and PORT_SETTINGS::str_type.
Referenced by save_serial_settings(), and show_serial_settings().
|
static |
Definition at line 2876 of file mbgctrl.c.
Referenced by check_cmd_line().
|
static |
Definition at line 2684 of file mbgctrl.c.
References _get_time_scale_name, _pcps_has_event_time, check_get_receiver_port_cfg(), get_n_time_scale(), help_pout_arg(), STR_TYPE_INFO::long_name, mbg_baud_rate_strs, mbg_framing_strs, mode_names, N_MBG_BAUD_RATES, N_MBG_FRAMINGS, N_MBG_TIME_SCALE, N_STR_MODE, RECEIVER_INFO::n_str_type, pname, RECEIVER_PORT_CFG::stii, tz_info_cet_cest, tz_info_eet_eest, and tz_info_utc.
Referenced by main().
|
static |
Definition at line 335 of file mbgctrl.c.
References OPT_SUPP_CMD_IDX, and str_empty.
Referenced by help_pout_arg().
|
static |
|
static |
Definition at line 311 of file mbgctrl.c.
Referenced by set_ptp_cfg().
|
static |
Definition at line 304 of file mbgctrl.c.
Referenced by set_ptp_cfg(), and show_ptp_cfg().
|
static |
Definition at line 131 of file mbgctrl.c.
Referenced by check_cmd_line(), main(), mbg_split_dev_name(), and mbg_str_dev_name().
|
static |
Definition at line 271 of file mbgctrl.c.
Referenced by set_enable_flags(), and show_enable_flags().
|
static |
Definition at line 270 of file mbgctrl.c.
Referenced by set_enable_flags(), and show_enable_flags().
|
static |
Definition at line 272 of file mbgctrl.c.
Referenced by set_enable_flags(), and show_enable_flags().
|
static |
Definition at line 133 of file mbgctrl.c.
Referenced by chk_int16_parm(), and set_ptp_cfg().
|
static |
Definition at line 285 of file mbgctrl.c.
Referenced by set_lan_intf().
|
static |
Definition at line 286 of file mbgctrl.c.
Referenced by set_lan_intf().
|
static |
Definition at line 283 of file mbgctrl.c.
Referenced by set_lan_intf().
|
static |
Definition at line 284 of file mbgctrl.c.
Referenced by set_lan_intf().
|
static |
Definition at line 142 of file mbgctrl.c.
Referenced by set_tzdl_offs().
|
static |
Definition at line 148 of file mbgctrl.c.
Referenced by print_port_info_errors(), snprint_port_cfg(), and usage().
|
static |
Definition at line 170 of file mbgctrl.c.
Referenced by check_cmd_line().
|
static |
Definition at line 166 of file mbgctrl.c.
Referenced by check_cmd_line().
|
static |
Definition at line 165 of file mbgctrl.c.
Referenced by check_cmd_line().
|
static |
Definition at line 161 of file mbgctrl.c.
Referenced by check_cmd_line().
|
static |
Definition at line 168 of file mbgctrl.c.
Referenced by check_cmd_line().
|
static |
Definition at line 169 of file mbgctrl.c.
Referenced by check_cmd_line().
|
static |
Definition at line 164 of file mbgctrl.c.
Referenced by check_cmd_line().
|
static |
Definition at line 167 of file mbgctrl.c.
Referenced by check_cmd_line().
|
static |
Definition at line 163 of file mbgctrl.c.
Referenced by set_timezone().
|
static |
Definition at line 162 of file mbgctrl.c.
Referenced by check_cmd_line().
|
static |
Definition at line 305 of file mbgctrl.c.
Referenced by show_ptp_cfg().
|
static |
Definition at line 306 of file mbgctrl.c.
Referenced by set_ptp_cfg(), and show_ptp_cfg().
OPT_HANDLER_SPEC ohs_pout |
|
static |
|
static |
Definition at line 155 of file mbgctrl.c.
Referenced by help_pout_arg().
|
static |
Definition at line 325 of file mbgctrl.c.
Referenced by eval_pout().
|
static |
Definition at line 324 of file mbgctrl.c.
Referenced by eval_pout().
|
static |
Definition at line 323 of file mbgctrl.c.
Referenced by eval_pout().
|
static |
Definition at line 326 of file mbgctrl.c.
Referenced by eval_pout().
|
static |
Definition at line 327 of file mbgctrl.c.
Referenced by eval_pout().
|
static |
Definition at line 299 of file mbgctrl.c.
Referenced by set_ptp_cfg().
|
static |
Definition at line 289 of file mbgctrl.c.
Referenced by set_ptp_cfg().
|
static |
Definition at line 290 of file mbgctrl.c.
Referenced by set_ptp_cfg().
|
static |
Definition at line 300 of file mbgctrl.c.
Referenced by set_ptp_cfg().
|
static |
Definition at line 301 of file mbgctrl.c.
Referenced by set_ptp_cfg().
|
static |
Definition at line 296 of file mbgctrl.c.
Referenced by set_ptp_cfg().
|
static |
Definition at line 295 of file mbgctrl.c.
Referenced by set_ptp_cfg().
|
static |
Definition at line 288 of file mbgctrl.c.
Referenced by set_ptp_cfg().
|
static |
Definition at line 297 of file mbgctrl.c.
Referenced by set_ptp_cfg().
|
static |
Definition at line 293 of file mbgctrl.c.
Referenced by set_ptp_cfg().
|
static |
Definition at line 298 of file mbgctrl.c.
Referenced by set_ptp_cfg().
|
static |
Definition at line 291 of file mbgctrl.c.
Referenced by set_ptp_cfg().
|
static |
|
static |
Definition at line 309 of file mbgctrl.c.
Referenced by set_ptp_cfg().
const INDENTS show_indents = { 2, 4, 0, 0 } |
Definition at line 253 of file mbgctrl.c.
Referenced by show_pout().
|
static |
Definition at line 135 of file mbgctrl.c.
Referenced by eval_pout(), and help_pout_arg().
|
static |
Definition at line 136 of file mbgctrl.c.
Referenced by show_pout().
|
static |
Definition at line 137 of file mbgctrl.c.
Referenced by set_ptp_cfg(), and show_ptp_cfg().
|
static |
Definition at line 150 of file mbgctrl.c.
Referenced by help_pout_arg().
|
static |
Definition at line 145 of file mbgctrl.c.
Referenced by set_timezone(), and usage().
|
static |
Definition at line 146 of file mbgctrl.c.
Referenced by set_timezone(), and usage().
|
static |
Definition at line 144 of file mbgctrl.c.
Referenced by set_timezone(), and usage().
|
static |
Definition at line 140 of file mbgctrl.c.
Referenced by set_timezone().
|
static |
Definition at line 141 of file mbgctrl.c.
Referenced by set_timezone().
|
static |
Definition at line 139 of file mbgctrl.c.
Referenced by set_timezone(), and set_tzdl_offs().
const INDENTS usage_indents = { 2, 4, 6, 30 } |
Definition at line 251 of file mbgctrl.c.
Referenced by help_pout_arg().
const INDENTS usage_indents_detailed = { 4, 6, 8, 30 } |
Definition at line 252 of file mbgctrl.c.
Referenced by help_pout_arg().