mbgtools-lx  4.2.8
gpsserio.h File Reference
#include <gpsdefs.h>
#include <use_pack.h>
#include <xdevfeat.h>
#include <mbgmutex.h>
#include <mbgserio.h>
#include <pcpsdefs.h>
#include <mbg_tmo.h>

Go to the source code of this file.

Data Structures

struct  SV_ALM
 An SV number plus the SV's almanac data. More...
 
struct  SV_EPH
 An SV number plus the SV's ephemeris data. More...
 
union  TZCODE_UNION
 A union holding different types of a TZ code. More...
 
struct  MSG_HDR
 The header of a binary message. More...
 
union  MSG_DATA
 A union of all data types used with the binary protocol. More...
 
union  STD_MSG_DATA_BUFF
 A union of all data types used with the binary protocol, or array of bytes. More...
 
struct  MBG_STD_MSG
 The format of a standard binary message. More...
 
struct  XBP_MSG_DATA
 The data portion of an XBP message. More...
 
struct  XBP_MSG_HDR
 A message header for the eXtended Binary Protocol (XBP) More...
 
struct  CRYPT_MSG_PREFIX
 A message prefix used for encrypted messages. More...
 
struct  MBG_MSG_BUFF
 A buffer for a message header plus data part. More...
 
struct  MBG_MSG_RCV_CTL
 A structure used to control the reception of binary messages. More...
 
struct  MBG_MSG_RCV_CTL::rcv_state
 
struct  MBG_MSG_XMT_CTL
 A structure used to control the transmission of binary messages. More...
 
struct  MBG_MSG_CTL_s
 A generic message send and receive control structure. More...
 
union  MBG_MSG_CTL_s::st
 

Macros

#define _USE_MUTEX   1
 
#define _USE_SOCKET_IO   0
 
#define _USE_SERIAL_IO   1
 
#define _USE_SERIAL_IO_FTDI   0
 
#define _USE_USB_IO   0
 
#define _USE_USB_DIRECT_IO   0
 
#define _HAS_SSH_DATA   0
 
#define _USE_ENCRYPTION   0
 
#define _USE_PCPSDEFS   1
 
#define _USE_TIME_MON   0
 
#define _USE_GPSPRIV   _IS_MBG_FIRMWARE
 
#define _USE_GPSSERIO_FNC   ( !_IS_MBG_FIRMWARE )
 
#define _USE_RCV_TSTAMP   ( !_IS_MBG_FIRMWARE )
 
#define FT_STATUS   int
 
#define _ext   extern
 
#define START_OF_HEADER   0x01
 The start of header code sent before a binary message header. More...
 
#define GPS_CTRL_MSK   0xF000
 bit mask of all GPS_CMD_CTRL_CODES More...
 
#define GPS_WILDCARD   ( (GPS_CMD) -1 )
 A wildcard command code. More...
 
#define GPS_ANY_PUSH_CMD   ( (GPS_CMD) -2 )
 A fake command to receive push messages until the timeout has expired. More...
 
#define GPS_CMD_CODES_TABLE
 An initializer for a table of code/name entries of GPS_CMD_CODES. More...
 
#define _mbg_swab_tzcode(_p)   _mbg_swab16( _p )
 
#define ADD_MSG_DATA_SIZE   0
 The maximum number of bytes required for a MSG_DATA buffer. More...
 
#define MAX_MSG_DATA_SIZE   ( sizeof( MSG_DATA ) + ADD_MSG_DATA_SIZE )
 

Typedefs

typedef int SSH_DATA
 
typedef int MBG_TIME_MON_LIMITS
 
typedef int MBG_TIME_MON_INST_SETTINGS
 
typedef int MBG_TIME_MON_INST_SETTINGS_IDX
 
typedef int MBG_TIME_MON_INST_INFO
 
typedef int MBG_TIME_MON_INST_INFO_IDX
 
typedef int MBG_TIME_MON_TARGET_SETTINGS
 
typedef int MBG_TIME_MON_TARGET_SETTINGS_IDX
 
typedef int MBG_TIME_MON_TARGET_STATUS
 
typedef int MBG_TIME_MON_TARGET_STATUS_IDX
 
typedef int MBG_TIME_MON_TARGET_EXT_DATA_SET_IDX
 
typedef uint16_t TZCODE
 Type of variable to hold a TZ code. More...
 
typedef struct MBG_MSG_CTL_s MBG_MSG_CTL
 
typedef int _MBG_API MBG_NACK_HANDLER_FNC(MBG_MSG_CTL *pmctl)
 Type of a callback function to optionally handle NACK messages. More...
 
typedef int _MBG_API MBG_ASYNC_MSG_HANDLER_FNC(MBG_MSG_CTL *pmctl)
 Type of a callback function to handle spurious binary messages. More...
 
typedef int _MBG_API MBG_ASYNC_DATA_HANDLER_FNC(MBG_MSG_CTL *pmctl, char c)
 Type of a callback function to handle spurious asynchronous data bytes. More...
 
typedef int _MBG_API MBG_ASYNC_DATA_RESET_FNC(MBG_MSG_CTL *pmctl)
 Type of a callback function to reset handling of spurious asynchronous data bytes. More...
 

Enumerations

enum  TR_STATUS_CODES {
  TR_COMPLETE = 2, TR_RECEIVING = 1, TR_WAITING = 0, TR_TIMEOUT = -1,
  TR_CSUM_HDR = -2, TR_CSUM_DATA = -3, TR_DECRYPTION = -4, TR_OPEN_ERR = -5,
  TR_IO_ERR = -6, TR_AUTH_ERR = -7, TR_RCVD_NACK = -8, TR_OVERFLOW = -9
}
 Status codes returned by the check_transfer() function. More...
 
enum  GPS_CMD_CTRL_CODES { GPS_REQACK = 0x8000, GPS_ACK = 0x4000, GPS_NACK = 0x2000 }
 Control codes to be or'ed with a particular command/type code. More...
 
enum  GPS_CMD_CODES {
  GPS_AUTO_ON = 0x000, GPS_AUTO_OFF, GPS_SW_REV, GPS_BVAR_STAT,
  GPS_TIME, GPS_POS_XYZ, GPS_POS_LLA, GPS_TZDL,
  GPS_PORT_PARM, GPS_SYNTH, GPS_ANT_INFO, GPS_UCAP,
  GPS_ENABLE_FLAGS, GPS_STAT_INFO, GPS_SWITCH_PARMS, GPS_STRING_PARMS,
  GPS_ANT_CABLE_LENGTH, GPS_SYNC_OUTAGE_DELAY, GPS_PULSE_INFO, GPS_OPT_FEATURES,
  GPS_IRIG_TX_SETTINGS, GPS_RECEIVER_INFO, GPS_STR_TYPE_INFO_IDX, GPS_PORT_INFO_IDX,
  GPS_PORT_SETTINGS_IDX, GPS_POUT_INFO_IDX, GPS_POUT_SETTINGS_IDX, GPS_IRIG_TX_INFO,
  GPS_MULTI_REF_SETTINGS, GPS_MULTI_REF_INFO, GPS_ROM_CSUM, GPS_MULTI_REF_STATUS,
  GPS_RCV_TIMEOUT, GPS_IGNORE_LOCK, GPS_IRIG_RX_SETTINGS, GPS_IRIG_RX_INFO,
  GPS_REF_OFFS, GPS_DEBUG_STATUS, GPS_XMR_SETTINGS_IDX, GPS_XMR_INFO_IDX,
  GPS_XMR_STATUS_IDX, GPS_OPT_SETTINGS, GPS_OPT_INFO, GPS_CLR_UCAP_BUFF,
  GPS_TIME_SCALE, GPS_NAV_ENG_SETTINGS, GPS_RAW_IRIG_DATA, GPS_GPIO_CFG_LIMITS,
  GPS_GPIO_INFO_IDX, GPS_GPIO_SETTINGS_IDX, GPS_XMR_INSTANCES, GPS_CLR_EVT_LOG,
  GPS_NUM_EVT_LOG_ENTRIES, GPS_FIRST_EVT_LOG_ENTRY, GPS_NEXT_EVT_LOG_ENTRY, GPS_LNO_STATUS,
  GPS_IMS_STATE, GPS_IMS_SENSOR_STATE_IDX, GPS_XMR_HOLDOVER_INTV, GPS_HAVEQUICK_RX_SETTINGS,
  GPS_HAVEQUICK_RX_INFO, GPS_HAVEQUICK_TX_SETTINGS, GPS_HAVEQUICK_TX_INFO, GPS_PTP_CFG,
  GPS_PTP_STATE, GPS_PTP_UC_MASTER_CFG_LIMITS, GPS_PTP_UC_MASTER_CFG, GPS_NTP_GLB_CFG,
  GPS_NTP_CLNT_MODE_CFG, GPS_NTP_SRV_MODE_CFG, GPS_NTP_PEER_SETTINGS_IDX, GPS_NTP_SYS_STATE,
  GPS_NTP_PEER_STATE_IDX, GPS_SHS, GPS_SHS_STATUS, GPS_NET_GLB_CFG,
  GPS_NET_DNS_SRVR, GPS_NET_DNS_SRCH_DOM, GPS_NET_STAT_DNS_SRVR, GPS_NET_STAT_DNS_SRCH_DOM,
  GPS_GNSS_SAT_INFO_IDX, GPS_XMR_HOLDOVER_ELAPSED, GPS_GPIO_STATUS_IDX, GPS_XMR_HOLDOVER_STATUS,
  GPS_XBP_LIMITS, GPS_XBP_NODE_LIMITS, GPS_XBP_NODE_INFO_IDX, GPS_FDM_OUTPUT_STATE_IDX,
  GPS_FDM_OUTPUT_SETTINGS_IDX, GPS_FDM_OUTPUT_INFO_IDX, GPS_FDM_LIMITS, GPS_FDM_STATE,
  GPS_FDM_SETTINGS, GPS_FDM_INFO, GPS_XMR_EXT_SRC_INFO_IDX, GPS_FDM_FREQ,
  GPS_XFEATURES, GPS_SAVE_CFG, GPS_XMR_STATS_IDX, GPS_FDM_SET_TD,
  GPS_LNE_LIMITS, GPS_LNE_PORT_INFO_IDX, GPS_LNE_PORT_SETTINGS_IDX, GPS_PWR_CTL,
  GPS_LED_LIMITS, GPS_LED_INFO_IDX, GPS_LED_SETTINGS_IDX, GPS_EXT_SYS_INFO,
  GPS_TLV_INFO, GPS_TLV_ANNOUNCE, GPS_TLV_DATA, GPS_BEGIN_TRANSACTION,
  GPS_END_TRANSACTION, GPS_REBOOT, GPS_XMR_METRICS_IDX, GPS_XMR_QL_INFO_IDX,
  GPS_XMR_QL_SETTINGS_IDX, GPS_CLK_RES_INFO, GPS_NET_INTF_LINK_IDX, GPS_NET_INTF_ADDR_IDX,
  GPS_NET_INTF_ROUTE_IDX, GPS_NET_STAT_GLB_CFG, GPS_NET_STAT_INTF_LINK_IDX, GPS_NET_STAT_INTF_ADDR_IDX,
  GPS_NET_STAT_INTF_ROUTE_IDX, GPS_UCAP_NET_GLB_INFO, GPS_UCAP_NET_RECV_INFO_IDX, GPS_IO_PORT_LIMITS,
  GPS_IO_PORT_SETTINGS_IDX, GPS_IO_PORT_INFO_IDX, GPS_IO_PORT_TYPE_INFO_IDX, GPS_IO_PORT_STATUS_IDX,
  GPS_MONITORING_LIMITS, GPS_SNMP_GLB, GPS_SNMP_V12_IDX, GPS_SNMP_V12_TRAP_IDX,
  GPS_SNMP_V3_IDX, GPS_SNMP_V3_TRAP_IDX, GPS_GNSS_SV_STATUS_IDX, GPS_PTP_V2_DEFAULT_DS,
  GPS_PTP_V2_CURRENT_DS, GPS_PTP_V2_PARENT_DS, GPS_PTP_V2_TIME_PROP_DS, GPS_PTP_V2_PORT_DS_IDX,
  GPS_TAINTED_CFG, GPS_EVENT_IDX, GPS_EVENT_STAT_IDX, GPS_NTP_REFCLK_CFG,
  GPS_NTP_MISC_LIMITS, GPS_NTP_MISC_ORPHAN_MODE, GPS_NTP_SYMM_KEY_LIMITS, GPS_NTP_SYMM_KEY_CFG,
  GPS_NTP_TRUSTED_KEY_CFG, GPS_PTP_V1_DEFAULT_DS, GPS_PTP_V1_CURRENT_DS, GPS_PTP_V1_PARENT_DS,
  GPS_PTP_V1_TIME_PROP_DS, GPS_PTP_V1_PORT_DS_IDX, GPS_NTP_REFCLK_STATE_IDX, GPS_EVENT_VALUE_IDX,
  GPS_REGISTER_PUSH_MSGS, GPS_UNREGISTER_PUSH_MSGS, GPS_AUTH_USER_INFO, GPS_AUTH_USER_STATUS,
  GPS_USER_MNGMNT_INFO, GPS_USER_INFO_IDX, GPS_USER_LEVEL_INFO_IDX, GPS_USER_STATUS_IDX,
  GPS_PTP_SMPTE_TLV, GPS_SVC_MGMT_INFO, GPS_SVC_INFO_IDX, GPS_SVC_STATUS_IDX,
  GPS_SVC_CTL_IDX, GPS_SYSLOG_GLB_INFO, GPS_SYSLOG_INFO_IDX, GPS_FW_GLB_INFO,
  GPS_FW_INFO_IDX, GPS_FW_UFU_INFO_IDX, GPS_FW_ACTIVATE, GPS_FW_DELETE,
  GPS_FW_UFU_FLASH, GPS_DATABASE_GLB_INFO, GPS_DATABASE_INFO_IDX, GPS_DATABASE_CMD,
  GPS_CFGH = 0x100, GPS_ALM, GPS_EPH, GPS_UTC,
  GPS_IONO, GPS_ASCII_MSG, GPS_GLNS_ALM = 0x200, GPS_GNSS_SAT_INFO,
  GPS_GNSS_MODE, GPS_IP4_SETTINGS = 0x800, GPS_LAN_IF_INFO, GPS_IP4_STATE,
  GPS_SCU_STAT = 0x820, GPS_CRYPTED_PACKET = 0x880, GPS_CRYPTED_RAW_PACKET, GPS_XBP_PACKET,
  GPS_SECU_INFO = 0x900, GPS_SECU_SETTINGS, GPS_SECU_PUBLIC_KEY, PZF_PCPS_TIME = 0xA00,
  PZF_TR_DISTANCE, PZF_TZCODE, PZF_CORR_INFO, GPS_TIME_MON_INST_INFO,
  GPS_TIME_MON_TARGET_SETTINGS, GPS_TIME_MON_TARGET_STATUS_IDX, GPS_TIME_MON_TARGET_EXT_DATA_SET_IDX
}
 Command codes for the binary protocol. More...
 
enum  MBG_MSG_RCV_CTL_BITS {
  MBG_MSG_RCV_CTL_BIT_RCVD_HDR, MBG_MSG_RCV_CTL_BIT_MSG_TOO_LONG, MBG_MSG_RCV_CTL_BIT_OVERFLOW, MBG_MSG_RCV_CTL_BIT_DECRYPT_ERR,
  MBG_MSG_RCV_CTL_BIT_DECRYPTED, N_MBG_MSG_RCV_CTL_BIT
}
 Receive control bits used to define MBG_MSG_RCV_CTL_MASKS. More...
 
enum  MBG_MSG_RCV_CTL_MASKS {
  MBG_MSG_RCV_CTL_RCVD_HDR = ( 1UL << MBG_MSG_RCV_CTL_BIT_RCVD_HDR ), MBG_MSG_RCV_CTL_MSG_TOO_LONG = ( 1UL << MBG_MSG_RCV_CTL_BIT_MSG_TOO_LONG ), MBG_MSG_RCV_CTL_OVERFLOW = ( 1UL << MBG_MSG_RCV_CTL_BIT_OVERFLOW ), MBG_MSG_RCV_CTL_DECRYPT_ERR = ( 1UL << MBG_MSG_RCV_CTL_BIT_DECRYPT_ERR ),
  MBG_MSG_RCV_CTL_DECRYPTED = ( 1UL << MBG_MSG_RCV_CTL_BIT_DECRYPTED )
}
 Receive control bit masks. More...
 
enum  MBG_XFER_MODES { MBG_XFER_MODE_NORMAL, MBG_XFER_MODE_ENCRYPTED, N_MBG_XFER_MODE }
 Binary message transfer modes. More...
 
enum  MBG_CONN_TYPES {
  MBG_CONN_TYPE_SERIAL, MBG_CONN_TYPE_SOCKET, MBG_CONN_TYPE_USB, MBG_CONN_TYPE_SERIAL_FTDI,
  MBG_CONN_TYPE_USB_DIRECT_IO, N_MBG_CONN_TYPE
}
 Binary message connection types. More...
 

Functions

int mbg_ftdi_ft_status_to_mbg (int status)
 Translate a FTDI API status code to one of the MBG_ERROR_CODES. More...
 
CSUM msg_csum_update (CSUM csum, const uint8_t *p, int n)
 Compute a simple binary checksum. More...
 
CSUM msg_csum (const uint8_t *p, int n)
 Compute a checksum for a binary message. More...
 
CSUM msg_hdr_csum (const MSG_HDR *pmh)
 Compute the checksum of a binary message header. More...
 
int chk_hdr_csum (const MSG_HDR *pmh)
 Check if the header checksum of a binary message is valid. More...
 
int chk_data_csum (const MBG_MSG_BUFF *pmb)
 Check if the data checksum of a binary message is valid. More...
 
int chk_hdr_rcvd (const MBG_MSG_RCV_CTL *prctl)
 Checks if a binary message header has been completely received. More...
 
int encrypt_message (MBG_MSG_CTL *pmctl, CRYPT_MSG_PREFIX *pcmp, MBG_MSG_BUFF *pmb)
 Encrypt a binary message. More...
 
int decrypt_message (MBG_MSG_CTL *pmctl)
 Decrypt an encrypted binary message. More...
 
void set_encryption_mode (MBG_MSG_CTL *pmctl, int mode, const char *key)
 Set communication channel to specified encryption mode. More...
 
int xmt_tbuff (MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr)
 Complete message header and transmit message. More...
 
int xmt_cmd (MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, GPS_CMD cmd)
 Send a binary command message without parameters. More...
 
int xmt_cmd_us (MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, GPS_CMD cmd, uint16_t us)
 Send a binary command message with ushort (16 bit) parameter. More...
 
int xmt_cmd_u32 (MBG_MSG_CTL *pmctl, const XBP_ADDR *p_addr, GPS_CMD cmd, uint32_t u32)
 Send a binary command message with 32 bit parameter. More...
 
void init_transfer (MBG_MSG_RCV_CTL *prctl)
 Init reception of a binary message. More...
 
int check_transfer (MBG_MSG_RCV_CTL *prctl, uint8_t c)
 Check an incoming data stream for a binary message. More...
 

Macro Definition Documentation

◆ _ext

#define _ext   extern

Definition at line 695 of file gpsserio.h.

◆ _HAS_SSH_DATA

#define _HAS_SSH_DATA   0

Definition at line 546 of file gpsserio.h.

◆ _mbg_swab_tzcode

#define _mbg_swab_tzcode (   _p)    _mbg_swab16( _p )

Definition at line 1304 of file gpsserio.h.

Referenced by mbgextio_get_tzcode(), and mbgextio_set_tzcode().

◆ _USE_ENCRYPTION

#define _USE_ENCRYPTION   0

Definition at line 588 of file gpsserio.h.

◆ _USE_GPSPRIV

#define _USE_GPSPRIV   _IS_MBG_FIRMWARE

Definition at line 620 of file gpsserio.h.

◆ _USE_GPSSERIO_FNC

#define _USE_GPSSERIO_FNC   ( !_IS_MBG_FIRMWARE )

Definition at line 626 of file gpsserio.h.

◆ _USE_MUTEX

#define _USE_MUTEX   1

Definition at line 491 of file gpsserio.h.

◆ _USE_PCPSDEFS

#define _USE_PCPSDEFS   1

Definition at line 608 of file gpsserio.h.

◆ _USE_RCV_TSTAMP

#define _USE_RCV_TSTAMP   ( !_IS_MBG_FIRMWARE )

Definition at line 630 of file gpsserio.h.

◆ _USE_SERIAL_IO

#define _USE_SERIAL_IO   1

Definition at line 510 of file gpsserio.h.

◆ _USE_SERIAL_IO_FTDI

#define _USE_SERIAL_IO_FTDI   0

Definition at line 516 of file gpsserio.h.

◆ _USE_SOCKET_IO

#define _USE_SOCKET_IO   0

Definition at line 502 of file gpsserio.h.

◆ _USE_TIME_MON

#define _USE_TIME_MON   0

Definition at line 614 of file gpsserio.h.

◆ _USE_USB_DIRECT_IO

#define _USE_USB_DIRECT_IO   0

Definition at line 537 of file gpsserio.h.

◆ _USE_USB_IO

#define _USE_USB_IO   0

Definition at line 522 of file gpsserio.h.

◆ ADD_MSG_DATA_SIZE

#define ADD_MSG_DATA_SIZE   0

The maximum number of bytes required for a MSG_DATA buffer.

Definition at line 1605 of file gpsserio.h.

◆ FT_STATUS

#define FT_STATUS   int

◆ GPS_ANY_PUSH_CMD

#define GPS_ANY_PUSH_CMD   ( (GPS_CMD) -2 )

A fake command to receive push messages until the timeout has expired.

The difference to GPS_WILDCARD is, that the receive function won't return, but continue receiving packets until the end of the receive timeout

Definition at line 762 of file gpsserio.h.

◆ GPS_CMD_CODES_TABLE

#define GPS_CMD_CODES_TABLE

An initializer for a table of code/name entries of GPS_CMD_CODES.

This can e.g. be assigned to an array of MBG_CODE_NAME_TABLE_ENTRY elements and may be helpful when debugging.

See also
GPS_CMD_CODES

Definition at line 1044 of file gpsserio.h.

◆ GPS_CTRL_MSK

#define GPS_CTRL_MSK   0xF000

bit mask of all GPS_CMD_CTRL_CODES

Definition at line 745 of file gpsserio.h.

Referenced by mbgextio_check_ack(), and mbgextio_rcv_msg_unlocked().

◆ GPS_WILDCARD

#define GPS_WILDCARD   ( (GPS_CMD) -1 )

A wildcard command code.

This code can be passed to a receive routine to wait for any type of binary packet rather than for a specific packet.

Definition at line 754 of file gpsserio.h.

Referenced by mbgextio_rcv_msg_unlocked().

◆ MAX_MSG_DATA_SIZE

#define MAX_MSG_DATA_SIZE   ( sizeof( MSG_DATA ) + ADD_MSG_DATA_SIZE )

Definition at line 1609 of file gpsserio.h.

◆ START_OF_HEADER

#define START_OF_HEADER   0x01

The start of header code sent before a binary message header.

ASCII SOH

Definition at line 732 of file gpsserio.h.

Typedef Documentation

◆ MBG_ASYNC_DATA_HANDLER_FNC

typedef int _MBG_API MBG_ASYNC_DATA_HANDLER_FNC(MBG_MSG_CTL *pmctl, char c)

Type of a callback function to handle spurious asynchronous data bytes.

After a function like this has been registered as callback, it is called whenever a spurious byte has been received that can't be assigned to a binary message.

See also
mbgextio_register_async_data_callback
MBG_ASYNC_MSG_HANDLER_FNC
MBG_ASYNC_DATA_RESET_FNC

Definition at line 1948 of file gpsserio.h.

◆ MBG_ASYNC_DATA_RESET_FNC

typedef int _MBG_API MBG_ASYNC_DATA_RESET_FNC(MBG_MSG_CTL *pmctl)

Type of a callback function to reset handling of spurious asynchronous data bytes.

After a function like this has been registered as callback, it is called whenever a complete binary message has been received. It can be used to discard any partial async data that possibly has been received before, and re-initialize async data reception.

See also
mbgextio_register_async_data_reset_callback
MBG_ASYNC_MSG_HANDLER_FNC
MBG_ASYNC_DATA_HANDLER_FNC

Definition at line 1964 of file gpsserio.h.

◆ MBG_ASYNC_MSG_HANDLER_FNC

typedef int _MBG_API MBG_ASYNC_MSG_HANDLER_FNC(MBG_MSG_CTL *pmctl)

Type of a callback function to handle spurious binary messages.

After a function like this has been registered as callback, it is called whenever a complete binary message has been received which is not the one an API function is waiting for. The received message is available in the receive buffer that is accessible via pmctl.

See also
mbgextio_register_async_msg_callback
MBG_ASYNC_DATA_HANDLER_FNC
MBG_ASYNC_DATA_RESET_FNC

Definition at line 1934 of file gpsserio.h.

◆ MBG_MSG_CTL

typedef struct MBG_MSG_CTL_s MBG_MSG_CTL

Definition at line 1815 of file gpsserio.h.

◆ MBG_NACK_HANDLER_FNC

typedef int _MBG_API MBG_NACK_HANDLER_FNC(MBG_MSG_CTL *pmctl)

Type of a callback function to optionally handle NACK messages.

If a device returns a GPS_NACK after a command has been sent with GPS_REQACK then the device can optionally include one of the MBG_RETURN_CODES in the NACK message.

By default, the API functions return the included error code, if a code has been submitted, or MBG_ERR_RCVD_NACK if no specific error code is available.

However, some specific applications may need to determine by themselves how to handle a NACK message, so a callback function can be registered, if required.

See also
mbgextio_register_nack_callback

Definition at line 1918 of file gpsserio.h.

◆ MBG_TIME_MON_INST_INFO

Definition at line 674 of file gpsserio.h.

◆ MBG_TIME_MON_INST_INFO_IDX

Definition at line 675 of file gpsserio.h.

◆ MBG_TIME_MON_INST_SETTINGS

Definition at line 672 of file gpsserio.h.

◆ MBG_TIME_MON_INST_SETTINGS_IDX

Definition at line 673 of file gpsserio.h.

◆ MBG_TIME_MON_LIMITS

typedef int MBG_TIME_MON_LIMITS

Definition at line 671 of file gpsserio.h.

◆ MBG_TIME_MON_TARGET_EXT_DATA_SET_IDX

Definition at line 680 of file gpsserio.h.

◆ MBG_TIME_MON_TARGET_SETTINGS

Definition at line 676 of file gpsserio.h.

◆ MBG_TIME_MON_TARGET_SETTINGS_IDX

Definition at line 677 of file gpsserio.h.

◆ MBG_TIME_MON_TARGET_STATUS

Definition at line 678 of file gpsserio.h.

◆ MBG_TIME_MON_TARGET_STATUS_IDX

Definition at line 679 of file gpsserio.h.

◆ SSH_DATA

typedef int SSH_DATA

Definition at line 594 of file gpsserio.h.

◆ TZCODE

typedef uint16_t TZCODE

Type of variable to hold a TZ code.

This is used with the binary protocol but differs from PCPS_TZCODE which is used with the PCI interface.

See also
PCPS_TZCODE
TZCODE_UNION

Definition at line 1302 of file gpsserio.h.

Enumeration Type Documentation

◆ GPS_CMD_CODES

Command codes for the binary protocol.

These codes specify commands and associated data types used by Meinberg's binary protocol to exchange data with a device via serial port, direct USB, or socket I/O.

Some commands and associated data structures can be read (r) from a device, others can be written (w) to the device, and some can also be sent automatically (a) by a device after a GPS_AUTO_ON command has been sent to the device. The individual command codes are marked with (rwa) accordingly, where '-' is used to indicate that a particular mode is not supported.

Note
Not all command code are supported by all devices. See the hints for a particular command.
If GPS_ALM, GPS_EPH or a code named ..._IDX is sent to retrieve some data from a device then an uint16_t parameter must be also supplied in order to specify the index number of the data set to be returned. The valid index range depends on the command code. For GPS_ALM and GPS_EPH the index is the SV number which may be 0 or MIN_SVNO_GPS to MAX_SVNO_GPS. If the number is 0 then all N_SVNO_GPS almanacs or ephemeris data structures are returned.
See also
GPS_CMD_CODES_TABLE
Enumerator
GPS_AUTO_ON 

(-w-) no data, enable auto-msgs from device

GPS_AUTO_OFF 

(-w-) no data, disable auto-msgs from device

GPS_SW_REV 

(r–) deprecated, SW_REV, software revision, use only if GPS_RECEIVER_INFO not supp.

GPS_BVAR_STAT 

(r–) BVAR_STAT, status of buffered variables, only if GPS_MODEL_HAS_BVAR_STAT

GPS_TIME 

(-wa) TTM, current time or capture, or init board time

GPS_POS_XYZ 

(rw-) XYZ, current position in ECEF coordinates, only if GPS_MODEL_HAS_POS_XYZ

GPS_POS_LLA 

(rw-) LLA, current position in geographic coordinates, only if GPS_MODEL_HAS_POS_LLA

GPS_TZDL 

(rw-) TZDL, time zone / daylight saving, only if GPS_MODEL_HAS_TZDL

GPS_PORT_PARM 

(rw-) deprecated, PORT_PARM, use PORT_SETTINGS etc. if GPS_RECEIVER_INFO supported

GPS_SYNTH 

(rw-) SYNTH, synthesizer settings, only if GPS_HAS_SYNTH

GPS_ANT_INFO 

(r-a) ANT_INFO, time diff after antenna disconnect, only if GPS_MODEL_HAS_ANT_INFO

GPS_UCAP 

(r-a) TTM, user capture events, only if RECEIVER_INFO::n_ucaps > 0

GPS_ENABLE_FLAGS 

(rw-) ENABLE_FLAGS, when to enable serial, pulses, and synth, only if GPS_MODEL_HAS_ENABLE_FLAGS

GPS_STAT_INFO 

(r–) STAT_INFO, satellite info, mode of operation, and DAC info, only if GPS_MODEL_HAS_STAT_INFO

GPS_SWITCH_PARMS 

(rw-) deprecated, use GPS_POUT_INFO_IDX/GPS_POUT_SETTINGS_IDX

GPS_STRING_PARMS 

(rw-) deprecated, use GPS_PORT_INFO_IDX/GPS_PORT_SETTINGS_IDX

GPS_ANT_CABLE_LENGTH 

(rw-) ANT_CABLE_LEN, length of antenna cable, only if GPS_MODEL_HAS_ANT_CABLE_LEN

GPS_SYNC_OUTAGE_DELAY 

(rw-) (customized firmware only)

GPS_PULSE_INFO 

(rw-) (customized firmware only)

GPS_OPT_FEATURES 

(r–) deprecated, use GPS_RECEIVER_INFO

GPS_IRIG_TX_SETTINGS 

(rw-) IRIG_SETTINGS, only if GPS_HAS_IRIG_TX

GPS_RECEIVER_INFO 

(r–) RECEIVER_INFO, model specific info, not supported by very old devices

GPS_STR_TYPE_INFO_IDX 

(r–) STR_TYPE_INFO_IDX, names and capabilities of supp. string types, only if RECEIVER_INFO::n_str_type > 0

GPS_PORT_INFO_IDX 

(r–) PORT_INFO_IDX, serial port settings and capabilities, only if RECEIVER_INFO::n_com_ports > 0

GPS_PORT_SETTINGS_IDX 

(rw-) PORT_SETTINGS_IDX, settings for specified serial port, only if RECEIVER_INFO::n_com_ports > 0

GPS_POUT_INFO_IDX 

(r–) POUT_INFO_IDX, programmable pulse output settings and capabilities, only if RECEIVER_INFO::n_prg_out > 0

GPS_POUT_SETTINGS_IDX 

(rw-) POUT_SETTINGS_IDX, programmable pulse output settings, only if RECEIVER_INFO::n_prg_out > 0

GPS_IRIG_TX_INFO 

(r–) IRIG_INFO, only if GPS_HAS_IRIG_TX

GPS_MULTI_REF_SETTINGS 

(rw-) MULTI_REF_SETTINGS, only if GPS_HAS_MULTI_REF

GPS_MULTI_REF_INFO 

(r–) MULTI_REF_INFO, only if GPS_HAS_MULTI_REF

GPS_ROM_CSUM 

(r–) ROM_CSUM, not supported by all devices

GPS_MULTI_REF_STATUS 

(r–) MULTI_REF_STATUS, only if GPS_HAS_MULTI_REF

GPS_RCV_TIMEOUT 

(rw-) RCV_TIMEOUT, [min], only if GPS_HAS_RCV_TIMEOUT

GPS_IGNORE_LOCK 

(rw-) IGNORE_LOCK, if != 0 always claim to be sync, only if GPS_HAS_IGNORE_LOCK

GPS_IRIG_RX_SETTINGS 

(rw-) IRIG_SETTINGS, only if GPS_HAS_IRIG_RX

GPS_IRIG_RX_INFO 

(r–) IRIG_INFO, only if GPS_HAS_IRIG_RX

GPS_REF_OFFS 

(rw-) MBG_REF_OFFS, only if GPS_HAS_REF_OFFS

GPS_DEBUG_STATUS 

(r–) MBG_DEBUG_STATUS, only if GPS_HAS_DEBUG_STATUS

GPS_XMR_SETTINGS_IDX 

(rw-) XMULTI_REF_SETTINGS_IDX, idx 0..XMULTI_REF_INSTANCES::n_xmr_settings-1, only if GPS_HAS_XMULTI_REF

GPS_XMR_INFO_IDX 

(r–) XMULTI_REF_INFO_IDX, idx 0..XMULTI_REF_INSTANCES::n_xmr_settings-1, only if GPS_HAS_XMULTI_REF

GPS_XMR_STATUS_IDX 

(r–) XMULTI_REF_STATUS_IDX, idx 0..XMULTI_REF_INSTANCES::n_xmr_settings-1, only if GPS_HAS_XMULTI_REF

GPS_OPT_SETTINGS 

(rw-) MBG_OPT_SETTINGS, only if GPS_HAS_OPT_SETTINGS

GPS_OPT_INFO 

(r–) MBG_OPT_INFO, only if GPS_HAS_OPT_SETTINGS

GPS_CLR_UCAP_BUFF 

(-w-) no data, only if RECEIVER_INFO::n_ucaps > 0

GPS_TIME_SCALE 

(rw-) MBG_TIME_SCALE_SETTINGS/MBG_TIME_SCALE_INFO, only if GPS_HAS_TIME_SCALE

GPS_NAV_ENG_SETTINGS 

(rw-) NAV_ENGINE_SETTINGS, only if GPS_HAS_NAV_ENGINE_SETTINGS

GPS_RAW_IRIG_DATA 

(r–) MBG_RAW_IRIG_DATA, only if GPS_HAS_RAW_IRIG_DATA

GPS_GPIO_CFG_LIMITS 

(r–) MBG_GPIO_CFG_LIMITS, only if GPS_HAS_GPIO

GPS_GPIO_INFO_IDX 

(r–) MBG_GPIO_INFO_IDX, settings and capabilities, only if GPS_HAS_GPIO

GPS_GPIO_SETTINGS_IDX 

(rw-) MBG_GPIO_SETTINGS_IDX, settings of a specific port, only if GPS_HAS_GPIO

GPS_XMR_INSTANCES 

(r–) XMULTI_REF_INSTANCES, only if GPS_HAS_XMRS_MULT_INSTC

GPS_CLR_EVT_LOG 

(-w-) no data, clear event log command, only if GPS_HAS_EVT_LOG

GPS_NUM_EVT_LOG_ENTRIES 

(r–) MBG_NUM_EVT_LOG_ENTRIES, num. of log entries, only if GPS_HAS_EVT_LOG

GPS_FIRST_EVT_LOG_ENTRY 

(r–) first/oldest MBG_EVT_LOG_ENTRY, only if GPS_HAS_EVT_LOG

GPS_NEXT_EVT_LOG_ENTRY 

(r–) next MBG_EVT_LOG_ENTRY, only if GPS_HAS_EVT_LOG

GPS_LNO_STATUS 

(r–) LNO_STATE, only if ::GPS_MODEL_IS_LNO

GPS_IMS_STATE 

(r–) MBG_IMS_STATE, only if GPS_HAS_IMS

GPS_IMS_SENSOR_STATE_IDX 

(r–) MBG_IMS_SENSOR_STATE_IDX, only if GPS_HAS_IMS

GPS_XMR_HOLDOVER_INTV 

(rw-) XMR_HOLDOVER_INTV, only if ::GPS_MODEL_HAS_XMR_HOLDOVER_INTV, see also GPS_XMR_HOLDOVER_STATUS

GPS_HAVEQUICK_RX_SETTINGS 

(rw-) HAVEQUICK_SETTINGS for input, only if GPS_HAS_HAVEQUICK

GPS_HAVEQUICK_RX_INFO 

(r–) HAVEQUICK_INFO for input, only if GPS_HAS_HAVEQUICK

GPS_HAVEQUICK_TX_SETTINGS 

(rw-) HAVEQUICK_SETTINGS for output, only if GPS_HAS_HAVEQUICK

GPS_HAVEQUICK_TX_INFO 

(r–) HAVEQUICK_INFO for output, only if GPS_HAS_HAVEQUICK

GPS_PTP_CFG 

(rw-) PTP_CFG_INFO/PTP_CFG_SETTINGS, only if GPS_HAS_PTP

GPS_PTP_STATE 

(r–) PTP_STATE, current PTP status, only if GPS_HAS_PTP

GPS_PTP_UC_MASTER_CFG_LIMITS 

(r–) PTP_UC_MASTER_CFG_LIMITS, only if PTP_CFG_CAN_BE_UNICAST_SLAVE

GPS_PTP_UC_MASTER_CFG 

(rw-) PTP_UC_MASTER_INFO_IDX/PTP_UC_MASTER_SETTINGS_IDX, only if PTP_CFG_CAN_BE_UNICAST_SLAVE

GPS_NTP_GLB_CFG 

(rw-) NTP_GLB_INFO/NTP_GLB_SETTINGS, only if GPS_HAS_NTP

GPS_NTP_CLNT_MODE_CFG 

(rw-) NTP_CLNT_MODE_INFO/NTP_CLNT_MODE_SETTINGS, only if NTP_MSK_ROLE_CLIENT

GPS_NTP_SRV_MODE_CFG 

(rw-) NTP_SRV_MODE_INFO/NTP_SRV_MODE_SETTINGS, only if NTP_MSK_ROLE_SERVER

GPS_NTP_PEER_SETTINGS_IDX 

(rw-) NTP_PEER_SETTINGS_IDX, only if ??? //### TODO

GPS_NTP_SYS_STATE 

(r–) NTP_SYS_STATE

GPS_NTP_PEER_STATE_IDX 

(r–) NTP_PEER_STATE_IDX, with index 0 ... NTP_CLNT_MODE_SETTINGS::num_peers - 1

GPS_SHS 

(rw-) SHS_INFO/SHS_SETTINGS, only if GPS_HAS_SHS

GPS_SHS_STATUS 

(r–) SHS_STATUS, only if GPS_HAS_SHS

GPS_NET_GLB_CFG 

(rw-) MBG_NET_GLB_CFG_INFO/MBG_NET_GLB_CFG_SETTINGS, only if GPS_HAS_NET_CFG

GPS_NET_DNS_SRVR 

(rw-) MBG_IP_ADDR_IDX, DNS cfg., only if MBG_NET_GLB_CFG_INFO::n_supp_dns_srvr > 0

GPS_NET_DNS_SRCH_DOM 

(rw-) MBG_NET_NAME_IDX, DNS cfg., only if MBG_NET_GLB_CFG_INFO::n_supp_dns_srch_dom > 0

GPS_NET_STAT_DNS_SRVR 

(r–) MBG_IP_ADDR_IDX, DNS status, only if MBG_NET_GLB_CFG_INFO::n_supp_dns_srvr > 0

GPS_NET_STAT_DNS_SRCH_DOM 

(r–) MBG_NET_NAME_IDX, DNS status, only if MBG_NET_GLB_CFG_INFO::n_supp_dns_srch_dom > 0

GPS_GNSS_SAT_INFO_IDX 

(r–) GNSS_SAT_INFO_IDX, only if MBG_GNSS_FLAG_MSK_SAT_INFO_IDX_SUPP_SER, deprecates GPS_GNSS_SAT_INFO

GPS_XMR_HOLDOVER_ELAPSED 

(r–) XMR_HOLDOVER_INTV, elapsed time in holdover mode, only if ::GPS_MODEL_HAS_XMR_HOLDOVER_INTV, deprecated by GPS_XMR_HOLDOVER_STATUS

GPS_GPIO_STATUS_IDX 

(r–) MBG_GPIO_STATUS_IDX, only if MBG_GPIO_CFG_LIMIT_FLAG_MASK_STATUS_SUPP

GPS_XMR_HOLDOVER_STATUS 

(r–) XMR_HOLDOVER_STATUS, only if XMRIF_MSK_HOLDOVER_STATUS_SUPP, deprecates GPS_XMR_HOLDOVER_ELAPSED and partially GPS_XMR_HOLDOVER_INTV

GPS_XBP_LIMITS 

(r–) XBP_LIMITS, only if GPS_HAS_XBP

GPS_XBP_NODE_LIMITS 

(r–) XBP_NODE_LIMITS, only if XBP_FEAT_MASK_NODES is set in XBP_LIMITS::features

GPS_XBP_NODE_INFO_IDX 

(r–) XBP_NODE_INFO_IDX, 0..XBP_NODE_LIMITS::node_count-1 instances can be retrieved

GPS_FDM_OUTPUT_STATE_IDX 

(r–) MBG_IMS_FDM_OUTPUT_STATE_IDX, only if MBG_IMS_STATE_FLAG_MSK_HAS_FDM is set in MBG_IMS_STATE::flags

GPS_FDM_OUTPUT_SETTINGS_IDX 

(rw-) MBG_IMS_FDM_OUTPUT_SETTINGS_IDX, only if MBG_IMS_STATE_FLAG_MSK_HAS_FDM is set in MBG_IMS_STATE::flags

GPS_FDM_OUTPUT_INFO_IDX 

(r–) MBG_IMS_FDM_OUTPUT_INFO, only if MBG_IMS_STATE_FLAG_MSK_HAS_FDM is set in MBG_IMS_STATE::flags

GPS_FDM_LIMITS 

(r–) MBG_IMS_FDM_LIMITS, only if MBG_IMS_STATE_FLAG_MSK_HAS_FDM is set in MBG_IMS_STATE::flags

GPS_FDM_STATE 

(r–) MBG_IMS_FDM_STATE, only if MBG_IMS_STATE_FLAG_MSK_HAS_FDM is set in MBG_IMS_STATE::flags

GPS_FDM_SETTINGS 

(rw-) MBG_IMS_FDM_SETTINGS, only if MBG_IMS_STATE_FLAG_MSK_HAS_FDM is set in MBG_IMS_STATE::flags

GPS_FDM_INFO 

(r–) MBG_IMS_FDM_INFO, only if MBG_IMS_STATE_FLAG_MSK_HAS_FDM is set in MBG_IMS_STATE::flags

GPS_XMR_EXT_SRC_INFO_IDX 

(r–) XMR_EXT_SRC_INFO_IDX, only if XMRIF_MSK_EXT_SRC_INFO_SUPP

GPS_FDM_FREQ 

(r–) MBG_GPIO_FREQ, only if MBG_IMS_STATE_FLAG_MSK_HAS_FDM is set in MBG_IMS_STATE::flags

GPS_XFEATURES 

(r–) MBG_XFEATURE_BUFFER, only if GPS_HAS_XFEATURE

GPS_SAVE_CFG 

(-w-) no data, save current config as default, only if MBG_XFEATURE_SAVE_CFG

GPS_XMR_STATS_IDX 

(r–) XMR_STATS_IDX, only if XMR_EXT_SRC_FEAT_FLAG_MSK_STATS

GPS_FDM_SET_TD 

(-w-) NANO_TIME_64, set time deviation, only if MBG_IMS_FDM_FLAG_MASK_CAN_SET_TDEV

GPS_LNE_LIMITS 

(r–) MBG_LNE_LIMITS, LNE API capabilities, only if MBG_XFEATURE_LNE_API

GPS_LNE_PORT_INFO_IDX 

(r–) MBG_LNE_PORT_INFO_IDX, settings and capabilities of an LED, only if MBG_XFEATURE_LNE_API

GPS_LNE_PORT_SETTINGS_IDX 

(rw-) MBG_LNE_PORT_SETTINGS_IDX, settings of a specific LED, only if MBG_XFEATURE_LNE_API

GPS_PWR_CTL 

(rw-) MBG_PWR_CTL, set or retrieve device power state, only if MBG_XFEATURE_PWR_CTL_API

GPS_LED_LIMITS 

(r–) MBG_LED_LIMITS, LED API capabilities, only if MBG_XFEATURE_LED_API

GPS_LED_INFO_IDX 

(r–) MBG_LED_INFO_IDX, settings and capabilities of an LED, only if MBG_XFEATURE_LED_API

GPS_LED_SETTINGS_IDX 

(rw-) MBG_LED_SETTINGS_IDX, settings of a specific LED, only if MBG_XFEATURE_LED_API

GPS_EXT_SYS_INFO 

(r–) MBG_EXT_SYS_INFO, extended revision information, only if MBG_XFEATURE_EXT_SYS_INFO

GPS_TLV_INFO 

(r–) MBG_TLV_INFO, query information on which TLV stuff is supported, only if MBG_XFEATURE_TLV_API

GPS_TLV_ANNOUNCE 

(-w-) MBG_TLV_ANNOUNCE, send and announcement for a subsequent TLV, only if MBG_XFEATURE_TLV_API

GPS_TLV_DATA 

(rw-) a binary data bufer to be sent/received, according to the previous announce msg, only if MBG_XFEATURE_TLV_API

GPS_BEGIN_TRANSACTION 

(-w-) no data, begin transaction and apply changes after GPS_END_TRANSACTION, only supp. if MBG_XFEATURE_TRANSACTIONS

GPS_END_TRANSACTION 

(-w-) no data, end transaction and apply changes, only supp. if MBG_XFEATURE_TRANSACTIONS

GPS_REBOOT 

(-w-) no data, let the device reboot itself, only supp. if MBG_XFEATURE_REBOOT

GPS_XMR_METRICS_IDX 

(r–) GPS_XMR_METRICS_IDX, only if XMR_EXT_SRC_FEAT_FLAG_MSK_METRICS

GPS_XMR_QL_INFO_IDX 

(r–) XMR_QL_INFO, only if XMR_EXT_SRC_FEAT_FLAG_MSK_METRICS

GPS_XMR_QL_SETTINGS_IDX 

(-w-) XMR_QL_SETTINGS, only if XMR_EXT_SRC_FEAT_FLAG_MSK_METRICS

GPS_CLK_RES_INFO 

(r–) MBG_CLK_RES_INFO, only if MBG_XFEATURE_CLK_RES_INFO

GPS_NET_INTF_LINK_IDX 

(rw-) MBG_NET_INTF_LINK_INFO_IDX/MBG_NET_INTF_LINK_SETTINGS_IDX, only if MBG_NET_GLB_SUPP_STAGE_2_MASK is set in MBG_NET_GLB_CFG_INFO::feat_flags

GPS_NET_INTF_ADDR_IDX 

(rw-) MBG_NET_INTF_ADDR_INFO_IDX/MBG_NET_INTF_ADDR_SETTINGS_IDX, only if MBG_NET_GLB_SUPP_STAGE_2_MASK is set in MBG_NET_GLB_CFG_INFO::feat_flags

GPS_NET_INTF_ROUTE_IDX 

(rw-) MBG_NET_INTF_ROUTE_INFO_IDX/MBG_NET_INTF_ROUTE_SETTINGS_IDX, only if MBG_NET_GLB_SUPP_STAGE_2_MASK is set in MBG_NET_GLB_CFG_INFO::feat_flags

GPS_NET_STAT_GLB_CFG 

(r–) MBG_NET_GLB_CFG_INFO, network status, only if MBG_NET_GLB_SUPP_STAGE_2_MASK is set in MBG_NET_GLB_CFG_INFO::feat_flags

GPS_NET_STAT_INTF_LINK_IDX 

(r–) MBG_NET_INTF_LINK_INFO_IDX, link status, only if MBG_NET_GLB_SUPP_STAGE_2_MASK is set in MBG_NET_GLB_CFG_INFO::feat_flags

GPS_NET_STAT_INTF_ADDR_IDX 

(r–) MBG_NET_INTF_ADDR_INFO_IDX, addr status, only if MBG_NET_GLB_SUPP_STAGE_2_MASK is set in MBG_NET_GLB_CFG_INFO::feat_flags

GPS_NET_STAT_INTF_ROUTE_IDX 

(r–) MBG_NET_INTF_ROUTE_INFO_IDX, route status, only if MBG_NET_GLB_SUPP_STAGE_2_MASK is set in MBG_NET_GLB_CFG_INFO::feat_flags

GPS_UCAP_NET_GLB_INFO 

(rw-) MBG_UCAP_NET_GLB_INFO/MBG_UCAP_NET_GLB_SETTINGS, only supp. if MBG_XFEATURE_UCAP_NET is set in extended features

GPS_UCAP_NET_RECV_INFO_IDX 

(rw-) MBG_UCAP_NET_RECV_INFO_IDX/MBG_UCAP_NET_RECV_SETTINGS_IDX, only supp. if MBG_XFEATURE_UCAP_NET is set in extended features

GPS_IO_PORT_LIMITS 

(r–) MBG_IO_PORT_LIMITS, only supp. if MBG_XFEATURE_IO_PORTS is set in extended features

GPS_IO_PORT_SETTINGS_IDX 

(-w-) MBG_IO_PORT_SETTINGS_IDX, only supp. if MBG_XFEATURE_IO_PORTS is set in extended features

GPS_IO_PORT_INFO_IDX 

(r–) MBG_IO_PORT_INFO_IDX, only supp. if MBG_XFEATURE_IO_PORTS is set in extended features and from 0..MBG_IO_PORT_LIMITS::num_ports - 1

GPS_IO_PORT_TYPE_INFO_IDX 

(r–) MBG_IO_PORT_TYPE_INFO_IDX, only supp. if MBG_XFEATURE_IO_PORTS is set in extended features and from 0..MMBG_IO_PORT_INFO::num_types - 1

GPS_IO_PORT_STATUS_IDX 

(r–) MBG_IO_PORT_STATUS_IDX, only supp. if MBG_XFEATURE_IO_PORTS is set in extended features and from 0..MBG_IO_PORT_LIMITS::num_ports - 1

GPS_MONITORING_LIMITS 

(r–) MBG_MONITORING_LIMITS, only supp. if MBG_XFEATURE_MONITORING is set in extended features

GPS_SNMP_GLB 

(rw-) MBG_SNMP_GLB_INFO / MBG_SNMP_GLB_SETTINGS, only supp. if MBG_MONITORING_TYPE_MSK_SNMP is set in MBG_MONITORING_LIMITS::supp_types

GPS_SNMP_V12_IDX 

(rw-) MBG_SNMP_V12_INFO_IDX / MBG_SNMP_V12_SETTINGS_IDX, only supp. if MBG_SNMP_VERSION_MSK_V1 or :: MBG_SNMP_VERSION_MSK_V2 is set in MBG_SNMP_GLB_INFO::supp_versions and from 0..MBG_SNMP_GLB_SETTINGS::num_v12_settings - 1

GPS_SNMP_V12_TRAP_IDX 

(rw-) MBG_SNMP_V12_TRAP_INFO_IDX / MBG_SNMP_V12_TRAP_SETTINGS_IDX, only supp. if MBG_SNMP_VERSION_MSK_V1 or :: MBG_SNMP_VERSION_MSK_V2c is set in MBG_SNMP_GLB_INFO::supp_versions and from 0..MBG_SNMP_GLB_SETTINGS::num_v12_trap_receivers - 1

GPS_SNMP_V3_IDX 

(rw-) MBG_SNMP_V3_INFO_IDX / MBG_SNMP_V3_SETTINGS_IDX, only supp. if MBG_SNMP_VERSION_MSK_V3 is set in MBG_SNMP_GLB_INFO::supp_versions and from 0..MBG_SNMP_GLB_SETTINGS::num_v3_settings - 1

GPS_SNMP_V3_TRAP_IDX 

(rw-) MBG_SNMP_V3_TRAP_INFO_IDX / MBG_SNMP_V3_TRAP_SETTINGS_IDX, only supp. if MBG_SNMP_VERSION_MSK_V3 in MBG_SNMP_GLB_INFO::supp_versions and from 0..MBG_SNMP_GLB_SETTINGS::num_v3_trap_receivers - 1

GPS_GNSS_SV_STATUS_IDX 

(r–) GNSS_SV_STATUS_IDX, only supp. if MBG_GNSS_FLAG_MSK_HAS_SV_STATUS is set

GPS_PTP_V2_DEFAULT_DS 

(rw-) MBG_PTP_V2_DEFAULT_DATASET, only supp. if PTP_CFG_MSK_HAS_V2_COMMON_DATASETS is set in PTP_CFG_INFO::supp_flags

GPS_PTP_V2_CURRENT_DS 

(rw-) MBG_PTP_V2_CURRENT_DATASET, only supp. if PTP_CFG_MSK_HAS_V2_COMMON_DATASETS is set in PTP_CFG_INFO::supp_flags

GPS_PTP_V2_PARENT_DS 

(rw-) MBG_PTP_V2_PARENT_DATASET, only supp. if PTP_CFG_MSK_HAS_V2_COMMON_DATASETS is set in PTP_CFG_INFO::supp_flags

GPS_PTP_V2_TIME_PROP_DS 

(rw-) MBG_PTP_V2_TIME_PROPERTIES_DATASET, only supp. if PTP_CFG_MSK_HAS_V2_COMMON_DATASETS is set in PTP_CFG_INFO::supp_flags

GPS_PTP_V2_PORT_DS_IDX 

(rw-) MBG_PTP_V2_PORT_DATASET_IDX, only supp. if PTP_CFG_MSK_HAS_V2_COMMON_DATASETS is set in PTP_CFG_INFO::supp_flags

GPS_TAINTED_CFG 

(r–) MBG_TAINTED_CFG, only supp. if MBG_XFEATURE_TAINTED_CFG is set in extended features

GPS_EVENT_IDX 

(rw-) MBG_EVENT_INFO_IDX / MBG_EVENT_SETTINGS_IDX, only supp. if MBG_XFEATURE_MONITORING is set in extended features

GPS_EVENT_STAT_IDX 

(r–) MBG_EVENT_STATUS_IDX, only supp. if MBG_XFEATURE_MONITORING is set in extended features

GPS_NTP_REFCLK_CFG 

(rw-) NTP_REFCLK_CFG_INFO_IDX, only if NTP_SRV_MODE_SETTINGS::num_refclks > 0

GPS_NTP_MISC_LIMITS 

(r–) NTP_MISC_LIMITS, only if NTP_MSK_MISCELLANEOUS is set in NTP_GLB_INFO::supp_flags

GPS_NTP_MISC_ORPHAN_MODE 

(rw-) NTP_MISC_ORPHAN_MODE_SETTINGS, only if NTP_MISC_MSK_ORPHAN_MODE is set in NTP_MISC_LIMITS::supp_flags

GPS_NTP_SYMM_KEY_LIMITS 

(r–) NTP_SYMM_KEY_LIMITS, only if NTP_MSK_SYMM_KEYS is set in NTP_SRV_MODE_SETTINGS::flags

GPS_NTP_SYMM_KEY_CFG 

(rw-) NTP_SYMM_KEY_INFO_IDX / NTP_SYMM_KEY_SETTINGS_IDX, only if NTP_MSK_SYMM_KEYS is set in NTP_SRV_MODE_SETTINGS::flags

GPS_NTP_TRUSTED_KEY_CFG 

(rw-) NTP_TRUSTED_KEY_INFO_IDX / NTP_TRUSTED_KEY_SETTINGS_IDX, only if NTP_GLB_INFO::max_trusted_keys > 0

GPS_PTP_V1_DEFAULT_DS 

(rw-) MBG_PTP_V1_DEFAULT_DATASET, only supp. if PTP_CFG_MSK_HAS_V1_COMMON_DATASETS is set in PTP_CFG_INFO::supp_flags

GPS_PTP_V1_CURRENT_DS 

(rw-) MBG_PTP_V1_CURRENT_DATASET, only supp. if PTP_CFG_MSK_HAS_V1_COMMON_DATASETS is set in PTP_CFG_INFO::supp_flags

GPS_PTP_V1_PARENT_DS 

(rw-) MBG_PTP_V1_PARENT_DATASET, only supp. if PTP_CFG_MSK_HAS_V1_COMMON_DATASETS is set in PTP_CFG_INFO::supp_flags

GPS_PTP_V1_TIME_PROP_DS 

(rw-) MBG_PTP_V1_TIME_PROPERTIES_DATASET, only supp. if PTP_CFG_MSK_HAS_V1_COMMON_DATASETS is set in PTP_CFG_INFO::supp_flags

GPS_PTP_V1_PORT_DS_IDX 

(rw-) MBG_PTP_V1_PORT_DATASET_IDX, only supp. if PTP_CFG_MSK_HAS_V1_COMMON_DATASETS is set in PTP_CFG_INFO::supp_flags

GPS_NTP_REFCLK_STATE_IDX 

(r–) NTP_REFCLK_STATE_IDX, with index 0 ... NTP_SRV_MODE_SETTINGS::num_refclks - 1

GPS_EVENT_VALUE_IDX 

(r–) MBG_EVENT_VALUE_IDX, only supp. if MBG_EVENT_INFO::value_dict_entries > 0

GPS_REGISTER_PUSH_MSGS 

(-w-) Send GPS command as payload, only supp. if MBG_XFEATURE_PUSH_MSGS

GPS_UNREGISTER_PUSH_MSGS 

(-w-) Send GPS command as payload, only supp. if MBG_XFEATURE_PUSH_MSGS

GPS_AUTH_USER_INFO 

(r–) MBG_USER_INFO for the authenticated user, see MBG_XFEATURE_USER_AUTH

GPS_AUTH_USER_STATUS 

(r–) MBG_USER_STATUS for the authenticated user, see MBG_XFEATURE_USER_AUTH

GPS_USER_MNGMNT_INFO 

(rw-) MBG_USER_MNGMNT_INFO / MBG_USER_MNGMNT_SETTINGS, only supp. if MBG_XFEATURE_USER_MNGMNT

GPS_USER_INFO_IDX 

(rw-) MBG_USER_INFO_IDX / MBG_USER_SETTINGS_IDX, index 0 .. MBG_USER_MNGMNT_SETTINGS::num_users, only supp. if MBG_XFEATURE_USER_MNGMNT

GPS_USER_LEVEL_INFO_IDX 

(rw-) MBG_USER_INFO_IDX / MBG_USER_SETTINGS_IDX, index 0 .. MBG_USER_MNGMNT_SETTINGS::num_levels, only supp. if MBG_XFEATURE_USER_MNGMNT

GPS_USER_STATUS_IDX 

(r–) MBG_USER_STATUS_IDX, index 0 .. MBG_USER_MNGMNT_SETTINGS::num_users, only supp. if MBG_XFEATURE_USER_MNGMNT

GPS_PTP_SMPTE_TLV 

(r–) PTP_SMPTE_PROFILE_CFG, only supp. if PTP_CFG_MSK_HAS_SMPTE_TLV_STATE is set in PTP_CFG_INFO::supp_flags

GPS_SVC_MGMT_INFO 

(r–) MBG_SERVICE_MGMT_INFO, only supp. if MBG_XFEATURE_SERVICE

GPS_SVC_INFO_IDX 

(rw-) MBG_SERVICE_INFO_IDX / MBG_SERVICE_SETTINGS_IDX, index 0 .. MBG_SERVICE_MGMT_INFO::num_services - 1, only supp. if MBG_XFEATURE_SERVICE

GPS_SVC_STATUS_IDX 

(r–) MBG_SERVICE_STATUS_IDX, index 0 .. MBG_SERVICE_MGMT_INFO::num_services - 1, only supp. if MBG_XFEATURE_SERVICE

GPS_SVC_CTL_IDX 

(w–) MBG_SERVICE_CTL, index 0 .. MBG_SERVICE_MGMT_INFO::num_services - 1, only supp. if MBG_XFEATURE_SERVICE

GPS_SYSLOG_GLB_INFO 

(rw-) MBG_SYSLOG_GLB_INFO / MBG_SYSLOG_GLB_SETTINGS, only supp. if MBG_MONITORING_TYPE_MSK_SYSLOG is set in MBG_MONITORING_LIMITS::supp_types

GPS_SYSLOG_INFO_IDX 

(rw-) MBG_SYSLOG_INFO_IDX / MBG_SYSLOG_SETTINGS_IDX, only supp. if MBG_MONITORING_TYPE_MSK_SYSLOG is set in MBG_MONITORING_LIMITS::supp_types and from 0..MBG_SYSLOG_GLB_INFO::max_servers - 1

GPS_FW_GLB_INFO 

(r–) MBG_FW_GLB_INFO, only supp. if MBG_XFEATURE_FW_MNGMNT is set

GPS_FW_INFO_IDX 

(r–) MBG_FW_INFO_IDX, with index 0 ... MBG_FW_GLB_INFO::installed_fws - 1

GPS_FW_UFU_INFO_IDX 

(r–) MBG_FW_UFU_INFO_IDX, with index 0 ... MBG_FW_INFO::num_ufus - 1

GPS_FW_ACTIVATE 

(-w-) Transmit index of MBG_FW_INFO_IDX to be activated

GPS_FW_DELETE 

(-w-) Transmit index of MBG_FW_INFO_IDX to be deleted

GPS_FW_UFU_FLASH 

(-w-) Transmit UFU flash instructions MBG_FW_UFU_FLASH_CMD

GPS_DATABASE_GLB_INFO 

(r–) MBG_DATABASE_GLB_INFO, only supp. if MBG_XFEATURE_DATABASE is set

GPS_DATABASE_INFO_IDX 

(rw-) MBG_DATABASE_INFO_IDX / MBG_DATABASE_SETTINGS_IDX, index 0..MBG_DATABASE_GLB_INFO::num_dbs - 1, only supp. if MBG_XFEATURE_DATABASE

GPS_DATABASE_CMD 

(-w-) MBG_DATABASE_CMD, only supp. if MBG_XFEATURE_DATABASE

GPS_CFGH 

(rw-) CFGH, SVs' configuration and health codes

GPS_ALM 

(rw-) req: uint16_t SV num, SV_ALM, one SV's almanac

GPS_EPH 

(rw-) req: uint16_t SV num, SV_EPH, one SV's ephemeris

GPS_UTC 

(rw-) UTC, GPS UTC correction parameters

GPS_IONO 

(rw-) IONO, GPS ionospheric correction parameters

GPS_ASCII_MSG 

(r–) ASCII_MSG, the GPS ASCII message

GPS_GLNS_ALM 

(rw-) ** preliminary ** //##++

GPS_GNSS_SAT_INFO 

(r–) GNSS_SAT_INFO, GLONASS-only satellite info (deprecated by GPS_GNSS_SAT_INFO_IDX)

GPS_GNSS_MODE 

(rw-) MBG_GNSS_MODE_INFO/MBG_GNSS_MODE_SETTINGS, GNSS operation mode

GPS_IP4_SETTINGS 

(rw-) IP4_SETTINGS, only if GPS_HAS_LAN_IP4

GPS_LAN_IF_INFO 

(r–) LAN_IF_INFO, only if GPS_HAS_LAN_IP4

GPS_IP4_STATE 

(r–) IP4_SETTINGS, only if GPS_HAS_LAN_IP4

GPS_SCU_STAT 

(rwa) SCU_STAT_SETTINGS/SCU_STAT_INFO, SCU board control, only if ::GPS_MODEL_IS_SCU

GPS_CRYPTED_PACKET 

(rwa) encrypted binary packet

GPS_CRYPTED_RAW_PACKET 

(rwa) encrypted binary raw packet

GPS_XBP_PACKET 

(rwa) eXtended Binary Packet, only if GPS_HAS_XBP, see eXtended Binary Protocol definitions

GPS_SECU_INFO 

(r–) encryption method for LAN interface

GPS_SECU_SETTINGS 

(rw-) reserved for public key LAN interface

GPS_SECU_PUBLIC_KEY 

(—) settings and password for LAN interface

PZF_PCPS_TIME 

(rw-) PCPS_TIME, date/time/status, only if GPS_MODEL_IS_DCF_PZF

PZF_TR_DISTANCE 

(rw-) TR_DISTANCE, dist. from transmitter [km], only if GPS_MODEL_IS_DCF_PZF

PZF_TZCODE 

(rw-) TZCODE, time zone code, only if GPS_MODEL_IS_DCF_PZF

PZF_CORR_INFO 

(r–) CORR_INFO, correlation info, only if GPS_MODEL_IS_DCF_PZF

GPS_TIME_MON_INST_INFO 

(rw-) MBG_TIME_MON_INST_INFO

GPS_TIME_MON_TARGET_SETTINGS 

(-w-) MBG_TIME_MON_TARGET_SETTINGS

GPS_TIME_MON_TARGET_STATUS_IDX 

(r–) MBG_TIME_MON_TARGET_STATUS_IDX

GPS_TIME_MON_TARGET_EXT_DATA_SET_IDX 

(r–) MBG_TIME_MON_TARGET_EXT_DATA_SET_IDX

Definition at line 791 of file gpsserio.h.

◆ GPS_CMD_CTRL_CODES

Control codes to be or'ed with a particular command/type code.

Enumerator
GPS_REQACK 

to device: request acknowledge

GPS_ACK 

from device: acknowledge a command

GPS_NACK 

from device: error evaluating a command

Definition at line 738 of file gpsserio.h.

◆ MBG_CONN_TYPES

Binary message connection types.

Used with MBG_MSG_CTL::conn_type

Enumerator
MBG_CONN_TYPE_SERIAL 

connection via serial port

MBG_CONN_TYPE_SOCKET 

connection via network socket

MBG_CONN_TYPE_USB 

connection via direct USB

MBG_CONN_TYPE_SERIAL_FTDI 

connection via FTDI D2xx USB-To-Serial converter

MBG_CONN_TYPE_USB_DIRECT_IO 

connection via direct USB I/O operation

N_MBG_CONN_TYPE 

Definition at line 2050 of file gpsserio.h.

◆ MBG_MSG_RCV_CTL_BITS

Receive control bits used to define MBG_MSG_RCV_CTL_MASKS.

See also
MBG_MSG_RCV_CTL_MASKS
Enumerator
MBG_MSG_RCV_CTL_BIT_RCVD_HDR 
MBG_MSG_RCV_CTL_BIT_MSG_TOO_LONG 
MBG_MSG_RCV_CTL_BIT_OVERFLOW 
MBG_MSG_RCV_CTL_BIT_DECRYPT_ERR 
MBG_MSG_RCV_CTL_BIT_DECRYPTED 
N_MBG_MSG_RCV_CTL_BIT 

Definition at line 1758 of file gpsserio.h.

◆ MBG_MSG_RCV_CTL_MASKS

Receive control bit masks.

Used with MBG_MSG_RCV_CTL::rcv_state::flags

See also
MBG_MSG_RCV_CTL_BITS
Enumerator
MBG_MSG_RCV_CTL_RCVD_HDR 

see MBG_MSG_RCV_CTL_BIT_RCVD_HDR

MBG_MSG_RCV_CTL_MSG_TOO_LONG 

see MBG_MSG_RCV_CTL_BIT_MSG_TOO_LONG

MBG_MSG_RCV_CTL_OVERFLOW 

see MBG_MSG_RCV_CTL_BIT_OVERFLOW

MBG_MSG_RCV_CTL_DECRYPT_ERR 

see MBG_MSG_RCV_CTL_BIT_DECRYPT_ERR

MBG_MSG_RCV_CTL_DECRYPTED 

see MBG_MSG_RCV_CTL_BIT_DECRYPTED

Definition at line 1775 of file gpsserio.h.

◆ MBG_XFER_MODES

Binary message transfer modes.

Used with MBG_MSG_XMT_CTL::xfer_mode

Enumerator
MBG_XFER_MODE_NORMAL 

normal, unencrypted transmission

MBG_XFER_MODE_ENCRYPTED 

encrypted transmission, usually over network

N_MBG_XFER_MODE 

Definition at line 1804 of file gpsserio.h.

◆ TR_STATUS_CODES

Status codes returned by the check_transfer() function.

Enumerator
TR_COMPLETE 

A binary message has been received successfully.

TR_RECEIVING 

Binary reception in progress, i.e. after START_OF_HEADER received.

TR_WAITING 

Waiting for a binary message, i.e. no START_OF_HEADER received, yet.

TR_TIMEOUT 

No data received during the timeout interval.

TR_CSUM_HDR 

The header checksum of a received message is invalid.

TR_CSUM_DATA 

The data checksum of a received message is invalid.

TR_DECRYPTION 

A binary message received over LAN could not be decrypted.

TR_OPEN_ERR 

Failed to open connection.

TR_IO_ERR 

I/O error for the specified connection.

TR_AUTH_ERR 

Authentication error for the specified LAN connection.

TR_RCVD_NACK 

Received Negative Acknowledge from a device (prev. msg not accepted or not supported)

TR_OVERFLOW 

Received message was too long for the message receive buffer.

Definition at line 711 of file gpsserio.h.

Function Documentation

◆ check_transfer()

int check_transfer ( MBG_MSG_RCV_CTL prctl,
uint8_t  c 
)

Check an incoming data stream for a binary message.

Check the sequence of incoming characters for blocks of binary message data. Binary messages are saved in a buffer which is part of the MBG_MSG_RCV_CTL structure and the caller checks the return value to get the receive status.

This function doesn't protect access to the device by a mutex, so the calling function has to take care of the mutex handling.

Parameters
[in,out]prctlPointer to a valid receive control structure
[in]cA byte from the incoming data stream
Returns
One of the TR_STATUS_CODES

Referenced by mbgextio_rcv_msg_unlocked().

◆ chk_data_csum()

int chk_data_csum ( const MBG_MSG_BUFF pmb)

Check if the data checksum of a binary message is valid.

Parameters
[in]pmbpointer to a binary message buffer
Returns
MBG_SUCCESS or MBG_ERR_DATA_CSUM

◆ chk_hdr_csum()

int chk_hdr_csum ( const MSG_HDR pmh)

Check if the header checksum of a binary message is valid.

Parameters
[in]pmhpointer to a binary message header
Returns
MBG_SUCCESS or MBG_ERR_HDR_CSUM

◆ chk_hdr_rcvd()

int chk_hdr_rcvd ( const MBG_MSG_RCV_CTL prctl)

Checks if a binary message header has been completely received.

Parameters
[in]prctlMBG_MSG_RCV_CTL that shall be checked
Returns
One of the MBG_RETURN_CODES

◆ decrypt_message()

int decrypt_message ( MBG_MSG_CTL pmctl)

Decrypt an encrypted binary message.

Parameters
[in,out]pmctlPointer to a valid message control structure
Returns
One of the MBG_RETURN_CODES

Referenced by mbgextio_rcv_msg_unlocked().

◆ encrypt_message()

int encrypt_message ( MBG_MSG_CTL pmctl,
CRYPT_MSG_PREFIX pcmp,
MBG_MSG_BUFF pmb 
)

Encrypt a binary message.

In encryption mode the original packet is encrypted and put as data portion into an envelope package.

Parameters
[in,out]pmctlPointer to a valid message control structure
[in,out]pcmpPointer to encryption settings
[in,out]pmbPointer to a binary message buffer
Returns
the number of bytes of the encrypted message, or one of the MBG_ERROR_CODES

◆ init_transfer()

void init_transfer ( MBG_MSG_RCV_CTL prctl)

Init reception of a binary message.

Parameters
[in,out]prctlPointer to a valid receive control structure
See also
check_transfer

Referenced by mbgextio_rcv_msg_unlocked().

◆ mbg_ftdi_ft_status_to_mbg()

int mbg_ftdi_ft_status_to_mbg ( int  status)

Translate a FTDI API status code to one of the MBG_ERROR_CODES.

Parameters
[in]statusA status code defined by the FTDI API interface
Returns
One of the MBG_RETURN_CODES

Referenced by dev_open_finish_setup(), mbgextio_close_connection(), and mbgextio_rcv_msg_unlocked().

◆ msg_csum()

CSUM msg_csum ( const uint8_t p,
int  n 
)

Compute a checksum for a binary message.

Note
This function differs from the checksum() function used to compute the checksum of battery-buffered variables.
Parameters
[in]ppointer to a buffer of data bytes
[in]nthe number of bytes in the buffer
Returns
the computed checksum

◆ msg_csum_update()

CSUM msg_csum_update ( CSUM  csum,
const uint8_t p,
int  n 
)

Compute a simple binary checksum.

Compute a checksum about a number of bytes starting with a given initial value.

Parameters
[in]csumthe initial value
[in]ppointer to a buffer of data bytes
[in]nthe number of bytes in the buffer
Returns
the computed checksum

◆ msg_hdr_csum()

CSUM msg_hdr_csum ( const MSG_HDR pmh)

Compute the checksum of a binary message header.

Parameters
[in]pmhpointer to a binary message header
Returns
the computed checksum

◆ set_encryption_mode()

void set_encryption_mode ( MBG_MSG_CTL pmctl,
int  mode,
const char *  key 
)

Set communication channel to specified encryption mode.

Parameters
[in,out]pmctlPointer to a valid message control structure
[in]modeEncryption mode, usually MBG_XFER_MODE_ENCRYPTED
[in]keyThe crypto key (password) to be used

Referenced by dev_open_finish_setup().

◆ xmt_cmd()

int xmt_cmd ( MBG_MSG_CTL pmctl,
const XBP_ADDR p_addr,
GPS_CMD  cmd 
)

Send a binary command message without parameters.

This function doesn't protect access to the device by a mutex, so the calling function has to take care of the mutex handling, or mbgextio_xmt_cmd which does so should be called preferably from applications.

Parameters
[in,out]pmctlPointer to a valid message control structure
[in]p_addrPointer to XBP address specifier
[in]cmdOne of the command codes enumerated in GPS_CMD_CODES
Returns
One of the MBG_RETURN_CODES
See also
mbgextio_xmt_cmd
mbgextio_xmt_cmd_us
mbgextio_xmt_cmd_u32
xmt_cmd_us

Referenced by mbgextio_get_ucap(), mbgextio_req_data(), mbgextio_setup_receiver_info(), and mbgextio_xmt_cmd().

◆ xmt_cmd_u32()

int xmt_cmd_u32 ( MBG_MSG_CTL pmctl,
const XBP_ADDR p_addr,
GPS_CMD  cmd,
uint32_t  u32 
)

Send a binary command message with 32 bit parameter.

This function doesn't protect access to the device by a mutex, so the calling function has to take care of the mutex handling, or mbgextio_xmt_cmd_us which does so should be called preferably from applications.

Parameters
[in,out]pmctlPointer to a valid message control structure
[in]p_addrPointer to XBP address specifier
[in]cmdOne of the command codes enumerated in GPS_CMD_CODES
[in]u32The 32 bit message parameter (data)
Returns
One of the MBG_RETURN_CODES
See also
mbgextio_xmt_cmd_us
mbgextio_xmt_cmd
mbgextio_xmt_cmd_u32
xmt_cmd

Referenced by mbgextio_get_event_value_idx(), and mbgextio_xmt_cmd_u32().

◆ xmt_cmd_us()

int xmt_cmd_us ( MBG_MSG_CTL pmctl,
const XBP_ADDR p_addr,
GPS_CMD  cmd,
uint16_t  us 
)

Send a binary command message with ushort (16 bit) parameter.

This function doesn't protect access to the device by a mutex, so the calling function has to take care of the mutex handling, or mbgextio_xmt_cmd_us which does so should be called preferably from applications.

Parameters
[in,out]pmctlPointer to a valid message control structure
[in]p_addrPointer to XBP address specifier
[in]cmdOne of the command codes enumerated in GPS_CMD_CODES
[in]usThe 16 bit message parameter (data)
Returns
One of the MBG_RETURN_CODES
See also
mbgextio_xmt_cmd_us
mbgextio_xmt_cmd
mbgextio_xmt_cmd_u32
xmt_cmd

Referenced by mbgextio_get_all_ptp_uc_master_info(), mbgextio_get_xmr_status_idx(), mbgextio_req_data_idx_unlocked(), and mbgextio_xmt_cmd_us().

◆ xmt_tbuff()

int xmt_tbuff ( MBG_MSG_CTL pmctl,
const XBP_ADDR p_addr 
)

Complete message header and transmit message.

Compute checksums and complete the message header, then transmit both header and data. The caller must have copied the data to be sent to the data field of the transmit buffer and have set up the cmd and len fields of the message header.

This function doesn't protect access to the device by a mutex, so the calling function has to take care of the mutex handling.

Parameters
[in,out]pmctlPointer to a valid message control structure
[in]p_addrPointer to XBP address specifier
Returns
one of the MBG_RETURN_CODES

Referenced by dev_open_finish_setup(), and mbgextio_xmt_msg().