mbgtools-lx
4.2.8
|
#include <cfg_hlp.h>
#include <mbgerror.h>
#include <timeutil.h>
#include <str_util.h>
#include <myutil.h>
#include <mbgtime.h>
#include <mbgmktm.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
Go to the source code of this file.
Macros | |
#define | _CFG_HLP |
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().
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().
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().
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().