mbgtools-lx
4.2.8
|
#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... | |
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 [] |
#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().
#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().
#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().
#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().
#define _get_ptp_clock_accuracy_str | ( | _i | ) | _get_ptp_clock_accuracy_str( _i, str_unknown ) |
#define _get_ptp_clock_accuracy_str_dflt | ( | _i, | |
_dflt | |||
) |
#define _get_ptp_delay_mechanism_str | ( | _i | ) | _get_ptp_delay_mechanism_str_dflt( _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_nw_protocol_str | ( | _i | ) | _get_ptp_nw_protocol_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_port_state_str | ( | _i | ) | _get_ptp_port_state_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_role_str | ( | _i | ) | _get_ptp_role_str_dflt( _i, str_unknown ) |
#define _get_ptp_role_str_dflt | ( | _i, | |
_dflt | |||
) | ( ( (_i) < N_PTP_ROLES ) ? ptp_role_strs[_i] : _dflt ) |
#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().
#define MAX_EXT_NTP_SERVERS 20 |
#define MAX_MBG_TIME_MON_MODULES 10 |
#define MAX_MBG_TIME_MON_TARGETS 100 |
#define MAX_PARM_EXT_NTP_SRVR 20 |
#define MAX_PARM_GNSS_SAT N_GNSS_TYPES |
#define MAX_PARM_GPIO 10 |
#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().
#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().
#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().
#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().
#define MAX_PARM_XMR 10 |
#define MAX_UCAP_ENTRIES 585 |
Definition at line 599 of file cfg_hlp.h.
Referenced by mbg_get_all_ucap_info().
#define MBG_EXT_SYS_INFO_CPU_CODECS |
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.
#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().
#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 GNSS_SAT_INFO_IDX ALL_GNSS_SAT_INFO_IDX[N_GNSS_TYPES] |
typedef MBG_GPIO_INFO_IDX ALL_GPIO_INFO_IDX[10] |
typedef MBG_GPIO_STATUS_IDX ALL_GPIO_STATUS_IDX[10] |
typedef ALL_NET_CFG_INFO ALL_NET_STATUS_INFO |
typedef NTP_PEER_SETTINGS ALL_NTP_PEER_SETTINGS[20] |
typedef PORT_INFO_IDX ALL_PORT_INFO_IDX[10] |
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.
typedef PTP_UC_MASTER_INFO_IDX ALL_PTP_UC_MASTER_INFO_IDX[3] |
typedef STR_TYPE_INFO_IDX ALL_STR_TYPE_INFO_IDX[20] |
typedef XMULTI_REF_INFO_IDX ALL_XMULTI_REF_INFO_IDX[10] |
typedef XMULTI_REF_STATUS_IDX ALL_XMULTI_REF_STATUS_IDX[10] |
typedef struct _DEVICE_INFO DEVICE_INFO |
typedef struct mbg_database MBG_DATABASE |
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.
typedef struct mbg_firmware MBG_FIRMWARE |
typedef struct mbg_firmware_ufu MBG_FIRMWARE_UFU |
typedef struct mbg_io_port MBG_IO_PORT |
typedef struct mbg_service MBG_SERVICE |
typedef struct mbg_syslog_server MBG_SYSLOG_SERVER |
All monitoring syslog data.
Used to collect all syslog data.
enum 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.
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 |
Flag bits indicating if some extended status is available.
Enumerator | |
---|---|
PCPS_TIME_EXT_FLAG_BIT_UTC_VALID | PCPS_TIME_EXT::utc_offs field is valid |
N_PCPS_TIME_EXT_FLAG_BITS |
enum PCPS_TIME_EXT_FLAGS |
Flag masks used with PCPS_TIME_EXT::flags.
Enumerator | |
---|---|
PCPS_TIME_EXT_FLAG_UTC_VALID |
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().
UCAP_ENTRY* calloc_ucap_entry | ( | void | ) |
Allocates memory for a new UCAP_ENTRY structure
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().
uint32_t check_valid_port_info | ( | const PORT_INFO * | p_pi, |
const STR_TYPE_INFO_IDX | str_type_info_idx[], | ||
int | n_str_type | ||
) |
Definition at line 287 of file cfg_hlp.c.
References _inrange, _is_supported, _mask, COM_PARM::baud_rate, PORT_SETTINGS::flags, COM_PARM::framing, get_baud_rate_idx(), get_framing_idx(), COM_PARM::handshake, HS_NONE, MBG_PS_MSK_BAUD_RATE, MBG_PS_MSK_BAUD_RATE_OVR_SW, MBG_PS_MSK_FLAGS, MBG_PS_MSK_FLAGS_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, MBG_PS_MSK_STR_TYPE_OVR_SW, PORT_SETTINGS::mode, N_COM_HS, N_MBG_BAUD_RATES, N_MBG_FRAMINGS, N_STR_MODE, PORT_SETTINGS::parm, PORT_INFO::port_settings, PORT_SETTINGS::str_type, STR_TYPE_INFO_IDX::str_type_info, PORT_INFO::supp_baud_rates, PORT_INFO::supp_framings, STR_TYPE_INFO::supp_modes, and PORT_INFO::supp_str_types.
Referenced by mbg_tlv_create_id(), save_serial_settings(), and valid_port_info().
_NO_MBG_API_ATTR int _MBG_API chk_dev_gpio_dep_on_ass_idx | ( | const ALL_GPIO_INFO * | gpio_info, |
unsigned | idx | ||
) |
Definition at line 950 of file cfg_hlp.c.
References MBG_GPIO_SETTINGS::flags, MBG_GPIO_INFO_IDX::info, ALL_GPIO_INFO::infos, MBG_ERR_NOT_SUPP_BY_DEV, MBG_SUCCESS, MSK_MBG_GPIO_DEPENDS_ON_ASS_IO_IDX, and MBG_GPIO_INFO::settings.
Referenced by mbg_tlv_create_id().
_NO_MBG_API_ATTR int _MBG_API chk_dev_gpio_has_status | ( | const ALL_GPIO_INFO * | info | ) |
Checks whether GPIO supports status function.
[out] | info | Pointer to a ALL_GPIO_INFO structure to be filled up |
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().
_NO_MBG_API_ATTR int _MBG_API chk_dev_gpio_supp_ass_idx | ( | const ALL_GPIO_INFO * | gpio_info, |
unsigned | idx | ||
) |
Definition at line 937 of file cfg_hlp.c.
References MBG_GPIO_INFO_IDX::info, ALL_GPIO_INFO::infos, MBG_GPIO_INFO::limits, MBG_ERR_NOT_SUPP_BY_DEV, MBG_SUCCESS, MSK_MBG_GPIO_DEPENDS_ON_ASS_IO_IDX, and MBG_GPIO_LIMITS::supp_flags.
Referenced by mbg_tlv_create_id().
_NO_MBG_API_ATTR int _MBG_API chk_dev_ims_has_fdm | ( | const ALL_IMS_INFO * | info | ) |
Definition at line 881 of file cfg_hlp.c.
References MBG_IMS_STATE::flags, MBG_ERR_NOT_SUPP_BY_DEV, MBG_IMS_STATE_FLAG_MSK_HAS_FDM, MBG_SUCCESS, and ALL_IMS_INFO::state.
Referenced by mbg_tlv_create_id().
_NO_MBG_API_ATTR int _MBG_API chk_dev_ims_is_pll_locked | ( | const ALL_IMS_STATE * | ims_state, |
unsigned | idx | ||
) |
Definition at line 922 of file cfg_hlp.c.
References MBG_IMS_SENSOR_STATE::flags, MBG_ERR_NOT_SUPP_BY_DEV, MBG_IMS_SENSOR_PLL, MBG_IMS_SENSOR_PLL_LOCKED, MBG_SUCCESS, ALL_IMS_STATE::sensor_state_idx, MBG_IMS_SENSOR_STATE_IDX::state, and MBG_IMS_SENSOR_STATE::type.
Referenced by mbg_tlv_create_id().
_NO_MBG_API_ATTR int _MBG_API chk_dev_ims_is_volt_out_enabled | ( | const ALL_IMS_STATE * | ims_state, |
unsigned | idx | ||
) |
Definition at line 892 of file cfg_hlp.c.
References MBG_IMS_SENSOR_STATE::flags, MBG_ERR_NOT_SUPP_BY_DEV, MBG_IMS_SENSOR_VOLTAGE, MBG_IMS_SENSOR_VOLTAGE_OUT_ENB, MBG_SUCCESS, ALL_IMS_STATE::sensor_state_idx, MBG_IMS_SENSOR_STATE_IDX::state, and MBG_IMS_SENSOR_STATE::type.
Referenced by mbg_tlv_create_id().
_NO_MBG_API_ATTR int _MBG_API chk_dev_ims_is_volt_out_overload | ( | const ALL_IMS_STATE * | ims_state, |
unsigned | idx | ||
) |
Definition at line 907 of file cfg_hlp.c.
References MBG_IMS_SENSOR_STATE::flags, MBG_ERR_NOT_SUPP_BY_DEV, MBG_IMS_SENSOR_VOLTAGE, MBG_IMS_SENSOR_VOLTAGE_OUT_OVR, MBG_SUCCESS, ALL_IMS_STATE::sensor_state_idx, MBG_IMS_SENSOR_STATE_IDX::state, and MBG_IMS_SENSOR_STATE::type.
Referenced by mbg_tlv_create_id().
_NO_MBG_API_ATTR int _MBG_API chk_dev_net_cfg_supp_stage_2 | ( | const ALL_NET_CFG_INFO * | info | ) |
Definition at line 774 of file cfg_hlp.c.
References MBG_NET_GLB_CFG_INFO::feat_flags, ALL_NET_CFG_INFO::glb_cfg_info, MBG_ERR_NOT_SUPP_BY_DEV, MBG_NET_GLB_SUPP_STAGE_2_MASK, and MBG_SUCCESS.
Referenced by mbg_tlv_create_id().
_NO_MBG_API_ATTR int _MBG_API chk_dev_ntp_supp_client | ( | const ALL_NTP_CFG_INFO * | info | ) |
Definition at line 786 of file cfg_hlp.c.
References ALL_NTP_CFG_INFO::glb_info, MBG_ERR_NOT_SUPP_BY_DEV, MBG_SUCCESS, NTP_MSK_ROLE_CLIENT, NTP_MSK_ROLE_CLIENT_SERVER, and NTP_GLB_INFO::supp_ntp_roles.
Referenced by mbg_tlv_create_id().
_NO_MBG_API_ATTR int _MBG_API chk_dev_ntp_supp_server | ( | const ALL_NTP_CFG_INFO * | info | ) |
Definition at line 798 of file cfg_hlp.c.
References ALL_NTP_CFG_INFO::glb_info, MBG_ERR_NOT_SUPP_BY_DEV, MBG_SUCCESS, NTP_MSK_ROLE_CLIENT_SERVER, NTP_MSK_ROLE_SERVER, and NTP_GLB_INFO::supp_ntp_roles.
Referenced by mbg_tlv_create_id().
_NO_MBG_API_ATTR int _MBG_API chk_dev_receiver_info | ( | const RECEIVER_INFO * | p | ) |
Definition at line 733 of file cfg_hlp.c.
References MAX_PARM_PORT, MAX_PARM_POUT, MAX_PARM_STR_TYPE, MBG_ERR_N_COM_EXCEEDS_SUPP, MBG_ERR_N_STR_EXCEEDS_SUPP, MBG_SUCCESS, RECEIVER_INFO::n_com_ports, RECEIVER_INFO::n_prg_out, and RECEIVER_INFO::n_str_type.
Referenced by mbg_setup_receiver_info(), and mbg_tlv_create_id().
_NO_MBG_API_ATTR int _MBG_API chk_dev_xbp_supp_nodes | ( | const ALL_XBP_INFO * | info | ) |
Definition at line 757 of file cfg_hlp.c.
References XBP_LIMITS::features, ALL_XBP_INFO::limits, MBG_ERR_INV_PARM, MBG_ERR_NOT_SUPP_BY_DEV, MBG_SUCCESS, and XBP_FEAT_MASK_NODES.
Referenced by mbg_tlv_create_id().
_NO_MBG_API_ATTR int _MBG_API chk_dev_xmulti_ref_supp_ext_source_metrics | ( | const ALL_XMULTI_REF_INFO * | info, |
int | type | ||
) |
Definition at line 868 of file cfg_hlp.c.
References ALL_XMULTI_REF_INFO::ext_src_infos, XMR_EXT_SRC_INFO::feat_flags, XMR_EXT_SRC_INFO_IDX::info, MBG_ERR_NOT_SUPP_BY_DEV, MBG_SUCCESS, N_MULTI_REF, and XMR_EXT_SRC_FEAT_FLAG_MSK_METRICS.
Referenced by mbg_tlv_create_id().
_NO_MBG_API_ATTR int _MBG_API chk_dev_xmulti_ref_supp_ext_source_stats | ( | const ALL_XMULTI_REF_INFO * | info, |
int | type | ||
) |
Definition at line 849 of file cfg_hlp.c.
References ALL_XMULTI_REF_INFO::ext_src_infos, XMR_EXT_SRC_INFO::feat_flags, XMR_EXT_SRC_INFO_IDX::info, MBG_ERR_NOT_SUPP_BY_DEV, MBG_SUCCESS, N_MULTI_REF, and XMR_EXT_SRC_FEAT_FLAG_MSK_STATS.
Referenced by mbg_tlv_create_id().
_NO_MBG_API_ATTR int _MBG_API chk_dev_xmulti_ref_supp_ext_src_info | ( | const ALL_XMULTI_REF_INFO * | info | ) |
Definition at line 821 of file cfg_hlp.c.
References XMULTI_REF_INSTANCES::flags, ALL_XMULTI_REF_INFO::instances, MBG_ERR_NOT_SUPP_BY_DEV, MBG_SUCCESS, and XMRIF_MSK_EXT_SRC_INFO_SUPP.
Referenced by mbg_get_all_xmulti_ref_info(), mbg_get_all_xmulti_ref_status(), and mbg_tlv_create_id().
_NO_MBG_API_ATTR int _MBG_API chk_dev_xmulti_ref_supp_holdover_status | ( | const ALL_XMULTI_REF_INFO * | info | ) |
Definition at line 832 of file cfg_hlp.c.
References XMULTI_REF_INSTANCES::flags, ALL_XMULTI_REF_INFO::instances, MBG_ERR_NOT_SUPP_BY_DEV, MBG_SUCCESS, and XMRIF_MSK_HOLDOVER_STATUS_SUPP.
Referenced by mbg_tlv_create_id().
_NO_MBG_API_ATTR int _MBG_API chk_dev_xmulti_ref_supp_mrf_none | ( | const ALL_XMULTI_REF_INFO * | info | ) |
Definition at line 810 of file cfg_hlp.c.
References XMULTI_REF_INSTANCES::flags, ALL_XMULTI_REF_INFO::instances, MBG_ERR_NOT_SUPP_BY_DEV, MBG_SUCCESS, and XMRIF_MSK_MRF_NONE_SUPP.
Referenced by mbg_tlv_create_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().
int chk_set_n_gnss_supp | ( | ALL_GNSS_INFO * | p_agi | ) |
Definition at line 440 of file cfg_hlp.c.
References ALL_GNSS_INFO::gnss_mode_info, MBG_ERR_N_GNSS_EXCEEDS_SUPP, MBG_SUCCESS, ALL_GNSS_INFO::n_gnss_supp, N_GNSS_TYPES, num_bits_set(), and MBG_GNSS_MODE_INFO::supp_gnss_types.
Referenced by mbg_chk_get_all_gnss_info(), mbg_tlv_create_id(), and setup_gps_only_gnss_info_from_statinfo().
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.
[in,out] | p | The SW_REV name to check |
[in] | verbose | The app's verbosity level |
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().
|
static |
|
static |
Check if a device ID refers to a serial port.
[in] | dev_id | A string with the device name or port name |
Definition at line 1055 of file cfg_hlp.h.
Referenced by mbg_str_dev_name().
void free_all_database_info | ( | ALL_DATABASE_INFO * | p | ) |
Free an ALL_DATABASE_INFO structure.
[in] | p | Pointer to the ALL_DATABASE_INFO structure to be freed |
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().
void free_all_events | ( | ALL_EVENTS * | p | ) |
Free an ALL_EVENTS structure.
[in] | p | Pointer 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().
void free_all_firmware_info | ( | ALL_FIRMWARE_INFO * | p | ) |
Free an ALL_FIRMWARE_INFO structure.
[in] | p | Pointer to the ALL_FIRMWARE_INFO structure to be freed |
Definition at line 1678 of file cfg_hlp.c.
References ALL_FIRMWARE_INFO::firmwares, ALL_FIRMWARE_INFO::glb_info, mbg_firmware::info, MBG_FW_GLB_INFO::installed_fws, MBG_FW_INFO::num_ufus, mbg_firmware::release_priv, mbg_firmware_ufu::release_priv, and mbg_firmware::ufus.
Referenced by mbg_tlv_create_id().
void free_all_gpio_info | ( | ALL_GPIO_INFO * | p | ) |
Free memory allocated by mbgextio_get_all_gpio_info.
[in] | p | Pointer to the ALL_GPIO_INFO structure to be freed |
Definition at line 1445 of file cfg_hlp.c.
References ALL_GPIO_INFO::infos.
Referenced by mbg_tlv_create_id().
void free_all_gpio_state | ( | ALL_GPIO_STATE * | p | ) |
Free memory allocated by mbgextio_get_all_gpio_state.
[in] | p | Pointer to the ALL_GPIO_STATE structure to be freed |
Definition at line 1511 of file cfg_hlp.c.
References ALL_GPIO_STATE::states.
Referenced by mbg_tlv_create_id().
void free_all_ims_info | ( | ALL_IMS_INFO * | p | ) |
Free memory allocated by mbgextio_get_all_ims_info.
[in] | p | Pointer to the ALL_IMS_INFO structure to be freed |
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().
void free_all_ims_state | ( | ALL_IMS_STATE * | p | ) |
Free memory allocated by mbgextio_get_all_ims_state.
[in] | p | Pointer to the ALL_IMS_STATE structure to be freed |
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().
void free_all_io_ports | ( | ALL_MBG_IO_PORTS * | p | ) |
Free memory allocated by mbgextio_get_all_io_ports.
[in] | p | Pointer to the ALL_MBG_IO_PORTS structure to be freed |
Definition at line 1471 of file cfg_hlp.c.
References mbg_io_port::free_priv_data, ALL_MBG_IO_PORTS::num_ports, ALL_MBG_IO_PORTS::ports, mbg_io_port::priv_data, and mbg_io_port::pt_infos.
Referenced by mbg_tlv_create_id().
void free_all_monitoring_info | ( | ALL_MONITORING_INFO * | p | ) |
Free an ALL_MONITORING_INFO structure.
[in] | p | Pointer to the ALL_MONITORING_INFO structure to be freed |
Definition at line 1146 of file cfg_hlp.c.
References ALL_MONITORING_INFO::all_events, ALL_MONITORING_INFO::all_snmp_info, ALL_MONITORING_INFO::all_syslog_info, free_all_events(), free_all_snmp_info(), and free_all_syslog_info().
Referenced by mbg_tlv_create_id().
void free_all_net_cfg_info | ( | ALL_NET_CFG_INFO * | p | ) |
Free an ALL_NET_CFG_INFO structure.
[in] | p | Pointer to the ALL_NET_CFG_INFO structure to be freed |
Definition at line 1018 of file cfg_hlp.c.
References ALL_NET_CFG_INFO::addr_infos, ALL_NET_CFG_INFO::dns_srch_doms, ALL_NET_CFG_INFO::dns_srvrs, ALL_NET_CFG_INFO::link_infos, and ALL_NET_CFG_INFO::route_infos.
Referenced by mbg_get_all_net_cfg_info(), and mbg_tlv_create_id().
void free_all_net_status_info | ( | ALL_NET_STATUS_INFO * | p | ) |
Free an ALL_NET_STATUS_INFO structure.
[in] | p | Pointer to the ALL_NET_STATUS_INFO structure to be freed |
Definition at line 1052 of file cfg_hlp.c.
References ALL_NET_CFG_INFO::addr_infos, ALL_NET_CFG_INFO::dns_srch_doms, ALL_NET_CFG_INFO::dns_srvrs, ALL_NET_CFG_INFO::link_infos, and ALL_NET_CFG_INFO::route_infos.
Referenced by mbg_get_all_net_status_info(), and mbg_tlv_create_id().
void free_all_ntp_cfg_info | ( | ALL_NTP_CFG_INFO * | p | ) |
Free an ALL_NTP_CFG_INFO structure.
[in] | p | Pointer to the ALL_NTP_CFG_INFO structure to be freed |
Definition at line 1311 of file cfg_hlp.c.
References ALL_NTP_CFG_INFO::clnt_info, ALL_NTP_CFG_INFO::misc_limits, ALL_NTP_CFG_INFO::orphan_mode_info, ALL_NTP_CFG_INFO::peer_settings_idx, ALL_NTP_CFG_INFO::refclk_info_idx, ALL_NTP_CFG_INFO::srv_info, ALL_NTP_CFG_INFO::symm_key_info_idx, ALL_NTP_CFG_INFO::symm_key_limits, and ALL_NTP_CFG_INFO::trusted_key_info_idx.
Referenced by mbg_tlv_create_id().
void free_all_ntp_status | ( | ALL_NTP_STATUS * | p | ) |
Free an ALL_NTP_STATUS structure.
[in] | p | Pointer to the ALL_NTP_STATUS structure to be freed |
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().
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.
[in] | p | Pointer to the ALL_PTP_V1_COMMON_DATASETS structure to be freed |
Definition at line 1267 of file cfg_hlp.c.
References ALL_PTP_V1_COMMON_DATASETS::port_datasets.
Referenced by mbg_tlv_create_id().
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.
[in] | p | Pointer to the ALL_PTP_V2_COMMON_DATASETS structure to be freed |
Definition at line 1289 of file cfg_hlp.c.
References ALL_PTP_V2_COMMON_DATASETS::port_datasets.
Referenced by mbg_tlv_create_id().
void free_all_snmp_info | ( | ALL_SNMP_INFO * | p | ) |
Free an ALL_SNMP_INFO structure.
[in] | p | Pointer 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().
void free_all_svc_info | ( | ALL_SERVICE_INFO * | p | ) |
Free an ALL_SERVICE_INFO structure.
[in] | p | Pointer to the ALL_SERVICE_INFO structure to be freed |
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().
void free_all_syslog_info | ( | ALL_SYSLOG_INFO * | p | ) |
Free an ALL_SYSLOG_INFO structure.
[in] | p | Pointer to the ALL_SYSLOG_INFO structure to be freed |
Definition at line 1113 of file cfg_hlp.c.
References ALL_SYSLOG_INFO::glb_info, MBG_SYSLOG_GLB_SETTINGS::num_servers, mbg_syslog_server::release_priv, ALL_SYSLOG_INFO::servers, and MBG_SYSLOG_GLB_INFO::settings.
Referenced by free_all_monitoring_info(), and mbg_tlv_create_id().
void free_all_ucap_info | ( | ALL_UCAP_INFO * | p | ) |
Free memory allocated by mbgextio_get_all_ucap_info.
[in] | p | Pointer to the ALL_UCAP_INFO structure to freed |
Definition at line 1556 of file cfg_hlp.c.
References UCAP_ENTRY::head, ALL_UCAP_INFO::list, mbg_klist_delete_item(), mbg_klist_first_entry, and mbg_klist_is_empty().
Referenced by mbg_get_all_ucap_info(), and mbg_tlv_create_id().
void free_all_ucap_net_info | ( | ALL_UCAP_NET_INFO * | p | ) |
Free an ALL_UCAP_NET_INFO structure.
[in] | p | Pointer to the ALL_UCAP_NET_INFO structure to be freed |
Definition at line 1583 of file cfg_hlp.c.
References ALL_UCAP_NET_INFO::recv_infos.
Referenced by mbg_tlv_create_id().
void free_all_user_info | ( | ALL_USER_INFO * | p | ) |
Free an ALL_USER_INFO structure.
[in] | p | Pointer to the ALL_USER_INFO structure to be freed |
Definition at line 1605 of file cfg_hlp.c.
References MBG_USER_MNGMNT_SETTINGS::num_users, mbg_user::release_backref, mbg_user::release_priv, MBG_USER_MNGMNT_INFO::settings, ALL_USER_INFO::user_mngmnt_info, and ALL_USER_INFO::users.
Referenced by mbg_tlv_create_id().
void free_all_xbp_info | ( | ALL_XBP_INFO * | p | ) |
Free an ALL_XBP_INFO structure.
[in] | p | Pointer to the ALL_XBP_INFO structure to be freed |
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().
void free_all_xmulti_ref_info | ( | ALL_XMULTI_REF_INFO * | p | ) |
Free an ALL_XMULTI_REF_INFO structure.
[in] | p | Pointer to the ALL_XMULTI_REF_INFO structure to be freed |
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().
void free_all_xmulti_ref_status | ( | ALL_XMULTI_REF_STATUS * | p | ) |
Free an ALL_XMULTI_REF_STATUS structure.
[in] | p | Pointer to the ALL_XMULTI_REF_STATUS structure to be freed |
Definition at line 1236 of file cfg_hlp.c.
References ALL_XMULTI_REF_STATUS::holdover_status, ALL_XMULTI_REF_STATUS::metrics_idx, ALL_XMULTI_REF_STATUS::stats_idx, and ALL_XMULTI_REF_STATUS::status.
Referenced by mbg_get_all_xmulti_ref_status(), and mbg_tlv_create_id().
int get_baud_rate_idx | ( | BAUD_RATE | baud_rate | ) |
Definition at line 130 of file cfg_hlp.c.
References mbg_baud_rates, and N_MBG_BAUD_RATES.
Referenced by check_valid_port_info(), mbg_tlv_create_id(), and pcps_serial_from_port_info().
int get_framing_idx | ( | const char * | framing | ) |
Definition at line 145 of file cfg_hlp.c.
References get_str_idx(), mbg_framing_strs, and N_MBG_FRAMINGS.
Referenced by check_valid_port_info(), mbg_tlv_create_id(), and pcps_serial_from_port_info().
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().
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().
MBG_IO_PORT_TYPE_INFO* get_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.
[in] | port | Pointer to the MBG_IO_PORT to search for port_type |
[in] | port_type | Enum value of MBG_IO_PORT_TYPES to search for in port (MBG_IO_PORT) |
Definition at line 601 of file cfg_hlp.c.
References MBG_IO_PORT_SETTINGS::data, MBG_IO_PORT_TYPE_INFO::data, MBG_IO_PORT_TYPE_INFO_U::gpio_limits, MBG_IO_PORT_SETTINGS_U::gpio_settings, MBG_IO_PORT_TYPE_GPIO, MBG_IO_PORT_INFO::num_types, mbg_io_port::p_info, MBG_IO_PORT_TYPE_INFO::port_type, mbg_io_port::pt_infos, mbg_io_port::setts, MBG_GPIO_SETTINGS::type, and MBG_GPIO_LIMITS::type.
Referenced by mbg_tlv_create_id().
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().
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().
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.
[out] | tlv | Pointer to a MBG_TLV_ANNOUNCE structure |
[in] | uid | Unique sender ID used as identifier with all subsequent messages related to this transaction. |
[in] | tlv_feat_type | One of the MBG_TLV_FEAT_TYPES |
[in] | total_bytes | Total 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().
|
static |
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.
void mbg_tlv_init | ( | MBG_TLV * | tlv, |
MBG_TLV_UID | uid, | ||
MBG_TLV_TYPE | tlv_type, | ||
uint32_t | total_bytes | ||
) |
Initializes a MBG_TLV.
[out] | tlv | Pointer to a valid MBG_TLV structure |
[in] | uid | Unique sender ID used as identifier for each further TLV message related to this type. |
[in] | tlv_type | Type identifier, see MBG_TLV_TYPES |
[in] | total_bytes | Total 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().
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.
[in,out] | state | Pointer to MBG_TLV_RCV_STATE structure |
[in] | uid | Unique sender ID used as identifier for each further TLV message related to this type. |
[in] | total_bytes | Total 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().
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.
[in] | p_nts | The NTP_TSTAMP structure to be converted |
[out] | p_nt64 | The 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().
|
static |
Count the number of bits which are not 0.
[in] | val | Value to be tested |
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().
int setup_default_str_type_info_idx | ( | STR_TYPE_INFO_IDX | stii[], |
const RECEIVER_INFO * | p_ri | ||
) |
Definition at line 422 of file cfg_hlp.c.
References default_str_type_info, STR_TYPE_INFO_IDX::idx, MBG_SUCCESS, RECEIVER_INFO::n_str_type, and STR_TYPE_INFO_IDX::str_type_info.
Referenced by mbg_get_serial_settings(), and mbg_tlv_create_id().
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.
Definition at line 482 of file cfg_hlp.c.
References chk_set_n_gnss_supp(), ALL_GNSS_INFO::gnss_mode_info, ALL_GNSS_INFO::gnss_sat_info_idx, MBG_GNSS_MODE_SETTINGS::gnss_set, MBG_GNSS_TYPE_MSK_GPS, MBG_GNSS_MODE_INFO::settings, setup_gps_only_sat_info_idx_from_statinfo(), and MBG_GNSS_MODE_INFO::supp_gnss_types.
Referenced by mbg_chk_get_all_gnss_info(), and mbg_tlv_create_id().
void setup_gps_only_sat_info_idx_from_statinfo | ( | ALL_GNSS_INFO * | p_agi | ) |
Definition at line 459 of file cfg_hlp.c.
References GNSS_SAT_INFO_IDX::gnss_sat_info, ALL_GNSS_INFO::gnss_sat_info_idx, GNSS_SAT_INFO::gnss_type, GNSS_TYPE_GPS, STAT_INFO::good_svs, GNSS_SAT_INFO::good_svs, GNSS_SAT_INFO_IDX::idx, ALL_GNSS_INFO::stat_info, STAT_INFO::svs_in_view, and GNSS_SAT_INFO::svs_in_view.
Referenced by mbg_tlv_create_id(), and setup_gps_only_gnss_info_from_statinfo().
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.
[in] | s | A 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] | p | Address of a NANO_TIME_64 structure to be set up |
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().
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.
[in] | s | A 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] | p | Address of a NTP_TSTAMP structure to be set up |
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().
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().
STR_TYPE_INFO default_str_type_info[2] |
Referenced by setup_default_str_type_info_idx().
DEVICE_INFO device_list[( 16+ 1)] |
Referenced by get_fw_id_from_hw_id(), and get_hw_id_from_fw_id().
const char* mbg_baud_rate_strs[N_MBG_BAUD_RATES] |
Referenced by usage().
BAUD_RATE mbg_baud_rates[N_MBG_BAUD_RATES] |
Referenced by get_baud_rate_idx(), mbgextio_close_connection(), and port_info_from_pcps_serial().
const char* mbg_framing_strs[N_MBG_FRAMINGS] |
Referenced by get_framing_idx(), mbgextio_close_connection(), port_info_from_pcps_serial(), and usage().
const char* mbg_gpio_fixed_freq_strs[N_MBG_GPIO_FIXED_FREQ] |
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_type_names[N_MBG_GPIO_TYPES] |
const char* ptp_clock_accuracy_strs[N_PTP_CLOCK_ACCURACY - PTP_CLOCK_ACCURACY_NUM_BIAS] |
Referenced by show_ptp_state().
const char* ptp_delay_mechanism_strs[N_PTP_DELAY_MECH] |
const char* ptp_nw_protocol_strs[N_PTP_NW_PROT] |
const char* ptp_port_state_strs[N_PTP_PORT_STATE] |
const char* ptp_role_strs[N_PTP_ROLES] |
Referenced by show_ptp_state().
const PTP_TABLE ptp_time_source_table[] |
const char* str_not_spc |
Referenced by mbg_get_all_ucap_info(), and show_pout().
const char* str_undefined |
Referenced by show_ptp_state().
const char* str_unknown |
Referenced by mbgextio_get_cmd_name(), show_ext_stat_info(), and show_ptp_state().
const char* xmr_holdover_status_mode_names[N_XMR_HOLDOVER_STATUS_MODES] |