mbgtools-lx  4.2.8
cfg_hlp.h File Reference
#include <gpsdefs.h>
#include <mbgklist.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <time.h>
#include <sys/sysinfo.h>

Go to the source code of this file.

Data Structures

struct  _DEVICE_INFO
 
struct  RECEIVER_PORT_CFG
 All configuration parameters for all serial ports. More...
 
struct  ALL_XBP_INFO
 All XBP information of a XBP supporting device. More...
 
struct  ALL_NET_CFG_INFO
 All network configuration parameters. More...
 
struct  ALL_SNMP_INFO
 All SNMP configuration information. More...
 
struct  mbg_event
 All monitoring event data. More...
 
struct  ALL_EVENTS
 
struct  mbg_syslog_server
 All monitoring syslog data. More...
 
struct  ALL_SYSLOG_INFO
 
struct  ALL_MONITORING_INFO
 All monitoring information. More...
 
struct  ALL_PTP_CFG_INFO
 All PTP configuration parameters. More...
 
struct  ALL_PTP_V1_COMMON_DATASETS
 All PTPv1 common datasets for a PTP device. More...
 
struct  ALL_PTP_V2_COMMON_DATASETS
 All PTPv2 common datasets for a PTP device. More...
 
struct  ALL_GNSS_INFO
 Summary information on all supported GNSS systems. More...
 
struct  NTP_CLIENT_CFG_PEER_SETTINGS
 All NTP configuration parameters. More...
 
struct  ALL_NTP_CFG_INFO
 
struct  ALL_NTP_STATUS
 
struct  ALL_XMULTI_REF_INFO
 
struct  ALL_XMULTI_REF_STATUS
 
struct  ALL_IMS_INFO
 
struct  ALL_IMS_STATE
 
struct  ALL_GPIO_INFO
 
struct  ALL_GPIO_STATE
 
struct  mbg_io_port
 
struct  ALL_MBG_IO_PORTS
 
struct  UCAP_ENTRY
 
struct  ALL_UCAP_INFO
 
struct  ALL_UCAP_NET_INFO
 
struct  mbg_user
 
struct  ALL_USER_INFO
 
struct  mbg_service
 
struct  ALL_SERVICE_INFO
 
struct  mbg_firmware
 
struct  mbg_firmware_ufu
 
struct  ALL_FIRMWARE_INFO
 
struct  mbg_database
 
struct  ALL_DATABASE_INFO
 
struct  MBG_EXT_SYS_INFO_CPU_CODEC
 

Macros

#define _ext   extern
 
#define N_SUPP_DEV_BUS   16
 
#define N_SUPP_DEV_EXT   1
 
#define N_SUPP_DEV_TOTAL   ( N_SUPP_DEV_BUS + N_SUPP_DEV_EXT )
 
#define MAX_PARM_PORT   10
 The max number of serial ports supported by configuration programs. More...
 
#define MAX_PARM_STR_TYPE   20
 The max number of serial string types supported by configuration programs. More...
 
#define MAX_PARM_POUT   10
 The max number of programmable pulse outputs supported by configuration programs. More...
 
#define MAX_PARM_GNSS_SAT   N_GNSS_TYPES
 The max number of GNSS settings supported by configuration programs. More...
 
#define MAX_PARM_PTP_UC_MASTER   3
 The max number of PTP unicast masters supported by configuration programs. More...
 
#define MAX_PARM_EXT_NTP_SRVR   20
 The max number of external NTP server associations to be handled by configuration programs. More...
 
#define MAX_PARM_GPIO   10
 The max number of GPIO ports supported by configuration programs. More...
 
#define MAX_PARM_XMR   10
 The max number of XMR sources supported by configuration programs. More...
 
#define MAX_EXT_NTP_SERVERS   20
 The max number of external NTP servers supported by configuration programs. More...
 
#define MAX_MBG_TIME_MON_MODULES   10
 The max. number of time monitoring modules supported by configuration programs Each module may support a different number of targets to be monitored. More...
 
#define MAX_MBG_TIME_MON_TARGETS   100
 The max. number of time monitoring targets supported by configuration programs This is the sum of all targets from all monitoring modules. More...
 
#define MAX_UCAP_ENTRIES   585
 
#define MBG_EXT_SYS_INFO_CPU_CODECS
 
#define DEFAULT_MAX_STR_TYPE   2
 
#define _get_gpio_type_name(_i)   ( ( (_i) < N_MBG_GPIO_TYPES ) ? mbg_gpio_type_names[_i] : str_unknown )
 
#define _get_gpio_port_state_name(_i)   ( ( (_i) < N_MBG_GPIO_PORT_STATES ) ? mbg_gpio_port_state_names[_i] : str_unknown )
 
#define _get_gpio_signal_shape_name(_i)   ( ( (_i) < N_MBG_GPIO_SIGNAL_SHAPES ) ? mbg_gpio_signal_shape_names[_i] : str_unknown )
 
#define _get_gpio_fixed_freq_str(_i)   ( ( (_i) < N_MBG_GPIO_FIXED_FREQ ) ? mbg_gpio_fixed_freq_strs[_i] : str_unknown )
 
#define _get_xmr_holdover_status_mode_name(_i)   ( ( (_i) < N_XMR_HOLDOVER_STATUS_MODES ) ? xmr_holdover_status_mode_names[_i] : str_unknown )
 
#define _get_ptp_role_str_dflt(_i, _dflt)   ( ( (_i) < N_PTP_ROLES ) ? ptp_role_strs[_i] : _dflt )
 
#define _get_ptp_role_str(_i)   _get_ptp_role_str_dflt( _i, str_unknown )
 
#define _get_ptp_nw_protocol_str_dflt(_i, _dflt)   ( ( (_i) < N_PTP_NW_PROT ) ? ptp_nw_protocol_strs[_i] : _dflt )
 
#define _get_ptp_nw_protocol_str(_i)   _get_ptp_nw_protocol_str_dflt(_i, str_unknown )
 
#define _get_ptp_port_state_str_dflt(_i, _dflt)   ( ( (_i) < N_PTP_PORT_STATE ) ? ptp_port_state_strs[_i] : _dflt )
 
#define _get_ptp_port_state_str(_i)   _get_ptp_port_state_str_dflt( _i, str_unknown )
 
#define _get_ptp_clock_accuracy_str_dflt(_i, _dflt)
 
#define _get_ptp_clock_accuracy_str(_i)   _get_ptp_clock_accuracy_str( _i, str_unknown )
 
#define _get_ptp_delay_mechanism_str_dflt(_i, _dflt)   ( ( (_i) < N_PTP_DELAY_MECH ) ? ptp_delay_mechanism_strs[_i] : _dflt )
 
#define _get_ptp_delay_mechanism_str(_i)   _get_ptp_delay_mechanism_str_dflt( _i, str_unknown )
 

Typedefs

typedef struct _DEVICE_INFO DEVICE_INFO
 
typedef PORT_INFO_IDX ALL_PORT_INFO_IDX[10]
 An array of configuration settings for all serial ports. More...
 
typedef STR_TYPE_INFO_IDX ALL_STR_TYPE_INFO_IDX[20]
 An array of configuration settings for all serial string types. More...
 
typedef POUT_INFO_IDX ALL_POUT_INFO_IDX[10]
 An array of configuration settings for all programmable pulse outputs. More...
 
typedef ALL_NET_CFG_INFO ALL_NET_STATUS_INFO
 
typedef struct mbg_event MBG_EVENT
 All monitoring event data. More...
 
typedef struct mbg_syslog_server MBG_SYSLOG_SERVER
 All monitoring syslog data. More...
 
typedef PTP_UC_MASTER_INFO_IDX ALL_PTP_UC_MASTER_INFO_IDX[3]
 Configuration settings for all unicast master specifications. More...
 
typedef GNSS_SAT_INFO_IDX ALL_GNSS_SAT_INFO_IDX[N_GNSS_TYPES]
 An array of configuration settings for all programmable pulse outputs. More...
 
typedef NTP_PEER_SETTINGS ALL_NTP_PEER_SETTINGS[20]
 Configuration settings for all NTP server associations. More...
 
typedef MBG_GPIO_INFO_IDX ALL_GPIO_INFO_IDX[10]
 Configuration settings for all GPIO ports. More...
 
typedef MBG_GPIO_STATUS_IDX ALL_GPIO_STATUS_IDX[10]
 Status information on all GPIO ports. More...
 
typedef XMULTI_REF_STATUS_IDX ALL_XMULTI_REF_STATUS_IDX[10]
 Status of all XMR inputs. More...
 
typedef XMULTI_REF_INFO_IDX ALL_XMULTI_REF_INFO_IDX[10]
 Configuration settings for all XMR inputs. More...
 
typedef struct mbg_io_port MBG_IO_PORT
 
typedef struct mbg_user MBG_USER
 
typedef struct mbg_service MBG_SERVICE
 
typedef struct mbg_firmware MBG_FIRMWARE
 
typedef struct mbg_firmware_ufu MBG_FIRMWARE_UFU
 
typedef struct mbg_database MBG_DATABASE
 

Enumerations

enum  COMP_SIG_MODES {
  COMP_SIG_MODE_NONE, COMP_SIG_MODE_SIGNAL, COMP_SIG_MODE_ANT_CONN, COMP_SIG_MODE_PORT_LINK,
  N_CONN_SIG_MODES
}
 A mode specifying how to interpret a PCPS_SIG_VAL. More...
 
enum  PCPS_TIME_EXT_FLAG_BITS { PCPS_TIME_EXT_FLAG_BIT_UTC_VALID, N_PCPS_TIME_EXT_FLAG_BITS }
 Flag bits indicating if some extended status is available. More...
 
enum  PCPS_TIME_EXT_FLAGS { PCPS_TIME_EXT_FLAG_UTC_VALID = ( 1UL << PCPS_TIME_EXT_FLAG_BIT_UTC_VALID ) }
 Flag masks used with PCPS_TIME_EXT::flags. More...
 

Functions

static __mbg_inline int num_bits_set (long val)
 Count the number of bits which are not 0. More...
 
static __mbg_inline bool device_id_is_serial (const char *dev_id)
 Check if a device ID refers to a serial port. More...
 
static __mbg_inline bool device_id_is_lan (const char *dev_id)
 Check if a device ID refers to a LAN connection. More...
 
static __mbg_inline MBG_TLV_UID mbg_tlv_create_id (void)
 
int chk_sw_rev_name (SW_REV *p, int verbose)
 Check if a software revision name should be displayed. More...
 
int get_str_idx (const char *search, const char *str_table[], int n_entries)
 
int get_baud_rate_idx (BAUD_RATE baud_rate)
 
int get_framing_idx (const char *framing)
 
void port_settings_from_port_parm_mode (PORT_SETTINGS *p_ps, uint8_t pp_mode, int cap_str_idx)
 Convert PORT_PARM::mode to PORT_SETTINGS::mode. More...
 
void port_parm_mode_from_port_settings (uint8_t *pp_mode, const PORT_SETTINGS *p_ps, int cap_str_idx)
 Convert a PORT_SETTINGS::mode to a legacy PORT_PARM::mode. More...
 
void port_settings_from_port_parm (PORT_SETTINGS *p_ps, int port_idx, const PORT_PARM *p_pp, int cap_str_idx)
 Set up a PORT_SETTINGS structure from a legacy PORT_PARM structure. More...
 
void port_parm_from_port_settings (PORT_PARM *p_pp, int port_idx, const PORT_SETTINGS *p_ps, int cap_str_idx)
 Set up a a legacy PORT_PARM structure from a PORT_SETTINGS structure. More...
 
uint32_t check_valid_port_info (const PORT_INFO *p_pi, const STR_TYPE_INFO_IDX str_type_info_idx[], int n_str_type)
 
int valid_port_info (const PORT_INFO *p_pi, const STR_TYPE_INFO_IDX str_type_info_idx[], int n_str_type)
 
int setup_port_info_from_port_parm (PORT_INFO_IDX pii[], const PORT_PARM *p_pp, const RECEIVER_INFO *p_ri)
 Setup an array of PORT_INFO_IDX structures from a PORT_PARM. More...
 
int setup_default_str_type_info_idx (STR_TYPE_INFO_IDX stii[], const RECEIVER_INFO *p_ri)
 
int chk_set_n_gnss_supp (ALL_GNSS_INFO *p_agi)
 
void setup_gps_only_sat_info_idx_from_statinfo (ALL_GNSS_INFO *p_agi)
 

Setup GNSS info from stat_info so we can use the same printing routine

More...
 
int setup_gps_only_gnss_info_from_statinfo (ALL_GNSS_INFO *p_agi)
 Setup GNSS info from stat_info so we can use the same printing routine. More...
 
void chk_free_dev_hw_id (DEVICE_INFO *p)
 
int alloc_dev_hw_id (DEVICE_INFO *p, size_t len)
 
const char * get_fw_id_from_hw_id (const char *hw_id)
 
const char * get_hw_id_from_fw_id (const char *fw_id)
 
MBG_IO_PORT_TYPE_INFOget_io_port_type_info (const MBG_IO_PORT *port, uint16_t port_type)
 Returns the currently used MBG_IO_PORT_TYPE_INFO for the appropriate MBG_IO_PORT. More...
 
void mbg_tlv_announce_init (MBG_TLV_ANNOUNCE *tlv, MBG_TLV_UID uid, MBG_TLV_TYPE tlv_feat_type, uint32_t total_bytes)
 Initializes a MBG_TLV_ANNOUNCE structure. More...
 
void mbg_tlv_init (MBG_TLV *tlv, MBG_TLV_UID uid, MBG_TLV_TYPE tlv_type, uint32_t total_bytes)
 Initializes a MBG_TLV. More...
 
void mbg_tlv_rcv_state_init (MBG_TLV_RCV_STATE *state, MBG_TLV_UID uid, uint32_t total_bytes)
 Initializes MBG_TLV_RCV_STATE structure. More...
 
int mbg_snprint_revision (char *buf, size_t buflen, const char *prefix, const char *suffix, uint32_t rev)
 
_NO_MBG_API_ATTR int _MBG_API chk_dev_receiver_info (const RECEIVER_INFO *p)
 
_NO_MBG_API_ATTR int _MBG_API chk_dev_xbp_supp_nodes (const ALL_XBP_INFO *info)
 
_NO_MBG_API_ATTR int _MBG_API chk_dev_net_cfg_supp_stage_2 (const ALL_NET_CFG_INFO *info)
 
_NO_MBG_API_ATTR int _MBG_API chk_dev_ntp_supp_client (const ALL_NTP_CFG_INFO *info)
 
_NO_MBG_API_ATTR int _MBG_API chk_dev_ntp_supp_server (const ALL_NTP_CFG_INFO *info)
 
_NO_MBG_API_ATTR int _MBG_API chk_dev_xmulti_ref_supp_mrf_none (const ALL_XMULTI_REF_INFO *info)
 
_NO_MBG_API_ATTR int _MBG_API chk_dev_xmulti_ref_supp_ext_src_info (const ALL_XMULTI_REF_INFO *info)
 
_NO_MBG_API_ATTR int _MBG_API chk_dev_xmulti_ref_supp_holdover_status (const ALL_XMULTI_REF_INFO *info)
 
_NO_MBG_API_ATTR int _MBG_API chk_dev_xmulti_ref_supp_ext_source_stats (const ALL_XMULTI_REF_INFO *info, int type)
 
_NO_MBG_API_ATTR int _MBG_API chk_dev_xmulti_ref_supp_ext_source_metrics (const ALL_XMULTI_REF_INFO *info, int type)
 
_NO_MBG_API_ATTR int _MBG_API chk_dev_ims_has_fdm (const ALL_IMS_INFO *info)
 
_NO_MBG_API_ATTR int _MBG_API chk_dev_ims_is_volt_out_enabled (const ALL_IMS_STATE *ims_state, unsigned idx)
 
_NO_MBG_API_ATTR int _MBG_API chk_dev_ims_is_volt_out_overload (const ALL_IMS_STATE *ims_state, unsigned idx)
 
_NO_MBG_API_ATTR int _MBG_API chk_dev_ims_is_pll_locked (const ALL_IMS_STATE *ims_state, unsigned idx)
 
_NO_MBG_API_ATTR int _MBG_API chk_dev_gpio_supp_ass_idx (const ALL_GPIO_INFO *gpio_info, unsigned idx)
 
_NO_MBG_API_ATTR int _MBG_API chk_dev_gpio_dep_on_ass_idx (const ALL_GPIO_INFO *gpio_info, unsigned idx)
 
_NO_MBG_API_ATTR int _MBG_API chk_dev_gpio_has_status (const ALL_GPIO_INFO *info)
 Checks whether GPIO supports status function. More...
 
void free_all_xbp_info (ALL_XBP_INFO *p)
 Free an ALL_XBP_INFO structure. More...
 
void free_all_net_cfg_info (ALL_NET_CFG_INFO *p)
 Free an ALL_NET_CFG_INFO structure. More...
 
void free_all_net_status_info (ALL_NET_STATUS_INFO *p)
 Free an ALL_NET_STATUS_INFO structure. More...
 
void free_all_snmp_info (ALL_SNMP_INFO *p)
 Free an ALL_SNMP_INFO structure. More...
 
void free_all_syslog_info (ALL_SYSLOG_INFO *p)
 Free an ALL_SYSLOG_INFO structure. More...
 
void free_all_monitoring_info (ALL_MONITORING_INFO *p)
 Free an ALL_MONITORING_INFO structure. More...
 
void free_all_events (ALL_EVENTS *p)
 Free an ALL_EVENTS structure. More...
 
void free_all_xmulti_ref_info (ALL_XMULTI_REF_INFO *p)
 Free an ALL_XMULTI_REF_INFO structure. More...
 
void free_all_xmulti_ref_status (ALL_XMULTI_REF_STATUS *p)
 Free an ALL_XMULTI_REF_STATUS structure. More...
 
void free_all_ptp_v1_common_datasets (ALL_PTP_V1_COMMON_DATASETS *p)
 Free an ALL_PTP_V1_COMMON_DATASETS structure allocated by mbgextio_get_all_ptp_v1_common_datasets. More...
 
void free_all_ptp_v2_common_datasets (ALL_PTP_V2_COMMON_DATASETS *p)
 Free an ALL_PTP_V2_COMMON_DATASETS structure allocated by mbgextio_get_all_ptp_v2_common_datasets. More...
 
void free_all_ntp_cfg_info (ALL_NTP_CFG_INFO *p)
 Free an ALL_NTP_CFG_INFO structure. More...
 
void free_all_ntp_status (ALL_NTP_STATUS *p)
 Free an ALL_NTP_STATUS structure. More...
 
void free_all_ims_info (ALL_IMS_INFO *p)
 Free memory allocated by mbgextio_get_all_ims_info. More...
 
void free_all_ims_state (ALL_IMS_STATE *p)
 Free memory allocated by mbgextio_get_all_ims_state. More...
 
void free_all_gpio_info (ALL_GPIO_INFO *p)
 Free memory allocated by mbgextio_get_all_gpio_info. More...
 
void free_all_io_ports (ALL_MBG_IO_PORTS *p)
 Free memory allocated by mbgextio_get_all_io_ports. More...
 
void free_all_gpio_state (ALL_GPIO_STATE *p)
 Free memory allocated by mbgextio_get_all_gpio_state. More...
 
UCAP_ENTRYcalloc_ucap_entry (void)
 
void free_all_ucap_info (ALL_UCAP_INFO *p)
 Free memory allocated by mbgextio_get_all_ucap_info. More...
 
void free_all_ucap_net_info (ALL_UCAP_NET_INFO *p)
 Free an ALL_UCAP_NET_INFO structure. More...
 
void free_all_user_info (ALL_USER_INFO *p)
 Free an ALL_USER_INFO structure. More...
 
void free_all_svc_info (ALL_SERVICE_INFO *p)
 Free an ALL_SERVICE_INFO structure. More...
 
void free_all_firmware_info (ALL_FIRMWARE_INFO *p)
 Free an ALL_FIRMWARE_INFO structure. More...
 
void free_all_database_info (ALL_DATABASE_INFO *p)
 Free an ALL_DATABASE_INFO structure. More...
 
void str_ntp_hex_to_ntp_tstamp (const char *s, NTP_TSTAMP *p)
 Set up a NTP_TSTAMP structure from a hex string with a time in seconds and binary fractions. More...
 
void ntp_tstamp_to_nanotime_64 (const NTP_TSTAMP *p_nts, NANO_TIME_64 *p_nt64)
 Convert a NTP_TSTAMP structure to a NANO_TIME_64 structure. More...
 
void str_ntp_hex_to_nano_time_64 (const char *s, NANO_TIME_64 *p)
 Set up a NANO_TIME_64 structure from a hex string with a time in seconds and binary fractions. More...
 

Variables

DEVICE_INFO device_list [(16+1)]
 
BAUD_RATE mbg_baud_rates [N_MBG_BAUD_RATES]
 
const char * mbg_baud_rate_strs [N_MBG_BAUD_RATES]
 
const char * mbg_framing_strs [N_MBG_FRAMINGS]
 
const char * str_unknown
 
const char * str_undefined
 
const char * str_not_spc
 
STR_TYPE_INFO default_str_type_info [2]
 
const char * mbg_gpio_type_names [N_MBG_GPIO_TYPES]
 
const char * mbg_gpio_port_state_names [N_MBG_GPIO_PORT_STATES]
 
const char * mbg_gpio_signal_shape_names [N_MBG_GPIO_SIGNAL_SHAPES]
 
const char * mbg_gpio_fixed_freq_strs [N_MBG_GPIO_FIXED_FREQ]
 
const char * xmr_holdover_status_mode_names [N_XMR_HOLDOVER_STATUS_MODES]
 
const char * ptp_role_strs [N_PTP_ROLES]
 
const char * ptp_nw_protocol_strs [N_PTP_NW_PROT]
 
const char * ptp_port_state_strs [N_PTP_PORT_STATE]
 
const char * ptp_clock_accuracy_strs [N_PTP_CLOCK_ACCURACY - PTP_CLOCK_ACCURACY_NUM_BIAS]
 
const char * ptp_delay_mechanism_strs [N_PTP_DELAY_MECH]
 
const PTP_TABLE ptp_time_source_table []
 

Macro Definition Documentation

◆ _ext

#define _ext   extern

Definition at line 101 of file cfg_hlp.h.

◆ _get_gpio_fixed_freq_str

#define _get_gpio_fixed_freq_str (   _i)    ( ( (_i) < N_MBG_GPIO_FIXED_FREQ ) ? mbg_gpio_fixed_freq_strs[_i] : str_unknown )

Definition at line 919 of file cfg_hlp.h.

Referenced by mbg_get_all_ucap_info().

◆ _get_gpio_port_state_name

#define _get_gpio_port_state_name (   _i)    ( ( (_i) < N_MBG_GPIO_PORT_STATES ) ? mbg_gpio_port_state_names[_i] : str_unknown )

Definition at line 897 of file cfg_hlp.h.

Referenced by mbg_get_all_ucap_info().

◆ _get_gpio_signal_shape_name

#define _get_gpio_signal_shape_name (   _i)    ( ( (_i) < N_MBG_GPIO_SIGNAL_SHAPES ) ? mbg_gpio_signal_shape_names[_i] : str_unknown )

Definition at line 908 of file cfg_hlp.h.

Referenced by mbg_get_all_ucap_info().

◆ _get_gpio_type_name

#define _get_gpio_type_name (   _i)    ( ( (_i) < N_MBG_GPIO_TYPES ) ? mbg_gpio_type_names[_i] : str_unknown )

Definition at line 886 of file cfg_hlp.h.

Referenced by mbg_get_all_ucap_info().

◆ _get_ptp_clock_accuracy_str

#define _get_ptp_clock_accuracy_str (   _i)    _get_ptp_clock_accuracy_str( _i, str_unknown )

Definition at line 987 of file cfg_hlp.h.

◆ _get_ptp_clock_accuracy_str_dflt

#define _get_ptp_clock_accuracy_str_dflt (   _i,
  _dflt 
)
Value:
( ( ( (_i) >= PTP_CLOCK_ACCURACY_NUM_BIAS ) && ( (_i) < N_PTP_CLOCK_ACCURACY ) ) ? \
const char * ptp_clock_accuracy_strs[N_PTP_CLOCK_ACCURACY - PTP_CLOCK_ACCURACY_NUM_BIAS]

Definition at line 983 of file cfg_hlp.h.

◆ _get_ptp_delay_mechanism_str

#define _get_ptp_delay_mechanism_str (   _i)    _get_ptp_delay_mechanism_str_dflt( _i, str_unknown )

Definition at line 1001 of file cfg_hlp.h.

◆ _get_ptp_delay_mechanism_str_dflt

#define _get_ptp_delay_mechanism_str_dflt (   _i,
  _dflt 
)    ( ( (_i) < N_PTP_DELAY_MECH ) ? ptp_delay_mechanism_strs[_i] : _dflt )

Definition at line 998 of file cfg_hlp.h.

◆ _get_ptp_nw_protocol_str

#define _get_ptp_nw_protocol_str (   _i)    _get_ptp_nw_protocol_str_dflt(_i, str_unknown )

Definition at line 958 of file cfg_hlp.h.

◆ _get_ptp_nw_protocol_str_dflt

#define _get_ptp_nw_protocol_str_dflt (   _i,
  _dflt 
)    ( ( (_i) < N_PTP_NW_PROT ) ? ptp_nw_protocol_strs[_i] : _dflt )

Definition at line 955 of file cfg_hlp.h.

◆ _get_ptp_port_state_str

#define _get_ptp_port_state_str (   _i)    _get_ptp_port_state_str_dflt( _i, str_unknown )

Definition at line 972 of file cfg_hlp.h.

◆ _get_ptp_port_state_str_dflt

#define _get_ptp_port_state_str_dflt (   _i,
  _dflt 
)    ( ( (_i) < N_PTP_PORT_STATE ) ? ptp_port_state_strs[_i] : _dflt )

Definition at line 969 of file cfg_hlp.h.

◆ _get_ptp_role_str

#define _get_ptp_role_str (   _i)    _get_ptp_role_str_dflt( _i, str_unknown )

Definition at line 944 of file cfg_hlp.h.

◆ _get_ptp_role_str_dflt

#define _get_ptp_role_str_dflt (   _i,
  _dflt 
)    ( ( (_i) < N_PTP_ROLES ) ? ptp_role_strs[_i] : _dflt )

Definition at line 941 of file cfg_hlp.h.

◆ _get_xmr_holdover_status_mode_name

#define _get_xmr_holdover_status_mode_name (   _i)    ( ( (_i) < N_XMR_HOLDOVER_STATUS_MODES ) ? xmr_holdover_status_mode_names[_i] : str_unknown )

Definition at line 930 of file cfg_hlp.h.

Referenced by mbg_get_all_ucap_info().

◆ DEFAULT_MAX_STR_TYPE

#define DEFAULT_MAX_STR_TYPE   2

Definition at line 867 of file cfg_hlp.h.

◆ MAX_EXT_NTP_SERVERS

#define MAX_EXT_NTP_SERVERS   20

The max number of external NTP servers supported by configuration programs.

Definition at line 161 of file cfg_hlp.h.

◆ MAX_MBG_TIME_MON_MODULES

#define MAX_MBG_TIME_MON_MODULES   10

The max. number of time monitoring modules supported by configuration programs Each module may support a different number of targets to be monitored.

See also
### TODO

Definition at line 166 of file cfg_hlp.h.

◆ MAX_MBG_TIME_MON_TARGETS

#define MAX_MBG_TIME_MON_TARGETS   100

The max. number of time monitoring targets supported by configuration programs This is the sum of all targets from all monitoring modules.

See also
### TODO

Definition at line 171 of file cfg_hlp.h.

◆ MAX_PARM_EXT_NTP_SRVR

#define MAX_PARM_EXT_NTP_SRVR   20

The max number of external NTP server associations to be handled by configuration programs.

Definition at line 152 of file cfg_hlp.h.

◆ MAX_PARM_GNSS_SAT

#define MAX_PARM_GNSS_SAT   N_GNSS_TYPES

The max number of GNSS settings supported by configuration programs.

Definition at line 146 of file cfg_hlp.h.

◆ MAX_PARM_GPIO

#define MAX_PARM_GPIO   10

The max number of GPIO ports supported by configuration programs.

Definition at line 155 of file cfg_hlp.h.

◆ MAX_PARM_PORT

#define MAX_PARM_PORT   10

The max number of serial ports supported by configuration programs.

Definition at line 137 of file cfg_hlp.h.

Referenced by check_receiver_info_and_features(), and chk_dev_receiver_info().

◆ MAX_PARM_POUT

#define MAX_PARM_POUT   10

The max number of programmable pulse outputs supported by configuration programs.

Definition at line 143 of file cfg_hlp.h.

Referenced by check_receiver_info_and_features(), and chk_dev_receiver_info().

◆ MAX_PARM_PTP_UC_MASTER

#define MAX_PARM_PTP_UC_MASTER   3

The max number of PTP unicast masters supported by configuration programs.

Definition at line 149 of file cfg_hlp.h.

Referenced by mbg_get_all_ptp_cfg_info().

◆ MAX_PARM_STR_TYPE

#define MAX_PARM_STR_TYPE   20

The max number of serial string types supported by configuration programs.

Definition at line 140 of file cfg_hlp.h.

Referenced by check_receiver_info_and_features(), and chk_dev_receiver_info().

◆ MAX_PARM_XMR

#define MAX_PARM_XMR   10

The max number of XMR sources supported by configuration programs.

Definition at line 158 of file cfg_hlp.h.

◆ MAX_UCAP_ENTRIES

#define MAX_UCAP_ENTRIES   585

Definition at line 599 of file cfg_hlp.h.

Referenced by mbg_get_all_ucap_info().

◆ MBG_EXT_SYS_INFO_CPU_CODECS

#define MBG_EXT_SYS_INFO_CPU_CODECS
Value:
{ \
{HPS_USB_HOST_G1_V0, "microSYNC HSXXX"}, \
{HPS_USB_DEVICE_G1_V0, "HPS100"}, \
{HPS_USB_DEVICE_G1_V1, "SSP100"} \
}
#define HPS_USB_DEVICE_G1_V1
Definition: gpsdefs.h:19402
#define HPS_USB_DEVICE_G1_V0
Definition: gpsdefs.h:19396
#define HPS_USB_HOST_G1_V0
Definition: gpsdefs.h:19390

Do not access array via MBG_EXT_SYS_INFO_CPUS enum. Only use it as lookup table. Initializer for MBG_EXT_SYS_INFO_CPU_CODEC.

Definition at line 772 of file cfg_hlp.h.

◆ N_SUPP_DEV_BUS

#define N_SUPP_DEV_BUS   16

Definition at line 114 of file cfg_hlp.h.

Referenced by main(), mbg_find_devices(), mbg_open_device_by_name(), and pcps_alloc_ddev_struc().

◆ N_SUPP_DEV_EXT

#define N_SUPP_DEV_EXT   1

Definition at line 115 of file cfg_hlp.h.

◆ N_SUPP_DEV_TOTAL

#define N_SUPP_DEV_TOTAL   ( N_SUPP_DEV_BUS + N_SUPP_DEV_EXT )

Definition at line 117 of file cfg_hlp.h.

Referenced by get_fw_id_from_hw_id(), and get_hw_id_from_fw_id().

Typedef Documentation

◆ ALL_GNSS_SAT_INFO_IDX

typedef GNSS_SAT_INFO_IDX ALL_GNSS_SAT_INFO_IDX[N_GNSS_TYPES]

An array of configuration settings for all programmable pulse outputs.

Used to collect all configuration parameters of a clock's programmable pulse outputs that can be handled by a configuration program.

Definition at line 437 of file cfg_hlp.h.

◆ ALL_GPIO_INFO_IDX

typedef MBG_GPIO_INFO_IDX ALL_GPIO_INFO_IDX[10]

Configuration settings for all GPIO ports.

Definition at line 504 of file cfg_hlp.h.

◆ ALL_GPIO_STATUS_IDX

typedef MBG_GPIO_STATUS_IDX ALL_GPIO_STATUS_IDX[10]

Status information on all GPIO ports.

Definition at line 507 of file cfg_hlp.h.

◆ ALL_NET_STATUS_INFO

Definition at line 246 of file cfg_hlp.h.

◆ ALL_NTP_PEER_SETTINGS

typedef NTP_PEER_SETTINGS ALL_NTP_PEER_SETTINGS[20]

Configuration settings for all NTP server associations.

Definition at line 459 of file cfg_hlp.h.

◆ ALL_PORT_INFO_IDX

typedef PORT_INFO_IDX ALL_PORT_INFO_IDX[10]

An array of configuration settings for all serial ports.

Definition at line 176 of file cfg_hlp.h.

◆ ALL_POUT_INFO_IDX

typedef POUT_INFO_IDX ALL_POUT_INFO_IDX[10]

An array of configuration settings for all programmable pulse outputs.

Used to collect all configuration parameters of a clock's programmable pulse outputs that can be handled by a configuration program.

See also
RECEIVER_INFO::n_prg_out

Definition at line 224 of file cfg_hlp.h.

◆ ALL_PTP_UC_MASTER_INFO_IDX

typedef PTP_UC_MASTER_INFO_IDX ALL_PTP_UC_MASTER_INFO_IDX[3]

Configuration settings for all unicast master specifications.

Definition at line 358 of file cfg_hlp.h.

◆ ALL_STR_TYPE_INFO_IDX

typedef STR_TYPE_INFO_IDX ALL_STR_TYPE_INFO_IDX[20]

An array of configuration settings for all serial string types.

Definition at line 179 of file cfg_hlp.h.

◆ ALL_XMULTI_REF_INFO_IDX

typedef XMULTI_REF_INFO_IDX ALL_XMULTI_REF_INFO_IDX[10]

Configuration settings for all XMR inputs.

Definition at line 516 of file cfg_hlp.h.

◆ ALL_XMULTI_REF_STATUS_IDX

typedef XMULTI_REF_STATUS_IDX ALL_XMULTI_REF_STATUS_IDX[10]

Status of all XMR inputs.

Definition at line 513 of file cfg_hlp.h.

◆ DEVICE_INFO

typedef struct _DEVICE_INFO DEVICE_INFO

◆ MBG_DATABASE

typedef struct mbg_database MBG_DATABASE

◆ MBG_EVENT

typedef struct mbg_event MBG_EVENT

All monitoring event data.

Used to collect all event data and group related chunks senseful to a single event so all data is in one struct.

◆ MBG_FIRMWARE

typedef struct mbg_firmware MBG_FIRMWARE

◆ MBG_FIRMWARE_UFU

◆ MBG_IO_PORT

typedef struct mbg_io_port MBG_IO_PORT

◆ MBG_SERVICE

typedef struct mbg_service MBG_SERVICE

◆ MBG_SYSLOG_SERVER

All monitoring syslog data.

Used to collect all syslog data.

◆ MBG_USER

typedef struct mbg_user MBG_USER

Enumeration Type Documentation

◆ COMP_SIG_MODES

A mode specifying how to interpret a PCPS_SIG_VAL.

Used with PCPS_TIME_EXT::comp_sig_mode. Depending on this mode a signal value can be interpreted e.g. as signal strength (with long wave or IRIG time code receivers), or as indicator whether an antenna is connected (satellite receivers), or a network link is available (PTP slaves) or not, and an appropriate status message can be displayed.

See also
PCPS_SIG_VAL_DEFS
Enumerator
COMP_SIG_MODE_NONE 

signal value not used

COMP_SIG_MODE_SIGNAL 

input signal strength

COMP_SIG_MODE_ANT_CONN 

antenna connection state

COMP_SIG_MODE_PORT_LINK 

port link state

N_CONN_SIG_MODES 

Definition at line 792 of file cfg_hlp.h.

◆ PCPS_TIME_EXT_FLAG_BITS

Flag bits indicating if some extended status is available.

See also
PCPS_TIME_EXT_FLAGS
Enumerator
PCPS_TIME_EXT_FLAG_BIT_UTC_VALID 

PCPS_TIME_EXT::utc_offs field is valid

N_PCPS_TIME_EXT_FLAG_BITS 

Definition at line 807 of file cfg_hlp.h.

◆ PCPS_TIME_EXT_FLAGS

Flag masks used with PCPS_TIME_EXT::flags.

See also
PCPS_TIME_EXT_FLAG_BITS
Enumerator
PCPS_TIME_EXT_FLAG_UTC_VALID 

see PCPS_TIME_EXT_FLAG_BIT_UTC_VALID

Definition at line 819 of file cfg_hlp.h.

Function Documentation

◆ alloc_dev_hw_id()

int alloc_dev_hw_id ( DEVICE_INFO p,
size_t  len 
)

Definition at line 515 of file cfg_hlp.c.

References _DEVICE_INFO::hw_id, MBG_ERR_ALREADY_ALLOC, MBG_ERR_NO_MEM, and MBG_SUCCESS.

Referenced by mbg_tlv_create_id().

◆ calloc_ucap_entry()

UCAP_ENTRY* calloc_ucap_entry ( void  )

Allocates memory for a new UCAP_ENTRY structure

Returns
The new allocated UCAP_ENTRY or NULL if the calloc call was not successful

Definition at line 1531 of file cfg_hlp.c.

References UCAP_ENTRY::head, and mbg_klist_init().

Referenced by mbg_get_all_ucap_info(), and mbg_tlv_create_id().

◆ check_valid_port_info()

◆ chk_dev_gpio_dep_on_ass_idx()

_NO_MBG_API_ATTR int _MBG_API chk_dev_gpio_dep_on_ass_idx ( const ALL_GPIO_INFO gpio_info,
unsigned  idx 
)

◆ chk_dev_gpio_has_status()

_NO_MBG_API_ATTR int _MBG_API chk_dev_gpio_has_status ( const ALL_GPIO_INFO info)

Checks whether GPIO supports status function.

Parameters
[out]infoPointer to a ALL_GPIO_INFO structure to be filled up
Returns
One of the MBG_RETURN_CODES
See also
mbgextio_dev_has_gpio
mbg_chk_dev_has_gpio
free_all_gpio_info

Definition at line 974 of file cfg_hlp.c.

References ALL_GPIO_INFO::cfg_limits, MBG_GPIO_CFG_LIMITS::flags, MBG_ERR_NOT_SUPP_BY_DEV, MBG_GPIO_CFG_LIMIT_FLAG_MASK_STATUS_SUPP, and MBG_SUCCESS.

Referenced by mbg_tlv_create_id().

◆ chk_dev_gpio_supp_ass_idx()

◆ chk_dev_ims_has_fdm()

_NO_MBG_API_ATTR int _MBG_API chk_dev_ims_has_fdm ( const ALL_IMS_INFO info)

◆ chk_dev_ims_is_pll_locked()

◆ chk_dev_ims_is_volt_out_enabled()

◆ chk_dev_ims_is_volt_out_overload()

◆ chk_dev_net_cfg_supp_stage_2()

◆ chk_dev_ntp_supp_client()

◆ chk_dev_ntp_supp_server()

◆ chk_dev_receiver_info()

◆ chk_dev_xbp_supp_nodes()

_NO_MBG_API_ATTR int _MBG_API chk_dev_xbp_supp_nodes ( const ALL_XBP_INFO info)

◆ chk_dev_xmulti_ref_supp_ext_source_metrics()

◆ chk_dev_xmulti_ref_supp_ext_source_stats()

◆ chk_dev_xmulti_ref_supp_ext_src_info()

◆ chk_dev_xmulti_ref_supp_holdover_status()

_NO_MBG_API_ATTR int _MBG_API chk_dev_xmulti_ref_supp_holdover_status ( const ALL_XMULTI_REF_INFO info)

◆ chk_dev_xmulti_ref_supp_mrf_none()

_NO_MBG_API_ATTR int _MBG_API chk_dev_xmulti_ref_supp_mrf_none ( const ALL_XMULTI_REF_INFO info)

◆ chk_free_dev_hw_id()

void chk_free_dev_hw_id ( DEVICE_INFO p)

Definition at line 502 of file cfg_hlp.c.

References _DEVICE_INFO::hw_id.

Referenced by mbg_tlv_create_id().

◆ chk_set_n_gnss_supp()

◆ chk_sw_rev_name()

int chk_sw_rev_name ( SW_REV p,
int  verbose 
)

Check if a software revision name should be displayed.

The software revision name is usually empty, except if the firmware is a customized version, in which case the field contains an identifier string.

There are some standard firmware versions where this string is not empty but padded with spaces, etc., so we try to clean this up and display the string properly, if appropriate.

Parameters
[in,out]pThe SW_REV name to check
[in]verboseThe app's verbosity level
Returns
!= 0 if SW name should be displayed

Definition at line 89 of file cfg_hlp.c.

References SW_REV::name, and trim_whitespace().

Referenced by mbg_get_show_dev_info(), and mbg_tlv_create_id().

◆ device_id_is_lan()

static __mbg_inline bool device_id_is_lan ( const char *  dev_id)
static

Check if a device ID refers to a LAN connection.

Parameters
[in]dev_idA string with the device ID
Returns
true if the device id specifies a LAN connection, else false

Definition at line 1098 of file cfg_hlp.h.

◆ device_id_is_serial()

static __mbg_inline bool device_id_is_serial ( const char *  dev_id)
static

Check if a device ID refers to a serial port.

Parameters
[in]dev_idA string with the device name or port name
See also
DEFAULT_SERIAL_DEVICE_NAME
Returns
true if the device id contains the name of a serial port, else false

Definition at line 1055 of file cfg_hlp.h.

Referenced by mbg_str_dev_name().

◆ free_all_database_info()

void free_all_database_info ( ALL_DATABASE_INFO p)

Free an ALL_DATABASE_INFO structure.

Parameters
[in]pPointer to the ALL_DATABASE_INFO structure to be freed
See also
mbgextio_get_all_database_info

Definition at line 1722 of file cfg_hlp.c.

References ALL_DATABASE_INFO::dbs, ALL_DATABASE_INFO::glb_info, MBG_DATABASE_GLB_INFO::num_dbs, and mbg_database::release_priv.

Referenced by mbg_tlv_create_id().

◆ free_all_events()

void free_all_events ( ALL_EVENTS p)

Free an ALL_EVENTS structure.

Parameters
[in]pPointer to the ALL_EVENTS structure to be freed

Definition at line 1170 of file cfg_hlp.c.

References mbg_event::dict_entries, ALL_EVENTS::events, ALL_EVENTS::num_events, mbg_event::release_backref, and mbg_event::release_priv.

Referenced by free_all_monitoring_info(), and mbg_tlv_create_id().

◆ free_all_firmware_info()

◆ free_all_gpio_info()

void free_all_gpio_info ( ALL_GPIO_INFO p)

Free memory allocated by mbgextio_get_all_gpio_info.

Parameters
[in]pPointer to the ALL_GPIO_INFO structure to be freed
Returns
One of the MBG_RETURN_CODES
See also
mbgextio_dev_has_gpio
mbgextio_get_all_gpio_info

Definition at line 1445 of file cfg_hlp.c.

References ALL_GPIO_INFO::infos.

Referenced by mbg_tlv_create_id().

◆ free_all_gpio_state()

void free_all_gpio_state ( ALL_GPIO_STATE p)

Free memory allocated by mbgextio_get_all_gpio_state.

Parameters
[in]pPointer to the ALL_GPIO_STATE structure to be freed
Returns
One of the MBG_RETURN_CODES
See also
mbgextio_dev_has_gpio
mbgextio_get_all_gpio_state

Definition at line 1511 of file cfg_hlp.c.

References ALL_GPIO_STATE::states.

Referenced by mbg_tlv_create_id().

◆ free_all_ims_info()

void free_all_ims_info ( ALL_IMS_INFO p)

Free memory allocated by mbgextio_get_all_ims_info.

Parameters
[in]pPointer to the ALL_IMS_INFO structure to be freed
See also
mbgextio_dev_has_ims
mbgextio_get_all_ims_info
mbgextio_get_all_ims_state

Definition at line 1384 of file cfg_hlp.c.

References ALL_IMS_INFO::fdm_info, ALL_IMS_INFO::fdm_limits, and ALL_IMS_INFO::fdm_outinfo_idx.

Referenced by mbg_tlv_create_id().

◆ free_all_ims_state()

void free_all_ims_state ( ALL_IMS_STATE p)

Free memory allocated by mbgextio_get_all_ims_state.

Parameters
[in]pPointer to the ALL_IMS_STATE structure to be freed
See also
mbgextio_dev_has_ims
mbgextio_get_all_ims_info
mbgextio_get_all_ims_state

Definition at line 1414 of file cfg_hlp.c.

References ALL_IMS_STATE::fdm_output_state_idx, ALL_IMS_STATE::fdm_state, and ALL_IMS_STATE::sensor_state_idx.

Referenced by mbg_tlv_create_id().

◆ free_all_io_ports()

void free_all_io_ports ( ALL_MBG_IO_PORTS p)

◆ free_all_monitoring_info()

void free_all_monitoring_info ( ALL_MONITORING_INFO p)

◆ free_all_net_cfg_info()

void free_all_net_cfg_info ( ALL_NET_CFG_INFO p)

◆ free_all_net_status_info()

void free_all_net_status_info ( ALL_NET_STATUS_INFO p)

◆ free_all_ntp_cfg_info()

◆ free_all_ntp_status()

void free_all_ntp_status ( ALL_NTP_STATUS p)

Free an ALL_NTP_STATUS structure.

Parameters
[in]pPointer to the ALL_NTP_STATUS structure to be freed
See also
mbgextio_get_all_ntp_status

Definition at line 1357 of file cfg_hlp.c.

References ALL_NTP_STATUS::peer_states, and ALL_NTP_STATUS::refclk_states.

Referenced by mbg_tlv_create_id().

◆ free_all_ptp_v1_common_datasets()

void free_all_ptp_v1_common_datasets ( ALL_PTP_V1_COMMON_DATASETS p)

Free an ALL_PTP_V1_COMMON_DATASETS structure allocated by mbgextio_get_all_ptp_v1_common_datasets.

Parameters
[in]pPointer to the ALL_PTP_V1_COMMON_DATASETS structure to be freed
See also
mbgextio_get_all_ptp_v1_common_datasets

Definition at line 1267 of file cfg_hlp.c.

References ALL_PTP_V1_COMMON_DATASETS::port_datasets.

Referenced by mbg_tlv_create_id().

◆ free_all_ptp_v2_common_datasets()

void free_all_ptp_v2_common_datasets ( ALL_PTP_V2_COMMON_DATASETS p)

Free an ALL_PTP_V2_COMMON_DATASETS structure allocated by mbgextio_get_all_ptp_v2_common_datasets.

Parameters
[in]pPointer to the ALL_PTP_V2_COMMON_DATASETS structure to be freed
See also
mbgextio_get_all_ptp_v2_common_datasets

Definition at line 1289 of file cfg_hlp.c.

References ALL_PTP_V2_COMMON_DATASETS::port_datasets.

Referenced by mbg_tlv_create_id().

◆ free_all_snmp_info()

void free_all_snmp_info ( ALL_SNMP_INFO p)

Free an ALL_SNMP_INFO structure.

Parameters
[in]pPointer to the ALL_SNMP_INFO structure to be freed

Definition at line 1084 of file cfg_hlp.c.

References ALL_SNMP_INFO::v12_infos, ALL_SNMP_INFO::v12_trap_infos, ALL_SNMP_INFO::v3_infos, and ALL_SNMP_INFO::v3_trap_infos.

Referenced by free_all_monitoring_info(), and mbg_tlv_create_id().

◆ free_all_svc_info()

void free_all_svc_info ( ALL_SERVICE_INFO p)

Free an ALL_SERVICE_INFO structure.

Parameters
[in]pPointer to the ALL_SERVICE_INFO structure to be freed
See also
mbgextio_get_all_user_info

Definition at line 1642 of file cfg_hlp.c.

References ALL_SERVICE_INFO::mgmt_info, MBG_SERVICE_MGMT_INFO::num_services, mbg_service::release_backref, mbg_service::release_priv, and ALL_SERVICE_INFO::svcs.

Referenced by mbg_tlv_create_id().

◆ free_all_syslog_info()

void free_all_syslog_info ( ALL_SYSLOG_INFO p)

◆ free_all_ucap_info()

void free_all_ucap_info ( ALL_UCAP_INFO p)

◆ free_all_ucap_net_info()

void free_all_ucap_net_info ( ALL_UCAP_NET_INFO p)

Free an ALL_UCAP_NET_INFO structure.

Parameters
[in]pPointer to the ALL_UCAP_NET_INFO structure to be freed
See also
mbgextio_get_all_ucap_net_info

Definition at line 1583 of file cfg_hlp.c.

References ALL_UCAP_NET_INFO::recv_infos.

Referenced by mbg_tlv_create_id().

◆ free_all_user_info()

void free_all_user_info ( ALL_USER_INFO p)

◆ free_all_xbp_info()

void free_all_xbp_info ( ALL_XBP_INFO p)

Free an ALL_XBP_INFO structure.

Parameters
[in]pPointer to the ALL_XBP_INFO structure to be freed
See also
mbgextio_get_all_xbp_info

Definition at line 993 of file cfg_hlp.c.

References ALL_XBP_INFO::node_infos, and ALL_XBP_INFO::node_limits.

Referenced by mbg_tlv_create_id().

◆ free_all_xmulti_ref_info()

void free_all_xmulti_ref_info ( ALL_XMULTI_REF_INFO p)

Free an ALL_XMULTI_REF_INFO structure.

Parameters
[in]pPointer to the ALL_XMULTI_REF_INFO structure to be freed
See also
mbgextio_get_all_xmulti_ref_info
mbg_get_all_xmulti_ref_info

Definition at line 1210 of file cfg_hlp.c.

References ALL_XMULTI_REF_INFO::ext_src_infos, and ALL_XMULTI_REF_INFO::infos.

Referenced by mbg_get_all_xmulti_ref_info(), and mbg_tlv_create_id().

◆ free_all_xmulti_ref_status()

◆ get_baud_rate_idx()

int get_baud_rate_idx ( BAUD_RATE  baud_rate)

◆ get_framing_idx()

int get_framing_idx ( const char *  framing)

◆ get_fw_id_from_hw_id()

const char* get_fw_id_from_hw_id ( const char *  hw_id)

Definition at line 533 of file cfg_hlp.c.

References device_list, _DEVICE_INFO::fw_id, _DEVICE_INFO::hw_id, and N_SUPP_DEV_TOTAL.

Referenced by mbg_tlv_create_id().

◆ get_hw_id_from_fw_id()

const char* get_hw_id_from_fw_id ( const char *  fw_id)

Definition at line 563 of file cfg_hlp.c.

References device_list, _DEVICE_INFO::fw_id, _DEVICE_INFO::hw_id, and N_SUPP_DEV_TOTAL.

Referenced by mbg_tlv_create_id().

◆ get_io_port_type_info()

MBG_IO_PORT_TYPE_INFO* get_io_port_type_info ( const MBG_IO_PORT port,
uint16_t  port_type 
)

◆ get_str_idx()

int get_str_idx ( const char *  search,
const char *  str_table[],
int  n_entries 
)

Definition at line 113 of file cfg_hlp.c.

Referenced by get_framing_idx(), and mbg_tlv_create_id().

◆ mbg_snprint_revision()

int mbg_snprint_revision ( char *  buf,
size_t  buflen,
const char *  prefix,
const char *  suffix,
uint32_t  rev 
)

Definition at line 709 of file cfg_hlp.c.

References _int_from_size_t, _mbg_decode_revision, major, minor, and snprintf_safe().

Referenced by mbg_tlv_create_id().

◆ mbg_tlv_announce_init()

void mbg_tlv_announce_init ( MBG_TLV_ANNOUNCE tlv,
MBG_TLV_UID  uid,
MBG_TLV_TYPE  tlv_feat_type,
uint32_t  total_bytes 
)

Initializes a MBG_TLV_ANNOUNCE structure.

Parameters
[out]tlvPointer to a MBG_TLV_ANNOUNCE structure
[in]uidUnique sender ID used as identifier with all subsequent messages related to this transaction.
[in]tlv_feat_typeOne of the MBG_TLV_FEAT_TYPES
[in]total_bytesTotal number of bytes of all upcoming TLVs

Definition at line 642 of file cfg_hlp.c.

References MBG_TLV_ANNOUNCE::data, MBG_TLV_DATA::reserved_1, MBG_TLV_ANNOUNCE::reserved_1, MBG_TLV_ANNOUNCE::reserved_2, MBG_TLV_DATA::total_bytes, MBG_TLV_DATA::type, and MBG_TLV_DATA::uid.

Referenced by mbg_tlv_create_id().

◆ mbg_tlv_create_id()

static __mbg_inline MBG_TLV_UID mbg_tlv_create_id ( void  )
static

FIXME for FreeBSD and Windows

Definition at line 1111 of file cfg_hlp.h.

References _MBG_API, _NO_MBG_API_ATTR, alloc_dev_hw_id(), calloc_ucap_entry(), check_valid_port_info(), chk_dev_gpio_dep_on_ass_idx(), chk_dev_gpio_has_status(), chk_dev_gpio_supp_ass_idx(), chk_dev_ims_has_fdm(), chk_dev_ims_is_pll_locked(), chk_dev_ims_is_volt_out_enabled(), chk_dev_ims_is_volt_out_overload(), chk_dev_net_cfg_supp_stage_2(), chk_dev_ntp_supp_client(), chk_dev_ntp_supp_server(), chk_dev_receiver_info(), chk_dev_xbp_supp_nodes(), chk_dev_xmulti_ref_supp_ext_source_metrics(), chk_dev_xmulti_ref_supp_ext_source_stats(), chk_dev_xmulti_ref_supp_ext_src_info(), chk_dev_xmulti_ref_supp_holdover_status(), chk_dev_xmulti_ref_supp_mrf_none(), chk_free_dev_hw_id(), chk_set_n_gnss_supp(), chk_sw_rev_name(), free_all_database_info(), free_all_events(), free_all_firmware_info(), free_all_gpio_info(), free_all_gpio_state(), free_all_ims_info(), free_all_ims_state(), free_all_io_ports(), free_all_monitoring_info(), free_all_net_cfg_info(), free_all_net_status_info(), free_all_ntp_cfg_info(), free_all_ntp_status(), free_all_ptp_v1_common_datasets(), free_all_ptp_v2_common_datasets(), free_all_snmp_info(), free_all_svc_info(), free_all_syslog_info(), free_all_ucap_info(), free_all_ucap_net_info(), free_all_user_info(), free_all_xbp_info(), free_all_xmulti_ref_info(), free_all_xmulti_ref_status(), _DEVICE_INFO::fw_id, get_baud_rate_idx(), get_framing_idx(), get_fw_id_from_hw_id(), get_hw_id_from_fw_id(), get_io_port_type_info(), get_str_idx(), _DEVICE_INFO::hw_id, mbg_database::idx, mbg_database::info, mbg_snprint_revision(), mbg_tlv_announce_init(), mbg_tlv_init(), mbg_tlv_rcv_state_init(), ntp_tstamp_to_nanotime_64(), port_parm_from_port_settings(), port_parm_mode_from_port_settings(), port_settings_from_port_parm(), port_settings_from_port_parm_mode(), setup_default_str_type_info_idx(), setup_gps_only_gnss_info_from_statinfo(), setup_gps_only_sat_info_idx_from_statinfo(), setup_port_info_from_port_parm(), str_ntp_hex_to_nano_time_64(), str_ntp_hex_to_ntp_tstamp(), valid_port_info(), and verbose.

◆ mbg_tlv_init()

void mbg_tlv_init ( MBG_TLV tlv,
MBG_TLV_UID  uid,
MBG_TLV_TYPE  tlv_type,
uint32_t  total_bytes 
)

Initializes a MBG_TLV.

Parameters
[out]tlvPointer to a valid MBG_TLV structure
[in]uidUnique sender ID used as identifier for each further TLV message related to this type.
[in]tlv_typeType identifier, see MBG_TLV_TYPES
[in]total_bytesTotal number of bytes belonging to this TLV transaction (which is very likely split into several TLVs)

Definition at line 668 of file cfg_hlp.c.

References MBG_TLV_HDR::cur_bytes, MBG_TLV::hdr, MBG_TLV_HDR::reserved_1, MBG_TLV_HDR::reserved_2, MBG_TLV_HDR::reserved_3, MBG_TLV_HDR::tlv_type, MBG_TLV_HDR::total_bytes, MBG_TLV_HDR::trans_bytes, and MBG_TLV_HDR::uid.

Referenced by mbg_tlv_create_id().

◆ mbg_tlv_rcv_state_init()

void mbg_tlv_rcv_state_init ( MBG_TLV_RCV_STATE state,
MBG_TLV_UID  uid,
uint32_t  total_bytes 
)

Initializes MBG_TLV_RCV_STATE structure.

Parameters
[in,out]statePointer to MBG_TLV_RCV_STATE structure
[in]uidUnique sender ID used as identifier for each further TLV message related to this type.
[in]total_bytesTotal number of bytes belonging to this TLV transaction (which is very likely split into several TLVS)

Definition at line 695 of file cfg_hlp.c.

References MBG_TLV_RCV_STATE::data, MBG_TLV_RCV_STATE::read_bytes, MBG_TLV_DATA::reserved_1, MBG_TLV_RCV_STATE::reserved_1, MBG_TLV_DATA::total_bytes, MBG_TLV_DATA::type, and MBG_TLV_DATA::uid.

Referenced by mbg_tlv_create_id().

◆ ntp_tstamp_to_nanotime_64()

void ntp_tstamp_to_nanotime_64 ( const NTP_TSTAMP p_nts,
NANO_TIME_64 p_nt64 
)

Convert a NTP_TSTAMP structure to a NANO_TIME_64 structure.

Parameters
[in]p_ntsThe NTP_TSTAMP structure to be converted
[out]p_nt64The NANO_TIME_64 structure to be filled up

Definition at line 1787 of file cfg_hlp.c.

References bin_frac_32_to_dec_frac(), NTP_TSTAMP::fractions, NANO_TIME_64::nano_secs, NSEC_PER_SEC, NTP_SEC_BIAS, NTP_TSTAMP::seconds, and NANO_TIME_64::secs.

Referenced by mbg_tlv_create_id(), and str_ntp_hex_to_nano_time_64().

◆ num_bits_set()

static __mbg_inline int num_bits_set ( long  val)
static

Count the number of bits which are not 0.

Parameters
[in]valValue to be tested
Returns
The number of non-zero bits in val

Definition at line 1024 of file cfg_hlp.h.

Referenced by chk_set_n_gnss_supp(), mbg_get_gps_all_gnss_sat_info(), mbgextio_get_all_gnss_sat_info(), and mbgextio_get_gnss_sv_status_idx().

◆ setup_default_str_type_info_idx()

int setup_default_str_type_info_idx ( STR_TYPE_INFO_IDX  stii[],
const RECEIVER_INFO p_ri 
)

◆ setup_gps_only_gnss_info_from_statinfo()

int setup_gps_only_gnss_info_from_statinfo ( ALL_GNSS_INFO p_agi)

◆ setup_gps_only_sat_info_idx_from_statinfo()

void setup_gps_only_sat_info_idx_from_statinfo ( ALL_GNSS_INFO p_agi)

◆ str_ntp_hex_to_nano_time_64()

void str_ntp_hex_to_nano_time_64 ( const char *  s,
NANO_TIME_64 p 
)

Set up a NANO_TIME_64 structure from a hex string with a time in seconds and binary fractions.

Parameters
[in]sA string with a time in seconds since epoch 1900-01-01, with binary fractions separated by decimal point, e.g. 'dc763e43.73bd5a8f' as printed by the ntpq utility
[out]pAddress of a NANO_TIME_64 structure to be set up
See also
str_ntp_hex_to_ntp_tstamp

Definition at line 1807 of file cfg_hlp.c.

References ntp_tstamp_to_nanotime_64(), and str_ntp_hex_to_ntp_tstamp().

Referenced by mbg_tlv_create_id().

◆ str_ntp_hex_to_ntp_tstamp()

void str_ntp_hex_to_ntp_tstamp ( const char *  s,
NTP_TSTAMP p 
)

Set up a NTP_TSTAMP structure from a hex string with a time in seconds and binary fractions.

Parameters
[in]sA string with a time in seconds since NTP epoch 1900-01-01, with binary fractions separated by decimal point, e.g. 'dc763e43.73bd5a8f' as printed by the ntpq utility
[out]pAddress of a NTP_TSTAMP structure to be set up
See also
str_ntp_hex_to_nano_time_64

Definition at line 1759 of file cfg_hlp.c.

References NTP_TSTAMP::fractions, and NTP_TSTAMP::seconds.

Referenced by mbg_tlv_create_id(), and str_ntp_hex_to_nano_time_64().

◆ valid_port_info()

int valid_port_info ( const PORT_INFO p_pi,
const STR_TYPE_INFO_IDX  str_type_info_idx[],
int  n_str_type 
)

Definition at line 367 of file cfg_hlp.c.

References check_valid_port_info().

Referenced by mbg_tlv_create_id().

Variable Documentation

◆ default_str_type_info

STR_TYPE_INFO default_str_type_info[2]

◆ device_list

DEVICE_INFO device_list[( 16+ 1)]

◆ mbg_baud_rate_strs

const char* mbg_baud_rate_strs[N_MBG_BAUD_RATES]

Referenced by usage().

◆ mbg_baud_rates

◆ mbg_framing_strs

◆ mbg_gpio_fixed_freq_strs

const char* mbg_gpio_fixed_freq_strs[N_MBG_GPIO_FIXED_FREQ]

◆ mbg_gpio_port_state_names

const char* mbg_gpio_port_state_names[N_MBG_GPIO_PORT_STATES]

◆ mbg_gpio_signal_shape_names

const char* mbg_gpio_signal_shape_names[N_MBG_GPIO_SIGNAL_SHAPES]

◆ mbg_gpio_type_names

const char* mbg_gpio_type_names[N_MBG_GPIO_TYPES]

◆ ptp_clock_accuracy_strs

const char* ptp_clock_accuracy_strs[N_PTP_CLOCK_ACCURACY - PTP_CLOCK_ACCURACY_NUM_BIAS]

Referenced by show_ptp_state().

◆ ptp_delay_mechanism_strs

const char* ptp_delay_mechanism_strs[N_PTP_DELAY_MECH]

◆ ptp_nw_protocol_strs

const char* ptp_nw_protocol_strs[N_PTP_NW_PROT]

◆ ptp_port_state_strs

const char* ptp_port_state_strs[N_PTP_PORT_STATE]

◆ ptp_role_strs

const char* ptp_role_strs[N_PTP_ROLES]

Referenced by show_ptp_state().

◆ ptp_time_source_table

const PTP_TABLE ptp_time_source_table[]

◆ str_not_spc

const char* str_not_spc

Referenced by mbg_get_all_ucap_info(), and show_pout().

◆ str_undefined

const char* str_undefined

Referenced by show_ptp_state().

◆ str_unknown

const char* str_unknown

◆ xmr_holdover_status_mode_names

const char* xmr_holdover_status_mode_names[N_XMR_HOLDOVER_STATUS_MODES]