51 #define DEFAULT_BAUD_RATES_DCF \ 61 #define DEFAULT_BAUD_RATES_DCF_HS \ 69 MBG_PORT_HAS_19200 | \ 74 #define DEFAULT_FRAMINGS_DCF \ 87 const char *cp = NULL;
90 if ( chk_supp_fnc == NULL )
99 cp =
"Tried checking feature support with invalid device handle.";
104 rc = chk_supp_fnc( dh );
117 cp =
"Failed to check if supported";
120 if ( err_msg_fnc && cp )
121 err_msg_fnc( p_dev, cp );
163 memset( p_agi, 0,
sizeof( *p_agi ) );
251 memset( p_rpcfg, 0,
sizeof( *p_rpcfg ) );
373 &p_rpcfg->
pii[port_num].port_info.port_settings, 1 );
425 if ( net_cfg_info == NULL )
428 if ( net_cfg_info == NULL )
568 if ( ip4_settings.
gateway != 0 )
623 memset( &ip4_settings, 0,
sizeof( ip4_settings ) );
681 if ( net_status_info == NULL )
684 if ( net_status_info == NULL )
839 net_status_info = NULL;
842 *p = net_status_info;
873 memset( p, 0,
sizeof( *p ) );
943 memset( &s, 0,
sizeof( s ) );
983 if ( xmr_info == NULL )
986 if ( xmr_info == NULL )
999 if ( xmr_info->
infos == NULL )
1002 if ( xmr_info->
infos == NULL )
1067 memset( &settings, 0,
sizeof( settings ) );
1104 if ( xmr_status == NULL )
1107 if ( xmr_status == NULL )
1114 if ( xmr_status->
status == NULL )
1118 if ( xmr_status->
status == NULL )
1176 if ( ucap_info == NULL )
1178 ucap_info = (
ALL_UCAP_INFO* )calloc( 1,
sizeof( *ucap_info ) );
1179 if ( ucap_info == NULL )
1241 #if 0 && defined( DEBUG ) // ### TODO 1255 printf(
"\nGPIO chk supp: %i\n", rc );
1261 printf(
"GPIO not supported, rc: %i, b: %i\n", rc, b );
1265 printf(
"GPIO supported, rc: %i, b: %i\n", rc, b );
1267 printf(
"\nChecking GPIO:\n" );
1273 printf(
"Failed to read GPIO limits, rc: %i\n", rc );
1277 printf(
"Number of GPIO ports: %i\n", gpio_cfg_limits.
num_io );
1282 printf(
"Failed to read all GPIO info, rc: %i\n", rc );
1285 printf(
"GPIO status not supported (flag not set).\n" );
1291 printf(
"Failed to read all GPIO status, rc: %i\n", rc );
1295 for ( i = 0; i < gpio_cfg_limits.
num_io; i++ )
1301 printf(
"GPIO %i: type 0x%02X (%s)", i,
1304 switch ( gpio_type )
1323 printf(
" %lu.%lu Hz %s, phase %li.%03li deg",
1358 printf(
", status 0x%02X (%s)",
1388 printf(
"\nXMR chk supp: %i\n", rc );
1394 printf(
"XMR not supported, rc: %i, b: %i\n", rc, b );
1398 printf(
"XMR supported, rc: %i, b: %i\n", rc, b );
1400 printf(
"\nChecking XMR:\n" );
1406 printf(
"*** Failed to read XMR instances, rc: %i\n", rc );
1410 printf(
"Slot %u, supp. XMR instances/priority levels: %u, flags: 0x%08lX\n",
1423 int n_inst = xmr_instances.
n_inst[i];
1430 printf(
"%u %s input%s supported\n", n_inst,
1431 multi_ref_names[i], ( n_inst == 1 ) ?
"" :
"s" );
1434 printf(
"No %s input supported\n", multi_ref_names[i] );
1443 printf(
"*** Warning: %u instances of unknown signal type idx %u supported!\n",
1450 printf(
"*** Failed to read all XMR info, rc: %i\n", rc );
1455 printf(
"*** Failed to read all XMR status, rc: %i\n", rc );
1461 printf(
"XMR %i: %li\n", i,
1475 printf(
"Failed to write XMR settings %i, rc: %i\n", i, rc );
1480 printf(
"*** Warning: XMR holdover status not supported!\n" );
1486 printf(
"*** Failed to read XMR holdover status, rc: %i\n", rc );
1489 printf(
"XMR mode: %s, %s%s, %s%s, %s%s\n",
1517 #endif // defined DEBUG 1535 uint32_t supp_baud_rates
1542 ser_pack.
pack = pcps_serial;
1669 for ( i = 0; i < n_vals; i++ )
1674 *port_vals++ = (
uint16_t) strtoul( s, &s, 16 );
#define PCPS_MOD_BITS
field with in the cfg byte
MBG_IP_ADDR broadcast
Broadcast address associated with this interface.
_MBG_API_ATTR int _MBG_API mbg_get_gps_all_xmr_status(MBG_DEV_HANDLE dh, XMULTI_REF_STATUS_IDX xmrsi[], const XMULTI_REF_INSTANCES *p_xmri)
Read the status of all XMR sources.
_NO_MBG_API_ATTR int _MBG_API chk_dev_xmulti_ref_supp_ext_src_info(const ALL_XMULTI_REF_INFO *info)
_MBG_API_ATTR int _MBG_API mbg_get_gps_all_str_type_info(MBG_DEV_HANDLE dh, STR_TYPE_INFO_IDX stii[], const RECEIVER_INFO *p_ri)
Read a STR_TYPE_INFO_IDX array of supported string types.
uint8_t type
see MULTI_REF_TYPES, and note for XMRIF_BIT_MRF_NONE_SUPP
Configuration settings for a specific PTP unicast master.
PTP_CFG_INFO ptp_cfg_info
Variable frequency input, freq == 0 if input not used.
uint32_t num_io
number of supported GPIO ports
uint8_t type
see MBG_IP_ADDR_TYPES
TM_GPS tm
time converted to UTC and/or local time according to TZDL settings
_MBG_API_ATTR int _MBG_API mbg_get_xmr_holdover_status(MBG_DEV_HANDLE dh, XMR_HOLDOVER_STATUS *p, const XMULTI_REF_INSTANCES *p_xmri)
Read the current XMR holdover interval from a device.
COM_PARM parm
transmission speed, framing, etc.
void pcps_pack_serial(PCPS_SER_PACK *p)
MBG_GPIO_SETTINGS settings
current settings
Configuration of a GPIO variable frequency input.
struct mbg_klist_head list
User capture counter, see MAX_UCAP_ENTRIES.
_MBG_API_ATTR int _MBG_API mbg_get_gps_all_gnss_sat_info(MBG_DEV_HANDLE dh, GNSS_SAT_INFO_IDX gsii[], const MBG_GNSS_MODE_INFO *p_mi)
Read a GNSS_SAT_INFO_IDX array of satellite status information.
_MBG_API_ATTR int _MBG_API mbg_set_ptp_uc_master_settings_idx(MBG_DEV_HANDLE dh, const PTP_UC_MASTER_SETTINGS_IDX *p)
Write PTP/IEEE1588 unicast configuration settings to a device.
void free_all_net_status_info(ALL_NET_STATUS_INFO *p)
Free an ALL_NET_STATUS_INFO structure.
_MBG_API_ATTR int _MBG_API mbg_get_gps_ucap(MBG_DEV_HANDLE dh, TTM *p)
Read a time capture event from the on-board FIFO buffer using a TTM structure.
Settings of an IPv4-only network interface.
char * strncpy_safe(char *dst, const char *src, size_t max_len)
A portable, safe implementation of strncpy()
XMULTI_REF_INFO_IDX * infos
int setup_default_str_type_info_idx(STR_TYPE_INFO_IDX stii[], const RECEIVER_INFO *p_ri)
uint16_t n_supp_master
number of unicast masters which can be specified
uint32_t if_index
Interface index assigned by the kernel.
uint8_t prefix_bits
Number of subnet mask bits for CIDR notation, e.g. 24 for /24.
#define _pcps_asic_version_major(_v)
Extract the major part of an ASIC version number.
MBG_MAC_ADDR mac_addr
MAC address.
_MBG_API_ATTR int _MBG_API mbg_get_lan_if_info(MBG_DEV_HANDLE dh, LAN_IF_INFO *p)
Read LAN interface information from a device.
uint8_t n_inst[32]
the number of supported instances of each input signal type
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)
MBG_NET_INTF_ADDR_INFO_IDX * addr_infos
uint8_t num_intf_link
number of detected/configured physical network interfaces (links), see MBG_NET_INTF_LINK_INFO_IDX ...
void free_all_xmulti_ref_info(ALL_XMULTI_REF_INFO *p)
Free an ALL_XMULTI_REF_INFO structure.
#define DEFAULT_BAUD_RATES_DCF
void free_all_ucap_info(ALL_UCAP_INFO *p)
Free memory allocated by mbgextio_get_all_ucap_info.
PTP_UC_MASTER_CFG_LIMITS ptp_uc_master_cfg_limits
#define DEFAULT_SUPP_STR_TYPES_DCF
Bit mask of string types supported by legacy DCF77 receivers.
uint32_t states
see MBG_NET_INTF_LINK_STATE_MASKS
#define _get_gpio_port_state_name(_i)
Status information on a ref time source at a specific priority level.
_MBG_API_ATTR int _MBG_API mbg_set_serial(MBG_DEV_HANDLE dh, const PCPS_SERIAL *p)
Write the serial port configuration to an old type of device.
#define MBG_ERR_INV_PARM
Invalid parameter.
uint32_t type
GPIO type, see MBG_GPIO_TYPES.
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.
see MBG_NET_INTF_LINK_PORT_TYPE_TP
Configuration settings of a serial port.
static __mbg_inline void mbg_klist_append_item(struct mbg_klist_head *head, struct mbg_klist_head *item)
int8_t sec
seconds, 0..59, or 60 in case of inserted leap second
struct mbg_klist_head head
#define _get_gpio_fixed_freq_str(_i)
MBG_GNSS_MODE_INFO gnss_mode_info
int mbg_save_all_net_cfg_info(MBG_DEV_HANDLE dh, ALL_NET_CFG_INFO *p)
Write all network settings to a device.
XMULTI_REF_SETTINGS settings
current settings
#define _pcps_has_serial(_d)
#define DEFAULT_BAUD_RATES_DCF_HS
uint32_t idx
index, 0..PTP_UC_MASTER_CFG_LIMITS::n_supp_master-1
union MBG_IP_ADDR::u_addr u_addr
Query MBG_NET_INTF_LINK_INFO by its index.
void port_parm_from_port_settings(PORT_PARM *p_pp, int port_idx, const PORT_SETTINGS *p_ps, int cap_str_idx)
Set up a a legacy PORT_PARM structure from a PORT_SETTINGS structure.
#define MBG_ERR_N_UC_MSTR_EXCEEDS_SUPP
Num. PTP unicast masters of the device exceeds max. supp. by driver.
Real physical network interface.
Query MBG_NET_INTF_ROUTE_INFO by its index.
int sn_cpy_str_safe(char *dst, size_t max_len, const char *src)
A function to copy a string safely, returning the number of characters copied.
uint32_t flags
see XMR_INST_FLAG_BIT_MASKS
MBG_CHK_SUPP_FNC mbg_chk_dev_has_asic_features
Check if a device supports the mbg_get_asic_features call.
uint8_t frame
The unpacked framing code, see PCPS_FR_CODES.
#define mbg_rc_is_success(_rc)
MBG_CHK_SUPP_FNC mbg_chk_dev_has_gpio
Check if a device provides GPIO signal inputs and/or outputs.
uint16_t n_supp_intf_addr
max. number of supported interface addresses, see MBG_NET_INTF_ADDR_SETTINGS_IDX, MBG_NET_INTF_ADDR_I...
uint8_t PCPS_SERIAL
Legacy definitions used to configure a device's serial port.
A GPIO port's current settings and limits.
MBG_CHK_SUPP_FNC mbg_chk_dev_is_gps
Check if a device is a GPS receiver.
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.
uint16_t n_supp_intf_link
max. number of supported physical network interfaces (links), see MBG_NET_INTF_LINK_SETTINGS_IDX, MBG_NET_INTF_LINK_INFO_IDX
MBG_GPIO_FREQ_IN_SETTINGS freq_in
if MBG_GPIO_SETTINGS::type is MBG_GPIO_TYPE_FREQ_IN
_MBG_API_ATTR int _MBG_API mbg_get_gps_all_gpio_info(MBG_DEV_HANDLE dh, MBG_GPIO_INFO_IDX gii[], const MBG_GPIO_CFG_LIMITS *p_gcl)
Get all GPIO settings and capabilities.
_MBG_API_ATTR int _MBG_API mbg_get_ip4_settings(MBG_DEV_HANDLE dh, IP4_SETTINGS *p)
Read LAN IPv4 settings from a device.
int get_baud_rate_idx(BAUD_RATE baud_rate)
General GPIO config info to be read from a device.
#define DEFAULT_MULTI_REF_NAMES
Names of known ref time sources.
#define _get_xmr_holdover_status_mode_name(_i)
const char * setup_device_type_name(char *s, size_t max_len, MBG_DEV_HANDLE dh, const RECEIVER_INFO *p_ri)
uint8_t baud
The unpacked baud rate code, see PCPS_BD_CODES.
#define PCPS_ASIC_STR_FMT
_MBG_API_ATTR int _MBG_API mbg_set_ptp_cfg_settings(MBG_DEV_HANDLE dh, const PTP_CFG_SETTINGS *p)
Write PTP/IEEE1588 configuration settings to a device.
uint32_t supp_flags
see MBG_NET_INTF_ADDR_MASKS
uint32_t ass_if_index
Index of the associated interface link, see MBG_NET_INTF_LINK_SETTINGS::if_index. ...
static __mbg_inline void mbg_klist_init(struct mbg_klist_head *head)
_MBG_API_ATTR int _MBG_API mbg_get_asic_features(MBG_DEV_HANDLE dh, PCI_ASIC_FEATURES *p)
Read the features of the on-board PCI/PCIe interface ASIC.
_MBG_API_ATTR int _MBG_API mbg_set_gps_xmr_settings_idx(MBG_DEV_HANDLE dh, const XMULTI_REF_SETTINGS_IDX *p)
Write a single XMR setting to a device.
int32_t milli_phase
phase [1/1000 degree units], see MBG_GPIO_FREQ_OUT_SUPP::milli_phase_max
MBG_CHK_SUPP_FNC mbg_chk_dev_is_gnss
Check if a device supports GNSS configuration.
see XMRIF_BIT_HOLDOVER_STATUS_SUPP
IP4_ADDR ip_addr
the IP address
uint32_t supp_flags
a bit mask of supported features, see PTP_CFG_FLAG_MASKS
uint32_t frac
fractional part, binary (0x80000000 –> 0.5, 0xFFFFFFFF –> 0.9999999...)
#define _pcps_has_receiver_info(_d)
static __mbg_inline IP4_ADDR ip4_net_mask_from_cidr(int netmask_bits)
Compute an IP4 net mask according to the number of CIDR netmask bits.
_MBG_API_ATTR int _MBG_API mbg_dev_has_xmr(MBG_DEV_HANDLE dh, int *p)
Check if a device provides extended multi ref (XMR) inputs.
Status information on a single GPIO port.
#define MBG_NET_INTF_LINK_SPEED_MODE_MASK_10_T_HALF
see MBG_NET_INTF_LINK_SPEED_MODE_10_T_HALF
void pcps_setup_isa_ports(char *s, int *port_vals, int n_vals)
char label[16]
Interface label.
MBG_IP_ADDR ip
IP address associated with this interface.
Summary information on all supported GNSS systems.
uint16_t n_xmr_settings
number of XMULTI_REF_INFO_IDX or XMULTI_REF_STATUS_IDX which can be retrieved
_MBG_API_ATTR int _MBG_API mbg_dev_has_gpio(MBG_DEV_HANDLE dh, int *p)
Check if a device provides GPIO signal inputs and/or outputs.
_MBG_API_ATTR int _MBG_API mbg_get_ptp_cfg_info(MBG_DEV_HANDLE dh, PTP_CFG_INFO *p)
Read PTP/IEEE1588 config info and current settings from a device.
#define _get_gpio_signal_shape_name(_i)
Variable frequency output.
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 structure used to specify a variable frequency.
uint32_t ass_if_index
Index of the associated interface link, see MBG_NET_INTF_LINK_SETTINGS::if_index. ...
#define MAX_PARM_PTP_UC_MASTER
The max number of PTP unicast masters supported by configuration programs.
#define MBG_ERR_INV_HANDLE
invalid file/device handle specified
Reference source configuration for a specific priority level.
A helper structure used with configuration of old DCF77 clocks.
char framing[4]
ASCIIZ framing string, e.g. "8N1" or "7E2", see MBG_FRAMING_STRS.
the number of defined sources, must not exceed MAX_N_MULTI_REF_TYPES
uint8_t str_type
index of the supported time string formats, see STR_TYPE_INFO_IDX
#define PCPS_FR_SHIFT
num of bits to shift left
#define _get_gpio_type_name(_i)
MBG_MAC_ADDR mac_addr
Physical hardware address.
_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.
ALL_PTP_UC_MASTER_INFO_IDX all_ptp_uc_master_info_idx
_MBG_API_ATTR int _MBG_API mbg_get_gps_port_parm(MBG_DEV_HANDLE dh, PORT_PARM *p)
Read a PORT_PARM structure with a device's serial port configuration.
uint8_t mode
XMR/holdover mode, see XMR_HOLDOVER_STATUS_MODES.
#define MBG_NET_INTF_LINK_STATE_MASK_LOWER_UP
see MBG_NET_INTF_LINK_STATE_BIT_LOWER_UP
#define PCPS_FR_BITS
field with in the cfg byte
PTP_UC_MASTER_SETTINGS settings
specification for the unicast master with that index
#define MBG_NET_INTF_LINK_SPEED_MODE_MASK_10_T_FULL
see MBG_NET_INTF_LINK_SPEED_MODE_10_T_FULL
uint16_t n_supp_intf_route
max. number of supported interface routes, see MBG_NET_INTF_ROUTE_SETTINGS_IDX, MBG_NET_INTF_ROUTE_IN...
MBG_VLAN_CFG vlan_cfg
VLAN configuration.
MBG_NET_INTF_LINK_INFO info
see MBG_NET_INTF_LINK_INFO
Framed data stream output.
_MBG_API_ATTR int _MBG_API mbg_get_serial(MBG_DEV_HANDLE dh, PCPS_SERIAL *p)
Read the serial port configuration from an old type of device.
uint8_t num_intf_route
number of configured interface routes, see MBG_NET_INTF_ROUTE_INFO_IDX
MBG_NET_INTF_LINK_INFO_IDX * link_infos
_MBG_API_ATTR int _MBG_API mbg_get_gps_all_port_info(MBG_DEV_HANDLE dh, PORT_INFO_IDX pii[], const RECEIVER_INFO *p_ri)
Read a PORT_INFO_IDX array of supported serial port configurations.
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.
uint16_t flags
see MBG_IP4_FLAG_MASKS
All network configuration parameters.
Reference source capabilities and current configuration.
MBG_CHK_SUPP_FNC mbg_chk_dev_has_lan_intf
Check if a device supports simple LAN interface API calls.
A GPIO port's current settings, plus port index.
uint32_t XMR_HOLDOVER_INTV
XMR holdover interval, or elapsed holdover time, in [s].
XMULTI_REF_INSTANCES instances
MBG_NET_GLB_CFG_INFO glb_cfg_info
void pcps_serial_from_port_info(PCPS_SERIAL *p, const PORT_INFO_IDX *p_pii)
see MBG_NET_INTF_LINK_TYPE_VLAN
void pcps_unpack_serial(PCPS_SER_PACK *p)
uint32_t flags
see MBG_NET_INTF_ADDR_MASKS
uint32_t PCI_ASIC_FEATURES
A data type to hold the PCI ASIC feature flags mask.
see MBG_NET_INTF_ADDR_BIT_DHCP4
_MBG_API_ATTR int _MBG_API mbg_get_gps_stat_info(MBG_DEV_HANDLE dh, STAT_INFO *p)
Read the extended GPS receiver status from a device.
int MBG_CHK_SUPP_FNC(MBG_DEV_HANDLE dh)
The type of functions to check if a feature is supported.
const char * setup_asic_features(char *s, size_t max_len, MBG_DEV_HANDLE dh)
_MBG_API_ATTR int _MBG_API mbg_get_ptp_uc_master_cfg_limits(MBG_DEV_HANDLE dh, PTP_UC_MASTER_CFG_LIMITS *p)
Read PTP/IEEE1588 unicast master configuration limits from a device.
uint32_t supp_port_types
see MBG_NET_INTF_LINK_PORT_TYPE_MASKS
#define MBG_ERR_UNSPEC
Unspecified error.
All PTP configuration parameters.
int get_ip4_net_mask_bits(const IP4_ADDR *p_mask)
Count the number of sequential bits in an IPv4 net mask.
MBG_GPIO_STATUS_IDX ALL_GPIO_STATUS_IDX[10]
Status information on all GPIO ports.
const char * str_not_avail
XMULTI_REF_SETTINGS settings
the settings configured for this level
uint32_t flags
holdover status flags, see XMR_HOLDOVER_STATUS_FLAG_MASKS
uint32_t flags
see MBG_GPIO_CFG_LIMIT_FLAG_MASKS
_MBG_API_ATTR int _MBG_API mbg_get_gps_gnss_mode_info(MBG_DEV_HANDLE dh, MBG_GNSS_MODE_INFO *p_mi)
Read the current GNSS mode info including current settings.
static const int pcps_to_mbg_framing_tbl[N_PCPS_FR_DCF]
Twisted Pair (TP) copper cable.
see XMR_HLDOVR_BIT_IN_HOLDOVER
uint16_t idx
the priority level index (highest == 0), 0..XMULTI_REF_INSTANCES::n_xmr_settings-1 ...
MBG_GPIO_FREQ_OUT_SETTINGS freq_out
if MBG_GPIO_SETTINGS::type is MBG_GPIO_TYPE_FREQ_OUT
Configuration of a GPIO fixed frequency output.
XMULTI_REF_STATUS_IDX ALL_XMULTI_REF_STATUS_IDX[10]
Status of all XMR inputs.
General info on supported XMR sources and instances.
_MBG_API_ATTR int _MBG_API mbg_get_gps_all_gpio_status(MBG_DEV_HANDLE dh, MBG_GPIO_STATUS_IDX gsi[], const MBG_GPIO_CFG_LIMITS *p_gcl)
Read the status of all GPIO signal ports.
ALL_GNSS_SAT_INFO_IDX gnss_sat_info_idx
Current settings and general capabilities of a serial port.
#define PTP_CFG_MSK_SUPPORT_PTP_UNICAST
A bit mask of the unicast role bits within the flag bits.
MBG_NET_INTF_ADDR_INFO info
see MBG_NET_INTF_ADDR_INFO
#define MBG_ERR_NO_MEM
Failed to allocate memory.
PORT_PARM tmp_pp
used internally only, for compatibility
int32_t secs
[seconds], usually since 1970-01-01 00:00:00
int mbg_save_all_ptp_cfg_info(MBG_DEV_HANDLE dh, const ALL_PTP_CFG_INFO *p)
Write all PTP settings to a device.
int32_t nano_secs
[nanoseconds]
#define MBG_SUCCESS
Error codes used with Meinberg devices and drivers.
#define mbg_klist_first_entry(ptr, type, member)
see XMR_HLDOVR_BIT_TRANSITION_ENBD
XMULTI_REF_INFO_IDX ALL_XMULTI_REF_INFO_IDX[10]
Configuration settings for all XMR inputs.
Reference source capabilities and current configuration for a specific priority level.
uint32_t shape
selected signal shape, see MBG_GPIO_SIGNAL_SHAPES
_MBG_API_ATTR int _MBG_API mbg_get_gpio_cfg_limits(MBG_DEV_HANDLE dh, MBG_GPIO_CFG_LIMITS *p)
Read common GPIO configuration limits.
#define MBG_NET_INTF_LINK_SPEED_MODE_MASK_100_T_HALF
see MBG_NET_INTF_LINK_SPEED_MODE_100_T_HALF
NANO_TIME bias
time bias, e.g. path delay
uint8_t port_type
see MBG_NET_INTF_LINK_PORT_TYPES
MBG_CHK_SUPP_FNC mbg_chk_dev_has_xmr
Check if a device provides eXtended Multi Ref (XMR) inputs.
uint32_t hz
integral number [Hz]
see XMR_HLDOVR_BIT_IN_TRANSITION
uint8_t type
Type of the route entry, see MBG_NET_INTF_ROUTE_TYPES.
MBG_NET_INTF_ROUTE_INFO info
see MBG_NET_INTF_ROUTE_INFO
_MBG_API_ATTR int _MBG_API mbg_set_ip4_settings(MBG_DEV_HANDLE dh, const IP4_SETTINGS *p)
Write LAN IPv4 settings to a device.
const char * mbg_framing_strs[N_MBG_FRAMINGS]
IP4_ADDR netmask
the network mask
uint32_t freq_idx
fixed frequency index, see MBG_GPIO_FIXED_FREQS
XMULTI_REF_ID id
reference time source identifier
see XMRIF_BIT_EXT_SRC_INFO_SUPP
uint8_t mode
string mode, see STR_MODES
#define MBG_NET_INTF_LINK_STATE_MASK_UP
Network interface link state masks.
PTP_CFG_SETTINGS settings
the current configuration
uint32_t supp_str_types
bit mask of string types supp. by this port, i.e. bit 0 set if str_type[0] is supp.
PCPS_SERIAL pack
This packed byte is read from or written to the board.
NANO_TIME precision
precision of the time source
union MBG_GPIO_SETTINGS::@4 u
settings depending on the GPIO type, see MBG_GPIO_TYPES
VLAN interface, assigned to physical interface.
#define MBG_INVALID_DEV_HANDLE
uint32_t shape
selected signal shape, see MBG_GPIO_SIGNAL_SHAPES
MBG_GPIO_INFO_IDX ALL_GPIO_INFO_IDX[10]
Configuration settings for all GPIO ports.
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.
MBG_NET_INTF_ROUTE_INFO_IDX * route_infos
MBG_CHK_SUPP_FNC mbg_chk_dev_has_asic_version
Check if a device supports the mbg_get_asic_version API call.
Current settings and general capabilities of a specific serial port.
uint32_t PCI_ASIC_VERSION
A data type to hold the PCI ASIC version code.
uint8_t type
see MBG_NET_INTF_LINK_TYPES
uint32_t supp_framings
bit mask of framings supp. by this port, see MBG_FRAMING_MASKS
_MBG_API_ATTR int _MBG_API mbg_set_gps_port_parm(MBG_DEV_HANDLE dh, const PORT_PARM *p)
Write a PORT_PARM structure to configure the on-board serial ports.
void free_all_xmulti_ref_status(ALL_XMULTI_REF_STATUS *p)
Free an ALL_XMULTI_REF_STATUS structure.
see MBG_GPIO_CFG_LIMIT_FLAG_BIT_STATUS_SUPP
int mbg_chk_get_all_gnss_info(MBG_DEV_HANDLE dh, ALL_GNSS_INFO *p_agi)
Read or setup all GNSS status information.
#define DEFAULT_FRAMINGS_DCF
char name[16]
Interface name.
ALL_PORT_INFO_IDX pii
all serial port configuration settings
#define PCPS_MOD_SHIFT
num of bits to shift left
MBG_NET_GLB_CFG_SETTINGS glb_settings
int snprintf_safe(char *s, size_t max_len, const char *fmt,...)
A portable, safe implementation of snprintf()
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.
#define _pcps_asic_version_minor(_v)
Extract the minor part of an ASIC version number.
Query MBG_NET_INTF_ADDR_INFO by its index.
XMULTI_REF_INFO info
ref source configuration and capabilities
#define MBG_ERR_NOT_SUPP_BY_DEV
Command or feature not supported by device.
IP4_ADDR gateway
the default gateway
int16_t handshake
handshake mode, yet only HS_NONE supported
int mbg_get_all_ptp_cfg_info(MBG_DEV_HANDLE dh, ALL_PTP_CFG_INFO *p)
Read all PTP settings and supported configuration parameters.
uint8_t port_state
see MBG_GPIO_PORT_STATES
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)
char model_name[(16+1)]
ASCIIZ, name of receiver model.
void free_all_net_cfg_info(ALL_NET_CFG_INFO *p)
Free an ALL_NET_CFG_INFO structure.
_MBG_API_ATTR int _MBG_API mbg_set_gps_gpio_settings_idx(MBG_DEV_HANDLE dh, const MBG_GPIO_SETTINGS_IDX *p)
Write the configuration for a single GPIO port to a device.
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.
MBG_GPIO_FIXED_FREQ_OUT_SETTINGS ff_out
if MBG_GPIO_SETTINGS::type is MBG_GPIO_TYPE_FIXED_FREQ_OUT
BAUD_RATE mbg_baud_rates[N_MBG_BAUD_RATES]
void test_gpio(MBG_DEV_HANDLE dh, const PCPS_DEV *p_dev, int verbose)
_MBG_API_ATTR int _MBG_API mbg_get_asic_version(MBG_DEV_HANDLE dh, PCI_ASIC_VERSION *p)
Read the version code of the on-board PCI/PCIe interface ASIC.
#define mbg_rc_is_error(_rc)
PORT_SETTINGS port_settings
current configuration of the port
#define _convert_asic_version_number(_n)
Version number conversion macro.
int MBG_ERR_MSG_FNC(const PCPS_DEV *p_dev, const char *s)
MBG_GPIO_FREQ freq
frequency, see MBG_GPIO_FREQ_OUT_SUPP::freq_min and MBG_GPIO_FREQ_OUT_SUPP::freq_max ...
#define MAX_N_MULTI_REF_TYPES
Theoretical maximum number of multi ref input signal types.
uint8_t mode
The unpacked mode code, see PCPS_MOD_CODES.
_MBG_API_ATTR int _MBG_API mbg_get_xmr_instances(MBG_DEV_HANDLE dh, XMULTI_REF_INSTANCES *p)
Read XMULTI_REF_INSTANCES.
UCAP_ENTRY * calloc_ucap_entry(void)
Configuration of a GPIO variable frequency output.
#define _pcps_has_serial_hs(_d)
_MBG_API_ATTR int _MBG_API mbg_get_ip4_state(MBG_DEV_HANDLE dh, IP4_SETTINGS *p)
Read LAN IPv4 state from a device.
#define PCPS_BD_BITS
field with in the cfg byte
int setup_port_info_from_port_parm(PORT_INFO_IDX pii[], const PORT_PARM *p_pp, const RECEIVER_INFO *p_ri)
Setup an array of PORT_INFO_IDX structures from a PORT_PARM.
_MBG_API_ATTR int _MBG_API mbg_set_gps_port_settings(MBG_DEV_HANDLE dh, const PORT_SETTINGS *p, int idx)
Write the configuration for a single serial port to a device.
IP4_ADDR broad_addr
the broadcast address
static __mbg_inline void mbg_klist_delete_item(struct mbg_klist_head *item)
MBG_NET_INTF_ADDR_SETTINGS addr_settings
see MBG_NET_INTF_ADDR_SETTINGS
uint16_t idx
0..MBG_NET_GLB_CFG_SETTINGS::num_intf_link-1
uint8_t slot_id
ID of the slot in which this device is installed, 0 or up to 15, if multiple slots not supported...
IP4_ADDR ip4_addr
IPv4 address if MBG_IP_ADDR::type == MBG_IP_ADDR_TYPE_IP4.
uint32_t supp_baud_rates
bit mask of baud rates supp. by this port, see MBG_BAUD_RATE_MASKS
BAUD_RATE baud_rate
transmission speed, e.g. 19200L, see MBG_BAUD_RATES
A structure used to identify a device type and supported features.
#define PCI_ASIC_HAS_MM_IO
Bit masks used with PCI_ASIC_FEATURES.
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.
uint8_t num_intf_addr
number of configured interface addresses, see MBG_NET_INTF_ADDR_INFO_IDX
see MBG_NET_INTF_LINK_TYPE_PHYS
_MBG_API_ATTR int _MBG_API mbg_get_all_ptp_uc_master_info(MBG_DEV_HANDLE dh, PTP_UC_MASTER_INFO_IDX pii[], const PTP_UC_MASTER_CFG_LIMITS *p_umsl)
Read PTP Unicast master settings and configuration options.
MBG_NET_INTF_LINK_SETTINGS link_settings
see MBG_NET_INTF_LINK_SETTINGS
Framed data stream input.
uint32_t supp_speed_modes
see MBG_NET_INTF_LINK_SPEED_MODE_MASKS
MBG_NET_INTF_ROUTE_SETTINGS route_settings
see MBG_NET_INTF_ROUTE_SETTINGS
#define MBG_NET_INTF_LINK_SPEED_MODE_MASK_100_T_FULL
see MBG_NET_INTF_LINK_SPEED_MODE_100_T_FULL
Simple LAN interface information.
static __mbg_inline IP4_ADDR ip4_broad_addr_from_addr(const IP4_ADDR *p_addr, const IP4_ADDR *p_mask)
Determine the broadcast address for an IP4 address plus net mask.
int get_framing_idx(const char *framing)
int chk_set_n_gnss_supp(ALL_GNSS_INFO *p_agi)
ALL_STR_TYPE_INFO_IDX stii
all supported serial string types
uint32_t supp_states
see MBG_NET_INTF_LINK_STATE_MASKS
XMULTI_REF_STATUS_IDX * status
All configuration parameters for all serial ports.
_MBG_API_ATTR int _MBG_API mbg_get_gps_all_xmr_info(MBG_DEV_HANDLE dh, XMULTI_REF_INFO_IDX xmrii[], const XMULTI_REF_INSTANCES *p_xmri)
Read all XMR settings and capabilities.
uint32_t supp_types
see MBG_NET_INTF_LINK_TYPE_MASKS