mbgtools-lx
4.2.8
|
Go to the source code of this file.
Data Structures | |
struct | PCPS_SER_PACK |
A helper structure used with configuration of old DCF77 clocks. More... | |
struct | PCPS_TIME_EXT |
An extended time and status structure. More... | |
Macros | |
#define | _ext extern |
Typedefs | |
typedef int | MBG_ERR_MSG_FNC(const PCPS_DEV *p_dev, const char *s) |
Functions | |
static __mbg_inline int | pcps_time_is_valid (const PCPS_TIME *p) |
Check if a PCPS_TIME structure contains valid date and time. More... | |
int | chk_feat_supp (MBG_DEV_HANDLE dh, const PCPS_DEV *p_dev, MBG_CHK_SUPP_FNC *chk_supp_fnc, MBG_ERR_MSG_FNC *err_msg_fnc, const char *not_supp_msg) |
int | mbg_chk_get_all_gnss_info (MBG_DEV_HANDLE dh, ALL_GNSS_INFO *p_agi) |
Read or setup all GNSS status information. More... | |
int | mbg_get_serial_settings (MBG_DEV_HANDLE dh, const PCPS_DEV *p_dev, RECEIVER_PORT_CFG *p_rpcfg, const RECEIVER_INFO *p_ri) |
Read all serial port settings and supported configuration parameters. More... | |
int | mbg_save_serial_settings (MBG_DEV_HANDLE dh, const PCPS_DEV *p_dev, RECEIVER_PORT_CFG *p_rpcfg, int port_num) |
Write the configuration settings for a single serial port to a device. More... | |
int | mbg_get_all_net_cfg_info (MBG_DEV_HANDLE dh, ALL_NET_CFG_INFO **p) |
Read all network configuration into an ALL_NET_CFG_INFO structure. More... | |
int | mbg_save_all_net_cfg_info (MBG_DEV_HANDLE dh, ALL_NET_CFG_INFO *p) |
Write all network settings to a device. More... | |
int | mbg_get_all_net_status_info (MBG_DEV_HANDLE dh, ALL_NET_STATUS_INFO **p) |
Read current network status into an ALL_NET_STATUS_INFO structure. More... | |
int | mbg_get_all_ptp_cfg_info (MBG_DEV_HANDLE dh, ALL_PTP_CFG_INFO *p) |
Read all PTP settings and supported configuration parameters. More... | |
int | mbg_save_all_ptp_cfg_info (MBG_DEV_HANDLE dh, const ALL_PTP_CFG_INFO *p) |
Write all PTP settings to a device. More... | |
int | mbg_get_all_xmulti_ref_info (MBG_DEV_HANDLE dh, ALL_XMULTI_REF_INFO **p) |
Read all XMR info into a newly or re-allocated ALL_XMULTI_REF_INFO. More... | |
_NO_MBG_API_ATTR int _MBG_API | mbg_save_all_xmulti_ref_info (MBG_DEV_HANDLE dh, ALL_XMULTI_REF_INFO *p) |
Set all extended multi ref settings to a device. More... | |
int | mbg_get_all_xmulti_ref_status (MBG_DEV_HANDLE dh, const ALL_XMULTI_REF_INFO *info, ALL_XMULTI_REF_STATUS **p) |
Read all XMR status info into a newly or re-allocated ALL_XMULTI_REF_STATUS. More... | |
int | mbg_get_all_ucap_info (MBG_DEV_HANDLE dh, ALL_UCAP_INFO **p) |
Read all user capture information and store it into a newly allocated or reused ALL_UCAP_INFO. More... | |
void | test_gpio (MBG_DEV_HANDLE dh, const PCPS_DEV *p_dev, int verbose) |
void | test_xmr (MBG_DEV_HANDLE dh, const PCPS_DEV *p_dev, int verbose) |
void | port_info_from_pcps_serial (PORT_INFO_IDX *p_pii, PCPS_SERIAL pcps_serial, uint32_t supp_baud_rates) |
void | pcps_serial_from_port_info (PCPS_SERIAL *p, const PORT_INFO_IDX *p_pii) |
void | pcps_unpack_serial (PCPS_SER_PACK *p) |
void | pcps_pack_serial (PCPS_SER_PACK *p) |
void | pcps_setup_isa_ports (char *s, int *port_vals, int n_vals) |
const char * | setup_device_type_name (char *s, size_t max_len, MBG_DEV_HANDLE dh, const RECEIVER_INFO *p_ri) |
const char * | setup_asic_features (char *s, size_t max_len, MBG_DEV_HANDLE dh) |
#define _ext extern |
Definition at line 45 of file deviohlp.h.
typedef int MBG_ERR_MSG_FNC(const PCPS_DEV *p_dev, const char *s) |
Definition at line 75 of file deviohlp.h.
int chk_feat_supp | ( | MBG_DEV_HANDLE | dh, |
const PCPS_DEV * | p_dev, | ||
MBG_CHK_SUPP_FNC * | chk_supp_fnc, | ||
MBG_ERR_MSG_FNC * | err_msg_fnc, | ||
const char * | not_supp_msg | ||
) |
Definition at line 84 of file deviohlp.c.
References MBG_ERR_INV_HANDLE, MBG_ERR_NOT_SUPP_BY_DEV, MBG_INVALID_DEV_HANDLE, mbg_rc_is_success, and MBG_SUCCESS.
Referenced by chk_fast_tstamp_supp(), and pcps_time_is_valid().
int mbg_chk_get_all_gnss_info | ( | MBG_DEV_HANDLE | dh, |
ALL_GNSS_INFO * | p_agi | ||
) |
Read or setup all GNSS status information.
This function should be called preferably to get a summary of the GNSS status from GNSS receivers (GPS, GLONASS, ...).
The function mbg_get_device_info must have been called before, and the returned PCPS_DEV structure has to be passed to this function.
If the device supports this then the low level GNSS API functions are called directly to collect the status information. If the device doesn't support the GNSS API but is a pure GPS receiver then the GPS API functions are called and the GNSS data structures are filled up accordingly, so the calling application can always evaluate the GNSS data structures in ALL_GNSS_INFO.
If neither GPS nor another GNSS system is supported then this function returns the MBG_ERR_NOT_SUPP_BY_DEV error.
[in] | dh | Valid handle to a Meinberg device |
[out] | p_agi | Pointer to a ALL_GNSS_INFO to be filled |
Definition at line 159 of file deviohlp.c.
References chk_set_n_gnss_supp(), ALL_GNSS_INFO::gnss_mode_info, ALL_GNSS_INFO::gnss_sat_info_idx, mbg_chk_dev_is_gnss, mbg_chk_dev_is_gps, MBG_ERR_UNSPEC, mbg_get_gps_all_gnss_sat_info(), mbg_get_gps_gnss_mode_info(), mbg_get_gps_stat_info(), mbg_rc_is_error, mbg_rc_is_success, setup_gps_only_gnss_info_from_statinfo(), and ALL_GNSS_INFO::stat_info.
Referenced by pcps_time_is_valid(), and show_ext_stat_info().
int mbg_get_all_net_cfg_info | ( | MBG_DEV_HANDLE | dh, |
ALL_NET_CFG_INFO ** | p | ||
) |
Read all network configuration into an ALL_NET_CFG_INFO structure.
Reads the network configuration of a device via the LAN_IP4 API and translates the structures into NET_CFG structures.
As soon as available, this function should make use of the NET_CFG API.
A ALL_NET_CFG_INFO and the appropriate number of MBG_NET_INTF_LINK_INFO_IDX, MBG_NET_INTF_ADDR_INFO_IDX, MBG_IP_ADDR_IDX, MBG_NET_NAME_IDX and MBG_NET_INTF_ROUTE_INFO_IDX will be allocated and need to be freed later by calling free_all_net_cfg_info
[in] | dh | Valid handle to a Meinberg device |
[out] | p | Pointer to a pointer of ALL_NET_CFG_INFO |
Definition at line 420 of file deviohlp.c.
References ALL_NET_CFG_INFO::addr_infos, MBG_NET_INTF_ADDR_INFO::addr_settings, MBG_NET_INTF_LINK_SETTINGS::ass_if_index, MBG_NET_INTF_ADDR_SETTINGS::ass_if_index, MBG_NET_INTF_ROUTE_SETTINGS::ass_if_index, IP4_SETTINGS::broad_addr, MBG_NET_INTF_ADDR_SETTINGS::broadcast, IP4_SETTINGS::flags, MBG_NET_INTF_ADDR_SETTINGS::flags, free_all_net_cfg_info(), IP4_SETTINGS::gateway, MBG_NET_INTF_ROUTE_SETTINGS::gateway, get_ip4_net_mask_bits(), ALL_NET_CFG_INFO::glb_cfg_info, MBG_NET_GLB_CFG_INFO::glb_settings, MBG_NET_INTF_LINK_INFO_IDX::idx, MBG_NET_INTF_LINK_SETTINGS::if_index, MBG_NET_INTF_LINK_INFO_IDX::info, MBG_NET_INTF_ADDR_INFO_IDX::info, MBG_NET_INTF_ROUTE_INFO_IDX::info, MBG_NET_INTF_ADDR_SETTINGS::ip, MBG_IP_ADDR::u_addr::ip4_addr, IP4_MSK_DHCP, IP4_MSK_LINK, IP4_MSK_VLAN, IP4_SETTINGS::ip_addr, MBG_NET_INTF_ADDR_SETTINGS::label, ALL_NET_CFG_INFO::link_infos, MBG_NET_INTF_LINK_INFO::link_settings, LAN_IF_INFO::mac_addr, MBG_NET_INTF_LINK_SETTINGS::mac_addr, mbg_chk_dev_has_lan_intf, MBG_ERR_NO_MEM, mbg_get_ip4_settings(), mbg_get_lan_if_info(), MBG_IP_ADDR_TYPE_IP4, MBG_NET_INTF_ADDR_MASK_DHCP4, MBG_NET_INTF_LINK_PORT_TYPE_MASK_TP, MBG_NET_INTF_LINK_PORT_TYPE_TP, MBG_NET_INTF_LINK_SPEED_MODE_MASK_100_T_FULL, MBG_NET_INTF_LINK_SPEED_MODE_MASK_100_T_HALF, MBG_NET_INTF_LINK_SPEED_MODE_MASK_10_T_FULL, MBG_NET_INTF_LINK_SPEED_MODE_MASK_10_T_HALF, MBG_NET_INTF_LINK_STATE_MASK_LOWER_UP, MBG_NET_INTF_LINK_STATE_MASK_UP, MBG_NET_INTF_LINK_TYPE_MASK_PHYS, MBG_NET_INTF_LINK_TYPE_MASK_VLAN, MBG_NET_INTF_LINK_TYPE_PHYS, MBG_NET_INTF_LINK_TYPE_VLAN, MBG_NET_INTF_ROUTE_TYPE_DEFAULT_GATEWAY, mbg_rc_is_error, mbg_rc_is_success, MBG_NET_GLB_CFG_INFO::n_supp_intf_addr, MBG_NET_GLB_CFG_INFO::n_supp_intf_link, MBG_NET_GLB_CFG_INFO::n_supp_intf_route, MBG_NET_INTF_LINK_SETTINGS::name, IP4_SETTINGS::netmask, MBG_NET_GLB_CFG_SETTINGS::num_intf_addr, MBG_NET_GLB_CFG_SETTINGS::num_intf_link, MBG_NET_GLB_CFG_SETTINGS::num_intf_route, MBG_NET_INTF_LINK_SETTINGS::port_type, MBG_NET_INTF_ADDR_SETTINGS::prefix_bits, ALL_NET_CFG_INFO::route_infos, MBG_NET_INTF_ROUTE_INFO::route_settings, snprintf_safe(), MBG_NET_INTF_LINK_SETTINGS::states, MBG_NET_INTF_ADDR_INFO::supp_flags, MBG_NET_INTF_LINK_INFO::supp_port_types, MBG_NET_INTF_LINK_INFO::supp_speed_modes, MBG_NET_INTF_LINK_INFO::supp_states, MBG_NET_INTF_LINK_INFO::supp_types, MBG_IP_ADDR::type, MBG_NET_INTF_LINK_SETTINGS::type, MBG_NET_INTF_ROUTE_SETTINGS::type, MBG_IP_ADDR::u_addr, IP4_SETTINGS::vlan_cfg, and MBG_NET_INTF_LINK_SETTINGS::vlan_cfg.
Referenced by pcps_time_is_valid().
int mbg_get_all_net_status_info | ( | MBG_DEV_HANDLE | dh, |
ALL_NET_STATUS_INFO ** | p | ||
) |
Read current network status into an ALL_NET_STATUS_INFO structure.
Reads the network status of a device via the LAN_IP4 API and translates the structures into NET_CFG structures.
As soon as available, this function should make use of the NET_CFG API.
A ALL_NET_STATUS_INFO and the appropriate number of MBG_NET_INTF_LINK_INFO_IDX, MBG_NET_INTF_ADDR_INFO_IDX, MBG_IP_ADDR_IDX, MBG_NET_NAME_IDX and MBG_NET_INTF_ROUTE_INFO_IDX will be allocated and need to be freed later by calling free_all_net_status_info
[in] | dh | Valid handle to a Meinberg device |
[out] | p | Pointer to a pointer of ALL_NET_STATUS_INFO |
Definition at line 676 of file deviohlp.c.
References ALL_NET_CFG_INFO::addr_infos, MBG_NET_INTF_ADDR_INFO::addr_settings, MBG_NET_INTF_LINK_SETTINGS::ass_if_index, MBG_NET_INTF_ADDR_SETTINGS::ass_if_index, MBG_NET_INTF_ROUTE_SETTINGS::ass_if_index, IP4_SETTINGS::broad_addr, MBG_NET_INTF_ADDR_SETTINGS::broadcast, IP4_SETTINGS::flags, MBG_NET_INTF_ADDR_SETTINGS::flags, free_all_net_status_info(), IP4_SETTINGS::gateway, MBG_NET_INTF_ROUTE_SETTINGS::gateway, get_ip4_net_mask_bits(), ALL_NET_CFG_INFO::glb_cfg_info, MBG_NET_GLB_CFG_INFO::glb_settings, MBG_NET_INTF_LINK_INFO_IDX::idx, MBG_NET_INTF_LINK_SETTINGS::if_index, MBG_NET_INTF_LINK_INFO_IDX::info, MBG_NET_INTF_ADDR_INFO_IDX::info, MBG_NET_INTF_ROUTE_INFO_IDX::info, MBG_NET_INTF_ADDR_SETTINGS::ip, MBG_IP_ADDR::u_addr::ip4_addr, IP4_MSK_DHCP, IP4_MSK_LINK, IP4_MSK_VLAN, IP4_SETTINGS::ip_addr, MBG_NET_INTF_ADDR_SETTINGS::label, ALL_NET_CFG_INFO::link_infos, MBG_NET_INTF_LINK_INFO::link_settings, LAN_IF_INFO::mac_addr, MBG_NET_INTF_LINK_SETTINGS::mac_addr, mbg_chk_dev_has_lan_intf, MBG_ERR_NO_MEM, mbg_get_ip4_state(), mbg_get_lan_if_info(), MBG_IP_ADDR_TYPE_IP4, MBG_NET_INTF_ADDR_MASK_DHCP4, MBG_NET_INTF_LINK_PORT_TYPE_MASK_TP, MBG_NET_INTF_LINK_PORT_TYPE_TP, MBG_NET_INTF_LINK_SPEED_MODE_MASK_100_T_FULL, MBG_NET_INTF_LINK_SPEED_MODE_MASK_100_T_HALF, MBG_NET_INTF_LINK_SPEED_MODE_MASK_10_T_FULL, MBG_NET_INTF_LINK_SPEED_MODE_MASK_10_T_HALF, MBG_NET_INTF_LINK_STATE_MASK_LOWER_UP, MBG_NET_INTF_LINK_STATE_MASK_UP, MBG_NET_INTF_LINK_TYPE_MASK_PHYS, MBG_NET_INTF_LINK_TYPE_MASK_VLAN, MBG_NET_INTF_LINK_TYPE_PHYS, MBG_NET_INTF_LINK_TYPE_VLAN, MBG_NET_INTF_ROUTE_TYPE_DEFAULT_GATEWAY, mbg_rc_is_error, mbg_rc_is_success, MBG_NET_GLB_CFG_INFO::n_supp_intf_addr, MBG_NET_GLB_CFG_INFO::n_supp_intf_link, MBG_NET_GLB_CFG_INFO::n_supp_intf_route, MBG_NET_INTF_LINK_SETTINGS::name, IP4_SETTINGS::netmask, MBG_NET_GLB_CFG_SETTINGS::num_intf_addr, MBG_NET_GLB_CFG_SETTINGS::num_intf_link, MBG_NET_GLB_CFG_SETTINGS::num_intf_route, MBG_NET_INTF_LINK_SETTINGS::port_type, MBG_NET_INTF_ADDR_SETTINGS::prefix_bits, ALL_NET_CFG_INFO::route_infos, MBG_NET_INTF_ROUTE_INFO::route_settings, snprintf_safe(), MBG_NET_INTF_LINK_SETTINGS::states, MBG_NET_INTF_ADDR_INFO::supp_flags, MBG_NET_INTF_LINK_INFO::supp_port_types, MBG_NET_INTF_LINK_INFO::supp_speed_modes, MBG_NET_INTF_LINK_INFO::supp_states, MBG_NET_INTF_LINK_INFO::supp_types, MBG_IP_ADDR::type, MBG_NET_INTF_LINK_SETTINGS::type, MBG_NET_INTF_ROUTE_SETTINGS::type, MBG_IP_ADDR::u_addr, IP4_SETTINGS::vlan_cfg, and MBG_NET_INTF_LINK_SETTINGS::vlan_cfg.
Referenced by pcps_time_is_valid().
int mbg_get_all_ptp_cfg_info | ( | MBG_DEV_HANDLE | dh, |
ALL_PTP_CFG_INFO * | p | ||
) |
Read all PTP settings and supported configuration parameters.
The complementary function mbg_save_all_ptp_cfg_info should be used to write the modified configuration back to the device.
[in] | dh | Valid handle to a Meinberg device |
[out] | *p | Pointer to a ALL_PTP_CFG_INFO structure to be filled up |
Definition at line 869 of file deviohlp.c.
References ALL_PTP_CFG_INFO::all_ptp_uc_master_info_idx, MAX_PARM_PTP_UC_MASTER, MBG_ERR_N_UC_MSTR_EXCEEDS_SUPP, mbg_get_all_ptp_uc_master_info(), mbg_get_ptp_cfg_info(), mbg_get_ptp_uc_master_cfg_limits(), MBG_SUCCESS, PTP_UC_MASTER_CFG_LIMITS::n_supp_master, ALL_PTP_CFG_INFO::ptp_cfg_info, PTP_CFG_MSK_SUPPORT_PTP_UNICAST, ALL_PTP_CFG_INFO::ptp_uc_master_cfg_limits, and PTP_CFG_INFO::supp_flags.
Referenced by pcps_time_is_valid(), set_ptp_cfg(), and show_ptp_cfg().
int mbg_get_all_ucap_info | ( | MBG_DEV_HANDLE | dh, |
ALL_UCAP_INFO ** | p | ||
) |
Read all user capture information and store it into a newly allocated or reused ALL_UCAP_INFO.
The appropriate number of TTM structures will be allocated and needs to be freed by calling free_all_ucap_info. Existing user captures will not be removed, so the number of user captures can never decrease.
[in] | dh | Valid handle to a Meinberg device |
[out] | p | Pointer to a pointer to ALL_UCAP_INFO |
Definition at line 1169 of file deviohlp.c.
References _get_gpio_fixed_freq_str, _get_gpio_port_state_name, _get_gpio_signal_shape_name, _get_gpio_type_name, _get_xmr_holdover_status_mode_name, XMULTI_REF_SETTINGS::bias, calloc_ucap_entry(), DEFAULT_MULTI_REF_NAMES, MBG_GPIO_SETTINGS::ff_out, XMULTI_REF_INSTANCES::flags, XMR_HOLDOVER_STATUS::flags, MBG_GPIO_CFG_LIMITS::flags, MBG_GPIO_FREQ::frac, free_all_ucap_info(), MBG_GPIO_FREQ_OUT_SETTINGS::freq, MBG_GPIO_FIXED_FREQ_OUT_SETTINGS::freq_idx, MBG_GPIO_SETTINGS::freq_in, MBG_GPIO_SETTINGS::freq_out, UCAP_ENTRY::head, MBG_GPIO_FREQ::hz, XMULTI_REF_SETTINGS_IDX::idx, ALL_UCAP_INFO::list, MAX_N_MULTI_REF_TYPES, MAX_UCAP_ENTRIES, mbg_chk_dev_has_gpio, mbg_chk_dev_has_xmr, mbg_dev_has_gpio(), mbg_dev_has_xmr(), MBG_ERR_NO_MEM, mbg_get_gpio_cfg_limits(), mbg_get_gps_all_gpio_info(), mbg_get_gps_all_gpio_status(), mbg_get_gps_all_xmr_info(), mbg_get_gps_all_xmr_status(), mbg_get_gps_ucap(), mbg_get_xmr_holdover_status(), mbg_get_xmr_instances(), MBG_GPIO_CFG_LIMIT_FLAG_MASK_STATUS_SUPP, MBG_GPIO_TYPE_BITS_IN, MBG_GPIO_TYPE_BITS_OUT, MBG_GPIO_TYPE_FIXED_FREQ_OUT, MBG_GPIO_TYPE_FREQ_IN, MBG_GPIO_TYPE_FREQ_OUT, mbg_klist_append_item(), mbg_klist_delete_item(), mbg_klist_first_entry, mbg_klist_init(), mbg_rc_is_error, mbg_set_gps_gpio_settings_idx(), mbg_set_gps_xmr_settings_idx(), MBG_SUCCESS, MBG_GPIO_FREQ_OUT_SETTINGS::milli_phase, XMR_HOLDOVER_STATUS::mode, XMULTI_REF_INSTANCES::n_inst, N_MULTI_REF, XMULTI_REF_INSTANCES::n_xmr_settings, NANO_TIME::nano_secs, MBG_GPIO_CFG_LIMITS::num_io, ALL_UCAP_INFO::num_ucaps, MBG_GPIO_STATUS::port_state, XMULTI_REF_SETTINGS::precision, TM_GPS::sec, NANO_TIME::secs, XMULTI_REF_SETTINGS_IDX::settings, XMULTI_REF_INFO::settings, MBG_GPIO_INFO::settings, MBG_GPIO_FREQ_OUT_SETTINGS::shape, MBG_GPIO_FIXED_FREQ_OUT_SETTINGS::shape, XMULTI_REF_INSTANCES::slot_id, str_not_spc, test_gpio(), test_xmr(), TTM::tm, UCAP_ENTRY::ttm, MBG_GPIO_SETTINGS::type, MBG_GPIO_SETTINGS::u, verbose, XMR_HLDOVR_MSK_IN_HOLDOVER, XMR_HLDOVR_MSK_IN_TRANSITION, XMR_HLDOVR_MSK_TRANSITION_ENBD, and XMRIF_MSK_HOLDOVER_STATUS_SUPP.
Referenced by pcps_time_is_valid().
int mbg_get_all_xmulti_ref_info | ( | MBG_DEV_HANDLE | dh, |
ALL_XMULTI_REF_INFO ** | p | ||
) |
Read all XMR info into a newly or re-allocated ALL_XMULTI_REF_INFO.
A ALL_XMULTI_REF_INFO and a number of XMULTI_REF_INSTANCES::n_xmr_settings of XMULTI_REF_INFO_IDX and XMR_EXT_SRC_INFO_IDX will be allocated and needs to be freed by calling free_all_xmulti_ref_info
[in] | dh | Valid handle to a Meinberg device |
[out] | p | Pointer to a pointer of ALL_XMULTI_REF_INFO |
Definition at line 978 of file deviohlp.c.
References chk_dev_xmulti_ref_supp_ext_src_info(), XMULTI_REF_INSTANCES::flags, free_all_xmulti_ref_info(), ALL_XMULTI_REF_INFO::infos, ALL_XMULTI_REF_INFO::instances, MBG_ERR_NO_MEM, mbg_get_gps_all_xmr_info(), mbg_get_xmr_instances(), mbg_rc_is_error, mbg_rc_is_success, XMULTI_REF_INSTANCES::n_xmr_settings, and XMRIF_MSK_EXT_SRC_INFO_SUPP.
Referenced by pcps_time_is_valid().
int mbg_get_all_xmulti_ref_status | ( | MBG_DEV_HANDLE | dh, |
const ALL_XMULTI_REF_INFO * | info, | ||
ALL_XMULTI_REF_STATUS ** | p | ||
) |
Read all XMR status info into a newly or re-allocated ALL_XMULTI_REF_STATUS.
A ALL_XMULTI_REF_STATUS and a number of XMULTI_REF_INSTANCES::n_xmr_settings of XMULTI_REF_STATUS_IDX will be allocated and needs to be freed by calling free_all_xmulti_ref_status
[in] | dh | Valid handle to a Meinberg device |
[in] | info | Pointer to the appropriate info structure |
[out] | p | Pointer to a pointer of ALL_XMULTI_REF_STATUS |
Definition at line 1096 of file deviohlp.c.
References chk_dev_xmulti_ref_supp_ext_src_info(), free_all_xmulti_ref_status(), ALL_XMULTI_REF_INFO::instances, MBG_ERR_INV_PARM, MBG_ERR_NO_MEM, mbg_get_gps_all_xmr_status(), mbg_rc_is_error, mbg_rc_is_success, XMULTI_REF_INSTANCES::n_xmr_settings, and ALL_XMULTI_REF_STATUS::status.
Referenced by pcps_time_is_valid().
int mbg_get_serial_settings | ( | MBG_DEV_HANDLE | dh, |
const PCPS_DEV * | p_dev, | ||
RECEIVER_PORT_CFG * | p_rpcfg, | ||
const RECEIVER_INFO * | p_ri | ||
) |
Read all serial port settings and supported configuration parameters.
The functions mbg_get_device_info and mbg_setup_receiver_info must have been called before, and the returned PCPS_DEV and RECEIVER_INFO structures have to be passed to this function.
The complementary function mbg_save_serial_settings should be used to write the modified serial port configuration back to the board.
[in] | dh | Valid handle to a Meinberg device |
[in] | *p_dev | Pointer to a valid PCPS_DEV structure |
[out] | *p_rpcfg | Pointer to a RECEIVER_PORT_CFG structure to be filled up |
[in] | *p_ri | Pointer to a valid RECEIVER_INFO structure |
Definition at line 244 of file deviohlp.c.
References _pcps_has_receiver_info, _pcps_has_serial, _pcps_has_serial_hs, _pcps_is_gps, DEFAULT_BAUD_RATES_DCF, DEFAULT_BAUD_RATES_DCF_HS, mbg_get_gps_all_port_info(), mbg_get_gps_all_str_type_info(), mbg_get_gps_port_parm(), mbg_get_serial(), mbg_rc_is_error, MBG_SUCCESS, RECEIVER_PORT_CFG::pii, port_info_from_pcps_serial(), setup_default_str_type_info_idx(), setup_port_info_from_port_parm(), RECEIVER_PORT_CFG::stii, and RECEIVER_PORT_CFG::tmp_pp.
Referenced by check_get_receiver_port_cfg(), check_serial_mode(), pcps_time_is_valid(), and save_serial_settings().
int mbg_save_all_net_cfg_info | ( | MBG_DEV_HANDLE | dh, |
ALL_NET_CFG_INFO * | p | ||
) |
Write all network settings to a device.
The complementary function mbg_get_all_net_cfg_info should have been used to read the original network settings and supported configuration parameters.
The appropriate settings are translated into LAN_IP4 structures and send to the device using the appropriate API functions.
As soon as available, this function should make use of the NET_CFG API.
[in] | dh | Valid handle to a Meinberg device |
[in] | p | Pointer to a pointer of ALL_NET_CFG_INFO |
Definition at line 615 of file deviohlp.c.
References ALL_NET_CFG_INFO::addr_infos, MBG_NET_INTF_ADDR_INFO::addr_settings, MBG_NET_INTF_ADDR_SETTINGS::ass_if_index, IP4_SETTINGS::broad_addr, IP4_SETTINGS::flags, MBG_NET_INTF_ADDR_SETTINGS::flags, IP4_SETTINGS::gateway, MBG_NET_INTF_ROUTE_SETTINGS::gateway, ALL_NET_CFG_INFO::glb_cfg_info, MBG_NET_GLB_CFG_INFO::glb_settings, MBG_NET_INTF_LINK_INFO_IDX::info, MBG_NET_INTF_ADDR_INFO_IDX::info, MBG_NET_INTF_ROUTE_INFO_IDX::info, MBG_NET_INTF_ADDR_SETTINGS::ip, MBG_IP_ADDR::u_addr::ip4_addr, ip4_broad_addr_from_addr(), IP4_MSK_DHCP, IP4_MSK_VLAN, ip4_net_mask_from_cidr(), IP4_SETTINGS::ip_addr, ALL_NET_CFG_INFO::link_infos, MBG_NET_INTF_LINK_INFO::link_settings, mbg_chk_dev_has_lan_intf, MBG_IP_ADDR_TYPE_IP4, MBG_NET_INTF_ADDR_MASK_DHCP4, mbg_rc_is_success, mbg_set_ip4_settings(), IP4_SETTINGS::netmask, MBG_NET_GLB_CFG_SETTINGS::num_intf_link, MBG_NET_INTF_ADDR_SETTINGS::prefix_bits, ALL_NET_CFG_INFO::route_infos, MBG_NET_INTF_ROUTE_INFO::route_settings, MBG_IP_ADDR::type, MBG_IP_ADDR::u_addr, IP4_SETTINGS::vlan_cfg, and MBG_NET_INTF_LINK_SETTINGS::vlan_cfg.
Referenced by pcps_time_is_valid().
int mbg_save_all_ptp_cfg_info | ( | MBG_DEV_HANDLE | dh, |
const ALL_PTP_CFG_INFO * | p | ||
) |
Write all PTP settings to a device.
The complementary function mbg_get_all_ptp_cfg_info should have been used to read the original PTP settings and supported configuration parameters.
[in] | dh | Valid handle to a Meinberg device |
[in] | *p | Pointer to a valid ALL_PTP_CFG_INFO structure |
Definition at line 925 of file deviohlp.c.
References ALL_PTP_CFG_INFO::all_ptp_uc_master_info_idx, PTP_UC_MASTER_SETTINGS_IDX::idx, mbg_set_ptp_cfg_settings(), mbg_set_ptp_uc_master_settings_idx(), MBG_SUCCESS, PTP_UC_MASTER_CFG_LIMITS::n_supp_master, ALL_PTP_CFG_INFO::ptp_cfg_info, PTP_CFG_MSK_SUPPORT_PTP_UNICAST, ALL_PTP_CFG_INFO::ptp_uc_master_cfg_limits, PTP_CFG_INFO::settings, PTP_UC_MASTER_SETTINGS_IDX::settings, and PTP_CFG_INFO::supp_flags.
Referenced by pcps_time_is_valid(), and set_ptp_cfg().
_NO_MBG_API_ATTR int _MBG_API mbg_save_all_xmulti_ref_info | ( | MBG_DEV_HANDLE | dh, |
ALL_XMULTI_REF_INFO * | p | ||
) |
Set all extended multi ref settings to a device.
The complementary function mbg_get_all_xmulti_ref_info should have been used to read the original extended multi ref info.
[in] | dh | Valid handle to a Meinberg device |
[out] | p | Pointer to a ALL_XMULTI_REF_INFO structure with all settings |
Definition at line 1052 of file deviohlp.c.
References XMULTI_REF_SETTINGS::id, XMULTI_REF_SETTINGS_IDX::idx, XMULTI_REF_INFO_IDX::info, ALL_XMULTI_REF_INFO::infos, ALL_XMULTI_REF_INFO::instances, mbg_rc_is_success, mbg_set_gps_xmr_settings_idx(), MBG_SUCCESS, MULTI_REF_NONE, XMULTI_REF_INSTANCES::n_xmr_settings, XMULTI_REF_SETTINGS_IDX::settings, XMULTI_REF_INFO::settings, and XMULTI_REF_ID::type.
Referenced by pcps_time_is_valid().
int mbg_save_serial_settings | ( | MBG_DEV_HANDLE | dh, |
const PCPS_DEV * | p_dev, | ||
RECEIVER_PORT_CFG * | p_rpcfg, | ||
int | port_num | ||
) |
Write the configuration settings for a single serial port to a device.
Modifications to the serial port configuration should be made only after mbg_get_serial_settings had been called to read all serial port settings and supported configuration parameters. This function has finally to be called once for every serial port the configuration of which has been modified.
As also required by mbg_get_serial_settings, the functions mbg_get_device_info and mbg_setup_receiver_info must have been called before, and the returned PCPS_DEV and RECEIVER_INFO structures vave to be passed to this function.
[in] | dh | Valid handle to a Meinberg device |
[in] | *p_dev | Pointer to a valid PCPS_DEV structure |
[in] | *p_rpcfg | Pointer to a valid RECEIVER_PORT_CFG structure |
[in] | port_num | Index of the serial port to be saved |
Definition at line 353 of file deviohlp.c.
References _pcps_has_receiver_info, _pcps_is_gps, mbg_set_gps_port_parm(), mbg_set_gps_port_settings(), mbg_set_serial(), pcps_serial_from_port_info(), RECEIVER_PORT_CFG::pii, port_parm_from_port_settings(), and RECEIVER_PORT_CFG::tmp_pp.
Referenced by pcps_time_is_valid(), and save_serial_settings().
void pcps_pack_serial | ( | PCPS_SER_PACK * | p | ) |
Definition at line 1638 of file deviohlp.c.
References PCPS_SER_PACK::baud, BITMASK, PCPS_SER_PACK::frame, PCPS_SER_PACK::mode, PCPS_SER_PACK::pack, PCPS_BD_BITS, PCPS_FR_BITS, PCPS_FR_SHIFT, PCPS_MOD_BITS, and PCPS_MOD_SHIFT.
Referenced by pcps_serial_from_port_info(), and pcps_time_is_valid().
void pcps_serial_from_port_info | ( | PCPS_SERIAL * | p, |
const PORT_INFO_IDX * | p_pii | ||
) |
Definition at line 1567 of file deviohlp.c.
References PCPS_SER_PACK::baud, COM_PARM::baud_rate, PCPS_SER_PACK::frame, COM_PARM::framing, get_baud_rate_idx(), get_framing_idx(), PCPS_SER_PACK::mode, PORT_SETTINGS::mode, N_PCPS_FR_DCF, PCPS_SER_PACK::pack, PORT_SETTINGS::parm, pcps_pack_serial(), pcps_to_mbg_framing_tbl, PORT_INFO_IDX::port_info, and PORT_INFO::port_settings.
Referenced by mbg_save_serial_settings(), and pcps_time_is_valid().
void pcps_setup_isa_ports | ( | char * | s, |
int * | port_vals, | ||
int | n_vals | ||
) |
Definition at line 1662 of file deviohlp.c.
Referenced by pcps_time_is_valid().
|
static |
Check if a PCPS_TIME structure contains valid date and time.
[in] | p | The structure to be checked |
Definition at line 109 of file deviohlp.h.
References _MBG_API, _NO_MBG_API_ATTR, chk_feat_supp(), PCPS_TIME::hour, mbg_database::info, mbg_chk_get_all_gnss_info(), mbg_get_all_net_cfg_info(), mbg_get_all_net_status_info(), mbg_get_all_ptp_cfg_info(), mbg_get_all_ucap_info(), mbg_get_all_xmulti_ref_info(), mbg_get_all_xmulti_ref_status(), mbg_get_serial_settings(), mbg_save_all_net_cfg_info(), mbg_save_all_ptp_cfg_info(), mbg_save_all_xmulti_ref_info(), mbg_save_serial_settings(), PCPS_TIME::mday, PCPS_TIME::min, PCPS_TIME::month, pcps_pack_serial(), pcps_serial_from_port_info(), pcps_setup_isa_ports(), pcps_unpack_serial(), port_info_from_pcps_serial(), PCPS_TIME::sec, PCPS_TIME::sec100, setup_asic_features(), setup_device_type_name(), test_gpio(), test_xmr(), verbose, PCPS_TIME::wday, and PCPS_TIME::year.
void pcps_unpack_serial | ( | PCPS_SER_PACK * | p | ) |
Definition at line 1614 of file deviohlp.c.
References PCPS_SER_PACK::baud, BITMASK, PCPS_SER_PACK::frame, PCPS_SER_PACK::mode, PCPS_SER_PACK::pack, PCPS_BD_BITS, PCPS_FR_BITS, PCPS_FR_SHIFT, PCPS_MOD_BITS, and PCPS_MOD_SHIFT.
Referenced by pcps_time_is_valid(), and port_info_from_pcps_serial().
void port_info_from_pcps_serial | ( | PORT_INFO_IDX * | p_pii, |
PCPS_SERIAL | pcps_serial, | ||
uint32_t | supp_baud_rates | ||
) |
Definition at line 1532 of file deviohlp.c.
References PCPS_SER_PACK::baud, COM_PARM::baud_rate, DEFAULT_FRAMINGS_DCF, DEFAULT_SUPP_STR_TYPES_DCF, PCPS_SER_PACK::frame, COM_PARM::framing, COM_PARM::handshake, HS_NONE, mbg_baud_rates, mbg_framing_strs, PCPS_SER_PACK::mode, PORT_SETTINGS::mode, PCPS_SER_PACK::pack, PORT_SETTINGS::parm, pcps_to_mbg_framing_tbl, pcps_unpack_serial(), PORT_INFO_IDX::port_info, PORT_INFO::port_settings, PORT_SETTINGS::str_type, strncpy_safe(), PORT_INFO::supp_baud_rates, PORT_INFO::supp_framings, and PORT_INFO::supp_str_types.
Referenced by mbg_get_serial_settings(), and pcps_time_is_valid().
const char* setup_asic_features | ( | char * | s, |
size_t | max_len, | ||
MBG_DEV_HANDLE | dh | ||
) |
Definition at line 1711 of file deviohlp.c.
References mbg_chk_dev_has_asic_features, mbg_get_asic_features(), mbg_rc_is_success, PCI_ASIC_HAS_MM_IO, sn_cpy_str_safe(), and str_not_avail.
Referenced by pcps_time_is_valid().
const char* setup_device_type_name | ( | char * | s, |
size_t | max_len, | ||
MBG_DEV_HANDLE | dh, | ||
const RECEIVER_INFO * | p_ri | ||
) |
Definition at line 1685 of file deviohlp.c.
References _convert_asic_version_number, _pcps_asic_version_major, _pcps_asic_version_minor, mbg_chk_dev_has_asic_version, mbg_get_asic_version(), mbg_rc_is_success, RECEIVER_INFO::model_name, PCPS_ASIC_STR_FMT, sn_cpy_str_safe(), and snprintf_safe().
Referenced by pcps_time_is_valid().
void test_gpio | ( | MBG_DEV_HANDLE | dh, |
const PCPS_DEV * | p_dev, | ||
int | verbose | ||
) |
Referenced by mbg_get_all_ucap_info(), and pcps_time_is_valid().
void test_xmr | ( | MBG_DEV_HANDLE | dh, |
const PCPS_DEV * | p_dev, | ||
int | verbose | ||
) |
Referenced by mbg_get_all_ucap_info(), and pcps_time_is_valid().