mbgtools-lx  4.2.8
deviohlp.h File Reference
#include <mbgdevio.h>
#include <cfg_hlp.h>

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)
 

Macro Definition Documentation

◆ _ext

#define _ext   extern

Definition at line 45 of file deviohlp.h.

Typedef Documentation

◆ MBG_ERR_MSG_FNC

typedef int MBG_ERR_MSG_FNC(const PCPS_DEV *p_dev, const char *s)

Definition at line 75 of file deviohlp.h.

Function Documentation

◆ chk_feat_supp()

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 
)

◆ mbg_chk_get_all_gnss_info()

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.

Parameters
[in]dhValid handle to a Meinberg device
[out]p_agiPointer to a ALL_GNSS_INFO to be filled
Returns
One of the MBG_RETURN_CODES
See also
mbg_get_gps_stat_info
mbg_get_gps_gnss_mode_info
mbg_get_gps_all_gnss_sat_info

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().

◆ mbg_get_all_net_cfg_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

Parameters
[in]dhValid handle to a Meinberg device
[out]pPointer to a pointer of ALL_NET_CFG_INFO
Returns
One of the MBG_RETURN_CODES
See also
mbg_chk_dev_has_lan_intf
mbg_get_lan_if_info
mbg_get_ip4_settings
free_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().

◆ mbg_get_all_net_status_info()

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

Parameters
[in]dhValid handle to a Meinberg device
[out]pPointer to a pointer of ALL_NET_STATUS_INFO
Returns
One of the MBG_RETURN_CODES
See also
mbg_chk_dev_has_lan_intf
mbg_get_lan_if_info
mbg_get_ip4_state
free_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().

◆ mbg_get_all_ptp_cfg_info()

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.

Parameters
[in]dhValid handle to a Meinberg device
[out]*pPointer to a ALL_PTP_CFG_INFO structure to be filled up
Returns
MBG_SUCCESS or error code returned by device I/O control function.
See also
mbg_save_all_ptp_cfg_info
mbg_get_ptp_cfg_info
mbg_get_ptp_uc_master_cfg_limits
mbg_get_all_ptp_uc_master_info
mbg_chk_dev_has_ptp
mbg_chk_dev_has_ptp_unicast

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().

◆ mbg_get_all_ucap_info()

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.

Note
mbg_chk_dev_has_ucap should be called to check if this API is supported.

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.

Parameters
[in]dhValid handle to a Meinberg device
[out]pPointer to a pointer to ALL_UCAP_INFO
Returns
One of the MBG_RETURN_CODES
See also
mbg_chk_dev_has_ucap
free_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().

◆ mbg_get_all_xmulti_ref_info()

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.

Note
mbg_chk_dev_has_xmr should be called before using this function

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

Parameters
[in]dhValid handle to a Meinberg device
[out]pPointer to a pointer of ALL_XMULTI_REF_INFO
Returns
One of the MBG_RETURN_CODES
See also
free_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().

◆ mbg_get_all_xmulti_ref_status()

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.

Note
mbg_chk_dev_has_xmr should be called before using this function

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

Parameters
[in]dhValid handle to a Meinberg device
[in]infoPointer to the appropriate info structure
[out]pPointer to a pointer of ALL_XMULTI_REF_STATUS
Returns
One of the MBG_RETURN_CODES
See also
free_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().

◆ mbg_get_serial_settings()

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.

Parameters
[in]dhValid handle to a Meinberg device
[in]*p_devPointer to a valid PCPS_DEV structure
[out]*p_rpcfgPointer to a RECEIVER_PORT_CFG structure to be filled up
[in]*p_riPointer to a valid RECEIVER_INFO structure
Returns
MBG_SUCCESS or error code returned by device I/O control function
See also
mbg_get_device_info
mbg_setup_receiver_info
mbg_save_serial_settings

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().

◆ mbg_save_all_net_cfg_info()

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.

Parameters
[in]dhValid handle to a Meinberg device
[in]pPointer to a pointer of ALL_NET_CFG_INFO
Returns
One of the MBG_RETURN_CODES
See also
mbg_chk_dev_has_lan_intf
mbg_set_ip4_settings

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().

◆ mbg_save_all_ptp_cfg_info()

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.

Parameters
[in]dhValid handle to a Meinberg device
[in]*pPointer to a valid ALL_PTP_CFG_INFO structure
Returns
MBG_SUCCESS or error code returned by device I/O control function.
See also
mbg_get_all_ptp_cfg_info
mbg_set_ptp_cfg_settings
mbg_set_ptp_uc_master_settings_idx
mbg_chk_dev_has_ptp
mbg_chk_dev_has_ptp_unicast

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().

◆ mbg_save_all_xmulti_ref_info()

_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.

Parameters
[in]dhValid handle to a Meinberg device
[out]pPointer to a ALL_XMULTI_REF_INFO structure with all settings
Returns
One of the MBG_RETURN_CODES
See also
mbg_set_gps_xmr_settings_idx

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().

◆ mbg_save_serial_settings()

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.

Parameters
[in]dhValid handle to a Meinberg device
[in]*p_devPointer to a valid PCPS_DEV structure
[in]*p_rpcfgPointer to a valid RECEIVER_PORT_CFG structure
[in]port_numIndex of the serial port to be saved
Returns
MBG_SUCCESS or error code returned by device I/O control function.
See also
mbg_get_serial_settings
mbg_get_device_info
mbg_setup_receiver_info

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().

◆ pcps_pack_serial()

◆ pcps_serial_from_port_info()

◆ pcps_setup_isa_ports()

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().

◆ pcps_time_is_valid()

◆ pcps_unpack_serial()

◆ port_info_from_pcps_serial()

◆ setup_asic_features()

const char* setup_asic_features ( char *  s,
size_t  max_len,
MBG_DEV_HANDLE  dh 
)

◆ setup_device_type_name()

◆ test_gpio()

void test_gpio ( MBG_DEV_HANDLE  dh,
const PCPS_DEV p_dev,
int  verbose 
)

◆ test_xmr()

void test_xmr ( MBG_DEV_HANDLE  dh,
const PCPS_DEV p_dev,
int  verbose 
)