mbgtools-lx  4.2.8
xdevfeat.h
Go to the documentation of this file.
1 
2 /**************************************************************************
3  *
4  * $Id: xdevfeat.h 1.3 2018/07/16 12:51:08 martin REL_M $
5  *
6  * Copyright (c) Meinberg Funkuhren, Bad Pyrmont, Germany
7  *
8  * Description:
9  * Definitions and prototypes for xdevfeat.c.
10  *
11  * -----------------------------------------------------------------------
12  * $Log: xdevfeat.h $
13  * Revision 1.3 2018/07/16 12:51:08 martin
14  * Fields user_info and user_status were added to MBG_XDEV_FEATURES.
15  * Updated function prototypes.
16  * Revision 1.2 2017/07/06 07:49:25 martin
17  * Added some macros and inline function simplifying
18  * implementation of the individual check functions.
19  * Updated function prototypes.
20  * Revision 1.1 2016/03/16 14:32:52 martin
21  * Initial revision.
22  *
23  **************************************************************************/
24 
25 #ifndef _XDEVFEAT_H
26 #define _XDEVFEAT_H
27 
28 
29 /* Other headers to be included */
30 
31 #include <gpsdefs.h>
32 #include <mbgerror.h>
33 
34 #ifdef _XDEVFEAT
35  #define _ext
36  #define _DO_INIT
37 #else
38  #define _ext extern
39 #endif
40 
41 
42 /* Start of header body */
43 
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47 
88 typedef struct
89 {
90  uint32_t reserved;
96 
98 
99 
100 
105 
106 
107 
121 #define _check_feat_supp_mask( _supp_msk, _chk_msk ) \
122  ( ( ( (_supp_msk) & (_chk_msk) ) == (_chk_msk) ) ? \
123  MBG_SUCCESS : MBG_ERR_NOT_SUPP_BY_DEV )
124 
125 
126 
140 #define _check_feat_supp_bit( _supp_msk, _bit_num ) \
141  ( ( (_supp_msk) & ( 1UL << (_bit_num) ) ) ? \
142  MBG_SUCCESS : MBG_ERR_NOT_SUPP_BY_DEV )
143 
144 
145 
146 static __mbg_inline /*HDR*/
161 int check_feat_supp_byte_array( int bit_num, const uint8_t *p, int max_bytes )
162 {
163  int byte_num = bit_num >> 3;
164 
165  if ( byte_num < max_bytes ) // the normal case
166  {
167  ulong bit_mask = 1UL << ( bit_num & 0x07 );
168 
169  return ( p[byte_num] & bit_mask ) ? MBG_SUCCESS : MBG_ERR_NOT_SUPP_BY_DEV;
170  }
171 
172  return MBG_ERR_RANGE;
173 
174 } // check_feat_supp_byte_array
175 
176 
177 
178 /* ----- function prototypes begin ----- */
179 
180 /* This section was generated automatically */
181 /* by MAKEHDR, do not remove the comments. */
182 
197 
216 
231 
246 
261 
274 
287 
300 
313 
334 
347 
360 
373 
386 
399 
412 
425 
438 
451 
464 
477 
491 
504 
517 
537 
557 
575 
593 
609 
621 
633 
646 
659 
672 
685 
698 
711 
724 
736 
748 
760 
772 
784 
797 
809 
822 
835 
848 
861 
875 
887 
900 
916 
928 
940 
953 
965 
977 
989 
1001 
1013 
1025 
1037 
1053 
1054 
1055 /* ----- function prototypes end ----- */
1056 
1057 #ifdef __cplusplus
1058 }
1059 #endif
1060 
1061 /* End of header body */
1062 
1063 #undef _ext
1064 #undef _DO_INIT
1065 
1066 #endif /* _XDEVFEAT_H */
XDEVFEAT_CHK_SUPP_FNC xdevfeat_supp_tlv_ptpv2_license
Check if a device supports PTPv2 license infos.
Definition: xdevfeat.c:1212
int xdevfeat_has_prog_pulses(const MBG_XDEV_FEATURES *p_xdf)
Definition: xdevfeat.c:418
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_fw_mngmnt
Check if a device supports the FW management API.
Definition: xdevfeat.c:993
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_pos_lla
Check if a device supports reading the position as LLA array.
Definition: xdevfeat.c:550
int xdevfeat_has_ims(const MBG_XDEV_FEATURES *p_xdf)
Definition: xdevfeat.c:376
int xdevfeat_has_serouts(const MBG_XDEV_FEATURES *p_xdf)
Definition: xdevfeat.c:473
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_ptp
Check if a device supports the PTP API.
Definition: xdevfeat.c:943
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_clk_res_info
Check if a device supports the MBG_CLK_RES_INFO structure.
Definition: xdevfeat.c:1654
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_ant_cable_length
Check if a device supports the ANT_CABLE_LEN structure and API.
Definition: xdevfeat.c:724
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_pos_xyz
Check if a device supports reading the position as XYZ array.
Definition: xdevfeat.c:528
uint32_t reserved
Currently reserved, unused, always 0.
Definition: xdevfeat.h:90
XDEVFEAT_CHK_SUPP_FNC xdevfeat_supp_tlv_ptpv1_license
Check if a device supports PTPv1 License Infos via TLV.
Definition: xdevfeat.c:1254
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_enable_flags
Check if a device supports the ENABLE_FLAGS structure and API.
Definition: xdevfeat.c:680
XDEVFEAT_CHK_SUPP_FNC xdevfeat_is_gps
Check if a device can receive the GPS satellite system.
Definition: xdevfeat.c:183
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_scu_stat
Check if the device supports the SCU_STAT structures.
Definition: xdevfeat.c:816
int XDEVFEAT_CHK_SUPP_FNC(const MBG_XDEV_FEATURES *p_xdf)
Type of functions to check if a feature is supported.
Definition: xdevfeat.h:104
int xdevfeat_has_gpio(const MBG_XDEV_FEATURES *p_xdf)
Definition: xdevfeat.c:390
XDEVFEAT_CHK_SUPP_FNC xdevfeat_is_wwvb
Check if a device is a WWVB receiver.
Definition: xdevfeat.c:349
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_user_mngmnt
Check if a device supports user management.
Definition: xdevfeat.c:1696
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_tainted_cfg
Check if a device supports the Tainted config Tainted Config API.
Definition: xdevfeat.c:1612
XDEVFEAT_CHK_SUPP_FNC xdevfeat_is_bus_lvl_dev
Check if a device is a bus level device.
Definition: xdevfeat.c:371
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_pzf
Check if a device can receive DCF77 PZF.
Definition: xdevfeat.c:283
#define _NO_MBG_API
Definition: mbg_tgt.h:1028
#define _NO_MBG_API_ATTR
Definition: mbg_tgt.h:1032
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_user_auth
Check if a device supports user authentification.
Definition: xdevfeat.c:1675
#define MBG_ERR_RANGE
input parameter was out of range
Definition: mbgerror.h:347
int xdevfeat_has_irig_tx(const MBG_XDEV_FEATURES *p_xdf)
Definition: xdevfeat.c:434
XDEVFEAT_CHK_SUPP_FNC xdevfeat_supp_tlv_fw_rollback
Check if a device supports a factory reset via TLV.
Definition: xdevfeat.c:1147
XDEVFEAT_CHK_SUPP_FNC xdevfeat_supp_tlv_ntp_license
Check if a device supports NTP license infos via TLV.
Definition: xdevfeat.c:1233
A structure used to store extended device features.
Definition: gpsdefs.h:2438
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_net_cfg
Check if a device supports the new NET_CFG API.
Definition: xdevfeat.c:916
int xdevfeat_has_time_ttm(const MBG_XDEV_FEATURES *p_xdf)
Check if the device supports the builtin feature TIME.
Definition: xdevfeat.c:566
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_lne_api
Check if a device supports the LNE API.
Definition: xdevfeat.c:1382
XDEVFEAT_CHK_SUPP_FNC xdevfeat_supp_tlv_fw_update
Check if a device supports a firmware update via TLV.
Definition: xdevfeat.c:1169
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_gps_stat_info
Check if a device supports the STAT_INFO structure and API.
Definition: xdevfeat.c:702
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_up_conv
Check if the device has an L1 frequency up converter.
Definition: xdevfeat.c:1776
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_raw_irig_data
Check if a timecode receiver provides MBG_RAW_IRIG_DATA.
Definition: xdevfeat.c:858
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_evt_log
Check if a device supports the event log API.
Definition: xdevfeat.c:1013
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_reboot
Check if a device has MBG_XFEATURE_REBOOT.
Definition: xdevfeat.c:1480
A structure used to query current TLV capabilities.
Definition: gpsdefs.h:18263
XDEVFEAT_CHK_SUPP_FNC xdevfeat_supp_tlv_time_monitor_license
Check if a device supports Time Monitor License infos via TLV.
Definition: xdevfeat.c:1275
MBG_XFEATURE_BUFFER xfeature_buffer
Extended features provided by the device.
Definition: xdevfeat.h:92
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_ucap
Check if a device supports the user capture API.
Definition: xdevfeat.c:1038
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_pwr_ctl_api
Check if a device supports the power control API.
Definition: xdevfeat.c:1404
MBG_TLV_INFO tlv_info
TLV info provided by a device.
Definition: xdevfeat.h:93
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_xbp
Check if a device supports the extended binary protocol (XBP) feature.
Definition: xdevfeat.c:1548
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_ant_info
Check if a device supports the ANT_INFO structure and API.
Definition: xdevfeat.c:658
MBG_USER_STATUS user_status
User status for the logged in user.
Definition: xdevfeat.h:95
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_led_api
Check if a device supports the LED API.
Definition: xdevfeat.c:1360
XDEVFEAT_CHK_SUPP_FNC xdevfeat_is_msf
Check if a device is an MSF receiver.
Definition: xdevfeat.c:305
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_service
Check if a device supports services.
Definition: xdevfeat.c:1717
unsigned char uint8_t
Definition: words.h:210
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_gps_ignore_lock
Check if a device supports the IGNORE_LOCK structure and API.
Definition: xdevfeat.c:746
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_database
Check if a device supports database(s) feature.
Definition: xdevfeat.c:1569
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_time_scale
Check if a device supports the MBG_TIME_SCALE_INFO structure and API.
Definition: xdevfeat.c:592
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_tzdl
Check if a device supports the TZDL structure and API.
Definition: xdevfeat.c:614
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_lan_ip4
Check if a device supports the old LAN_IP4 API.
Definition: xdevfeat.c:887
XDEVFEAT_CHK_SUPP_FNC xdevfeat_is_gnss
Check if a device supports the GNSS API.
Definition: xdevfeat.c:211
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_bvar_stat
Check if a device supports the BVAR_STAT structure and API.
Definition: xdevfeat.c:506
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_ucap_net
Check if a device supports the user capture via network feature.
Definition: xdevfeat.c:1059
#define MBG_SUCCESS
Error codes used with Meinberg devices and drivers.
Definition: mbgerror.h:259
XDEVFEAT_CHK_SUPP_FNC xdevfeat_supp_tlv_exec_cmd
Check if a device supports a command execution via TLV.
Definition: xdevfeat.c:1125
MBG_USER_INFO user_info
User info for the logged in user.
Definition: xdevfeat.h:94
int xdevfeat_has_synth(const MBG_XDEV_FEATURES *p_xdf)
Definition: xdevfeat.c:404
Definition: myutil.h:117
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_gnss_mode
Check if a device supports GNSS mode feature All GNSS receivers support this feature by default...
Definition: xdevfeat.c:1591
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_cmd_save_cfg
Check if a device supports the GPS_SAVE_CFG command.
Definition: xdevfeat.c:1317
XDEVFEAT_CHK_SUPP_FNC xdevfeat_supp_tlv_file_req
Check if a device supports a file request via TLV.
Definition: xdevfeat.c:1103
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_tzcode
Check if a device supports the TZCODE API.
Definition: xdevfeat.c:636
int xdevfeat_has_mbg_os(const MBG_XDEV_FEATURES *p_xdf)
Definition: xdevfeat.c:462
RECEIVER_INFO receiver_info
Receiver info provided by the device.
Definition: xdevfeat.h:91
XDEVFEAT_CHK_SUPP_FNC xdevfeat_supp_tlv_ufu
Check if a device supports UFU (Unified Firmware Update) via TLV.
Definition: xdevfeat.c:1295
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_monitoring
Check if a device supports the extended feature monitoring.
Definition: xdevfeat.c:1338
int xdevfeat_has_io_ports(const MBG_XDEV_FEATURES *p_xdf)
Definition: xdevfeat.c:1431
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_ntp
Check if a device supports the NTP API.
Definition: xdevfeat.c:969
A structure combining all device feature information.
Definition: xdevfeat.h:88
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_req_ttm
Check if a device has MBG_XFEATURE_REQ_TTM.
Definition: xdevfeat.c:1502
XDEVFEAT_CHK_SUPP_FNC xdevfeat_is_tcr
Check if a device is a time code receiver (IRIG or similar)
Definition: xdevfeat.c:235
XDEVFEAT_CHK_SUPP_FNC xdevfeat_supp_tlv_diag_file
Check if a device supports creating / sending a diagnostics file via TLV.
Definition: xdevfeat.c:1191
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_xhe
Check if a device supports the XHE I/O commands.
Definition: xdevfeat.c:1738
#define MBG_ERR_NOT_SUPP_BY_DEV
Command or feature not supported by device.
Definition: mbgerror.h:286
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_tlv_api
Check if a device supports the TLV API.
Definition: xdevfeat.c:1081
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_transactions
Check if a device has MBG_XFEATURE_TRANSACTIONS.
Definition: xdevfeat.c:1459
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_xmulti_ref
Check if a device supports the extended multi ref features including multi instances.
Definition: xdevfeat.c:1527
XDEVFEAT_CHK_SUPP_FNC xdevfeat_is_jjy
Check if a device is a JJY receiver.
Definition: xdevfeat.c:327
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_sv_info
Check if the device supports the SV_INFO structures.
Definition: xdevfeat.c:837
int xdevfeat_has_irig_rx(const MBG_XDEV_FEATURES *p_xdf)
Definition: xdevfeat.c:448
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_push_msgs
Check if a device supports (un)registering for push messages.
Definition: xdevfeat.c:1633
static __mbg_inline int check_feat_supp_byte_array(int bit_num, const uint8_t *p, int max_bytes)
Check if a specific bit is set in a byte array.
Definition: xdevfeat.h:161
unsigned long ulong
Definition: words.h:292
A structure used to identify a device type and supported features.
Definition: gpsdefs.h:873
XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_ext_sys_info
Check if a device supports the MBG_EXT_SYS_INFO command.
Definition: xdevfeat.c:1426
XDEVFEAT_CHK_SUPP_FNC xdevfeat_is_dcf
Check if a device is a DCF77 AM receiver.
Definition: xdevfeat.c:259