summaryrefslogtreecommitdiff
path: root/mbglib/common/xdevfeat.c
blob: bc8814da3e542e11847d155ccfc1852a6c69b7ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533

/**************************************************************************
 *
 *  $Id: xdevfeat.c 1.1.1.28.1.12 2017/03/07 13:45:34 thomas-b TEST $
 *
 *  Copyright (c) Meinberg Funkuhren, Bad Pyrmont, Germany
 *
 *  Description:
 *    Meinberg API functions to check extended device features.
 *
 *    See notes near "defgroup xdevfeat_chk_supp_fncs" in xdevfeat.h.
 *
 * -----------------------------------------------------------------------
 *  $Log: xdevfeat.c $
 *  Revision 1.1.1.28.1.12  2017/03/07 13:45:34  thomas-b
 *  Check receiver info feature instead of builtin feature for ignore lock
 *  Revision 1.1.1.28.1.11  2017/02/22 11:32:47  martin
 *  Fixed warnings due to preliminary, unfinished code.
 *  Revision 1.1.1.28.1.10  2017/02/07 14:24:09  thomas-b
 *  Added function xdevfeat_has_monitoring, which checks if the extended feature MBG_XFEATURE_MONITORING is set
 *  Revision 1.1.1.28.1.9  2017/02/07 14:10:36  daniel
 *  Check license feature types
 *  Revision 1.1.1.28.1.8  2016/12/06 10:43:37  thomas-b
 *  Added function xdevfeat_has_sv_info
 *  Revision 1.1.1.28.1.7  2016/12/01 13:47:49  philipp
 *  Moved helper function check_byte_array_bit from xdevfeat.c to xtiocomm.c and make it public
 *  Revision 1.1.1.28.1.6  2016/11/30 16:12:26  thomas-b
 *  Added function xdevfeat_has_scu_stat
 *  Revision 1.1.1.28.1.5  2016/11/22 10:33:16  philipp
 *  Implemented I/O ports
 *  Revision 1.1.1.28.1.4  2016/11/02 12:16:18  thomas-b
 *  Fixed documentation
 *  Revision 1.1.1.28.1.3  2016/11/02 12:08:21  thomas-b
 *  Added function to check for new MBG_XFEATURE_REQ_TTM
 *  Revision 1.1.1.28.1.2  2016/11/01 09:34:43  martin
 *  Doxygen fixes.
 *  Revision 1.1.1.28.1.1  2016/10/25 08:07:54  martin
 *  Merged changes from 1.1.1.23.1.x.
 *  Revision 1.1.1.28  2016/10/20 14:46:04  thomas-b
 *  Added function to check if XBP is supported
 *  Revision 1.1.1.27  2016/10/20 10:43:36  thomas-b
 *  Added function to check if a device is a bus level device
 *  Revision 1.1.1.26  2016/10/14 11:09:41  thomas-b
 *  Added function to check MBG_XFEATURE_UCAP_NET
 *  Revision 1.1.1.25  2016/09/29 14:35:35  thomas-b
 *  Added function to check reboot feature
 *  Revision 1.1.1.24  2016/09/29 12:19:59  thomas-b
 *  Added function to check transactions feature
 *  Revision 1.1.1.23  2016/07/07 15:04:11  martin
 *  Renamed functions due to renamed library symbols.
 *  Revision 1.1.1.22  2016/06/15 10:15:51  thomas-b
 *  Added functions which check if the user capture feature is supported by a device
 *  Revision 1.1.1.21  2016/06/14 10:33:23  thomas-b
 *  Added functions which check if the event log feature is supported by a device
 *  Revision 1.1.1.20  2016/06/07 07:43:08  philipp
 *  New function to check for Irig Rx feature
 *  Revision 1.1.1.19  2016/06/02 10:15:40  philipp
 *  Renaming all MBG_EXT_REV_INFO related stuff to MBG_EXT_SYS_INFO.
 *  Revision 1.1.1.18  2016/05/30 08:10:47  thomas-b
 *  Added functions to check several builtin features
 *  Revision 1.1.1.17  2016/05/20 09:41:38  thomas-b
 *  Removed functions which check for a specific IMS card
 *  Revision 1.1.1.16  2016/05/20 08:50:46  thomas-b
 *  Added functions xdevfeat_has_time_scale and xdevfeat_has_tzcode
 *  Revision 1.1.1.15  2016/05/17 06:33:12  philipp
 *  New function to check whether a device has serial outputs
 *  Revision 1.1.1.14  2016/05/12 10:41:40  philipp
 *  New functions to check bpe card and IRIG Tx feature
 *  Revision 1.1.1.13  2016/05/10 06:15:32  philipp
 *  New function to check whether a device has programmable pulses
 *  Revision 1.1.1.12  2016/04/26 06:52:46  thomas-b
 *  Added functions to check if NET_CFG and LAN_IP4 APIs are supported
 *  Revision 1.1.1.11  2016/04/22 10:54:01  philipp
 *  New function to check whether device is LIU
 *  Revision 1.1.1.10  2016/04/20 13:21:06  thomas-b
 *  Added function to check if a device supports NTP
 *  Revision 1.1.1.9  2016/04/20 09:26:03  philipp
 *  Moved all HPS-PTP related structures to gpspriv.h and removed related extended feature bit from gpsdefs.h.
 *  Also removed functions from mbgextio and xdevfeat since HPS-PTP handling needs a redesign concerning structures.
 *  Thus, handle everything explicitly for now!
 *  -> Redesing this A.S.A.P.!!!
 *  Revision 1.1.1.8  2016/04/15 08:17:27  philipp
 *  New feature MBG_XFEATURE_EXT_PTP
 *  Revision 1.1.1.7  2016/04/13 07:01:22  philipp
 *  New function to check whether device is HPS
 *  Revision 1.1.1.6  2016/04/12 13:27:42  philipp
 *  Several new functions to check for device models and device features
 *  Revision 1.1.1.5  2016/04/11 13:57:13  thomas-b
 *  Added function xdevfeat_has_xmulti_ref
 *  Revision 1.1.1.4  2016/04/07 12:36:37  martin
 *  New function xdevfeat_has_ext_rev_info().
 *  Revision 1.1.1.3  2016/04/04 15:31:25  martin
 *  New function xdevfeat_is_vsg().
 *  Revision 1.1.1.2  2016/03/24 14:08:52  martin
 *  *** empty log message ***
 *  Revision 1.1.1.1  2016/03/18 10:48:10  martin
 *  *** empty log message ***
 *  Revision 1.1  2016/03/16 14:32:52  martin
 *  Initial revision.
 *
 **************************************************************************/

#define _XDEVFEAT
  #include <xdevfeat.h>
#undef _XDEVFEAT

#include <mbgerror.h>
#include <xtiocomm.h>



typedef uint32_t BUILTIN_FEATURE_MASK;


/**
 * @brief Entry for a table to specify model-depending built-in features
 */
typedef struct
{
  /// Model code according to ::RECEIVER_INFO::model_code, see ::GPS_MODEL_CODES
  uint16_t model_code;

  /// A combination of @ref GPS_FEATURE_MASKS bit masks specifying the
  /// built-in features supported by the specified device model.
  BUILTIN_FEATURE_MASK feature_mask;

} BUILTIN_FEATURE_TABLE_ENTRY;


/**
 * @brief A static table of builtin features
 *
 * Used to lookup the builtin features of a particular device model.
 */
static BUILTIN_FEATURE_TABLE_ENTRY builtin_feature_table[] = GPS_MODEL_BUILTIN_FEATURES;



static /*HDR*/
/**
 * @brief Check if a device supports a specific built-in feature or API
 *
 * Some features or API calls are implicitly supported by particular devices.
 * This function uses the ::RECEIVER_INFO::model_code to look up the specific
 * device in a table of ::BUILTIN_FEATURE_TABLE_ENTRY entries, and checks if
 * the requested feature bits are set for this device model.
 * If the model code of the specific device can't be found in the table then
 * then ::MBG_ERR_DEV_NOT_SUPP is returned and the source code files probably
 * need to be updated to support this device.
 *
 * @param[in] msk   One of the @ref GPS_FEATURE_MASKS bit masks
 * @param[in] p_ri  A ::RECEIVER_INFO structure read from the device before
 *
 * @return ::MBG_SUCCESS if all specified mask bits are set in ::RECEIVER_INFO::features,
 *         ::MBG_ERR_NOT_SUPP_BY_DEV if the bits are not set, and ::MBG_ERR_DEV_NOT_SUPP
 *         if the model code can't be found in the table.
 */
int check_builtin_feature( BUILTIN_FEATURE_MASK msk, const RECEIVER_INFO *p_ri )
{
  BUILTIN_FEATURE_TABLE_ENTRY *p;

  //### TODO Implement a kind of cache so we don't have to search the whole
  // table if several features of the same device are checked after each other.

  for ( p = builtin_feature_table; p->model_code || p->feature_mask; p++ )
    if ( p->model_code == p_ri->model_code )
      return ( ( p->feature_mask & msk ) == msk ) ? MBG_SUCCESS : MBG_ERR_NOT_SUPP_BY_DEV;

  return MBG_ERR_DEV_NOT_SUPP;

}  // check_builtin_feature



static /*HDR*/
/**
 * @brief Check if a device supports a specific feature or API
 *
 * This API call checks if a specific feature or API is supported
 * according to the ::RECEIVER_INFO::features mask read from the device.
 *
 * @param[in] msk   One of the @ref GPS_FEATURE_MASKS bit masks
 * @param[in] p_ri  A ::RECEIVER_INFO structure read from the device before
 *
 * @return ::MBG_SUCCESS if all specified mask bits are set in ::RECEIVER_INFO::features,
 *         else ::MBG_ERR_NOT_SUPP_BY_DEV
 */
int check_ri_feature( RI_FEATURES msk, const RECEIVER_INFO *p_ri )
{
  return ( ( p_ri->features & msk ) == msk ) ? MBG_SUCCESS : MBG_ERR_NOT_SUPP_BY_DEV;

}  // check_ri_feature



static /*HDR*/
/**
 * @brief Check if a specific extended feature is supported
 *
 * This API call checks if a specific extended feature or API is supported
 * according to the ::MBG_XFEATURE_BUFFER read from the device.
 *
 * @param[in] xf_bit   One of the ::MBG_XFEATURE_BITS
 * @param[in] xv_buf   Pointer to a ::MBG_XFEATURE_BUFFER read from the device before
 *
 * @return ::MBG_SUCCESS if the specified feature bit is set, else ::MBG_ERR_NOT_SUPP_BY_DEV or ::MBG_ERR_RANGE
 *
 * @see ::check_byte_array_bit
 */
int check_xfeature( int xf_bit, const MBG_XFEATURE_BUFFER *xv_buf )
{
  return check_byte_array_bit( xf_bit, xv_buf->b, sizeof( xv_buf->b ) );

}  // check_xfeature



#if defined( _PRELIMINARY_CODE )  //### TODO do we need this?

static /*HDR*/
/**
 * @brief Check if a specific bit is set in TLV's byte array.
 *
 * This API call checks if a specific TLV feature is supported according to
 * the ::MBG_TLV_INFO read from the device.
 *
 * @param[in] tlv_feat_bit   One of the ::MBG_TLV_FEAT_TYPES
 * @param[in] tlv_info       Pointer to a ::MBG_TLV_INFO read from the device before
 *
 * @return ::MBG_SUCCESS if the specified feature bit is set, else ::MBG_ERR_NOT_SUPP_BY_DEV or ::MBG_ERR_RANGE
 *
 * @see ::check_byte_array_bit
 */
int check_tlv_feat_supp( int tlv_feat_bit, const MBG_TLV_INFO *tlv_info )
{
  return check_byte_array_bit( tlv_feat_bit, tlv_info->supp_tlv_feat.b, sizeof( tlv_info->supp_tlv_feat.b ) );

}  // check_tlv_feat_supp

#endif  // defined( _PRELIMINARY_CODE )



/*HDR*/
/**
 * @brief Check if a device can receive the GPS satellite system
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else ::MBG_ERR_NOT_SUPP_BY_DEV
 *         or ::MBG_ERR_DEV_NOT_SUPP (see @ref xdevfeat_chk_supp_fncs)
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see ::mbgextio_dev_is_gps
 * @see ::mbg_chk_dev_is_gps
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_is_gps( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_builtin_feature( GPS_MODEL_IS_GPS, &p_xdf->receiver_info );

}  // xdevfeat_is_gps

XDEVFEAT_CHK_SUPP_FNC xdevfeat_is_gps;



/*HDR*/
/**
 * @brief Check if a device supports the GNSS API
 *
 * This is usually supported by devices which can receive signals
 * from different satellite systems, e.g. GPS, GLONASS, ...
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else ::MBG_ERR_NOT_SUPP_BY_DEV
 *         or ::MBG_ERR_DEV_NOT_SUPP (see @ref xdevfeat_chk_supp_fncs)
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see ::mbgextio_dev_is_gnss
 * @see ::mbg_chk_dev_is_gnss
 * @see ::MBG_GNSS_TYPES
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_is_gnss( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_builtin_feature( GPS_MODEL_IS_GNSS, &p_xdf->receiver_info );

}  // xdevfeat_is_gnss

XDEVFEAT_CHK_SUPP_FNC xdevfeat_is_gnss;



/*HDR*/
/**
 * @brief Check if a device is a time code receiver (IRIG or similar)
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else ::MBG_ERR_NOT_SUPP_BY_DEV
 *         or ::MBG_ERR_DEV_NOT_SUPP (see @ref xdevfeat_chk_supp_fncs)
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see ::mbgextio_dev_is_tcr  //### TODO
 * @see ::mbg_chk_dev_is_tcr   //### TODO
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_is_tcr( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_builtin_feature( GPS_MODEL_IS_TCR, &p_xdf->receiver_info );

}  // xdevfeat_is_tcr

XDEVFEAT_CHK_SUPP_FNC xdevfeat_is_tcr;



/*HDR*/
/**
 * @brief Check if a device is a DCF77 AM receiver
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else ::MBG_ERR_NOT_SUPP_BY_DEV
 *         or ::MBG_ERR_DEV_NOT_SUPP (see @ref xdevfeat_chk_supp_fncs)
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see ::mbgextio_dev_is_dcf  //### TODO
 * @see ::mbg_chk_dev_is_dcf
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_is_dcf( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_builtin_feature( GPS_MODEL_IS_DCF_AM, &p_xdf->receiver_info );

}  // xdevfeat_is_dcf_am

XDEVFEAT_CHK_SUPP_FNC xdevfeat_is_dcf;



/*HDR*/
/**
 * @brief Check if a device can receive DCF77 PZF
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else ::MBG_ERR_NOT_SUPP_BY_DEV
 *         or ::MBG_ERR_DEV_NOT_SUPP (see @ref xdevfeat_chk_supp_fncs)
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see ::mbgextio_dev_has_pzf  //### TODO
 * @see ::mbg_chk_dev_has_pzf
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_pzf( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_builtin_feature( GPS_MODEL_IS_DCF_PZF, &p_xdf->receiver_info );

}  // xdevfeat_has_pzf

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_pzf;



/*HDR*/
/**
 * @brief Check if a device is an MSF receiver
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else ::MBG_ERR_NOT_SUPP_BY_DEV
 *         or ::MBG_ERR_DEV_NOT_SUPP (see @ref xdevfeat_chk_supp_fncs)
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_is_msf( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_builtin_feature( GPS_MODEL_IS_MSF, &p_xdf->receiver_info );

}  // xdevfeat_is_msf

XDEVFEAT_CHK_SUPP_FNC xdevfeat_is_msf;



/*HDR*/
/**
 * @brief Check if a device is a JJY receiver
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else ::MBG_ERR_NOT_SUPP_BY_DEV
 *         or ::MBG_ERR_DEV_NOT_SUPP (see @ref xdevfeat_chk_supp_fncs)
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_is_jjy( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_builtin_feature( GPS_MODEL_IS_JJY, &p_xdf->receiver_info );

}  // xdevfeat_is_jjy

XDEVFEAT_CHK_SUPP_FNC xdevfeat_is_jjy;



/*HDR*/
/**
 * @brief Check if a device is a WWVB receiver
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else ::MBG_ERR_NOT_SUPP_BY_DEV
 *         or ::MBG_ERR_DEV_NOT_SUPP (see @ref xdevfeat_chk_supp_fncs)
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_is_wwvb( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_builtin_feature( GPS_MODEL_IS_WWVB, &p_xdf->receiver_info );

}  // xdevfeat_is_wwvb

XDEVFEAT_CHK_SUPP_FNC xdevfeat_is_wwvb;



/*HDR*/
/**
 * @brief Check if a device is a bus level device
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else ::MBG_ERR_NOT_SUPP_BY_DEV
 *         or ::MBG_ERR_DEV_NOT_SUPP (see @ref xdevfeat_chk_supp_fncs)
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_is_bus_lvl_dev( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_builtin_feature( GPS_MODEL_IS_BUS_LVL_DEV, &p_xdf->receiver_info );

}  // xdevfeat_is_bus_lvl_dev

XDEVFEAT_CHK_SUPP_FNC xdevfeat_is_bus_lvl_dev;



/*HDR*/
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_ims( const MBG_XDEV_FEATURES *p_xdf )
{
  if ( mbg_rc_is_success( check_ri_feature( GPS_HAS_IMS, &p_xdf->receiver_info ) ) )
    return MBG_SUCCESS;

  return MBG_ERR_NOT_SUPP_BY_DEV;

}  // xdevfeat_has_ims

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_ims;



/*HDR*/
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_gpio( const MBG_XDEV_FEATURES *p_xdf )
{
  if ( mbg_rc_is_success( check_ri_feature( GPS_HAS_GPIO, &p_xdf->receiver_info ) ) )
    return MBG_SUCCESS;

  return MBG_ERR_NOT_SUPP_BY_DEV;

}  // xdevfeat_has_gpio

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_gpio;



/*HDR*/
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_synth( const MBG_XDEV_FEATURES *p_xdf )
{
  if ( mbg_rc_is_success( check_ri_feature( GPS_HAS_SYNTH, &p_xdf->receiver_info ) ) )
    return MBG_SUCCESS;

  return MBG_ERR_NOT_SUPP_BY_DEV;

}  // xdevfeat_has_synth

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_synth;



/*HDR*/
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_prog_pulses( const MBG_XDEV_FEATURES *p_xdf )
{
  const RECEIVER_INFO *ri = &p_xdf->receiver_info;

  if ( ri->n_prg_out > 0 )
    return MBG_SUCCESS;

  return MBG_ERR_NOT_SUPP_BY_DEV;

}  // xdevfeat_has_prog_pulses

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_prog_pulses;



/*HDR*/
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_irig_tx( const MBG_XDEV_FEATURES *p_xdf )
{
  if ( mbg_rc_is_success( check_ri_feature( GPS_HAS_IRIG_TX, &p_xdf->receiver_info ) ) )
    return MBG_SUCCESS;

  return MBG_ERR_NOT_SUPP_BY_DEV;

}  // xdevfeat_has_irig_tx

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_irig_tx;



/*HDR*/
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_irig_rx( const MBG_XDEV_FEATURES *p_xdf )
{
  if ( mbg_rc_is_success( check_ri_feature( GPS_HAS_IRIG_RX, &p_xdf->receiver_info ) ) )
    return MBG_SUCCESS;

  return MBG_ERR_NOT_SUPP_BY_DEV;

}  // xdevfeat_has_irig_rx

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_irig_rx;



/*HDR*/
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_serouts( const MBG_XDEV_FEATURES *p_xdf )
{
  const RECEIVER_INFO *ri = &p_xdf->receiver_info;

  if ( ri->n_com_ports > 0 )
    return MBG_SUCCESS;

  return MBG_ERR_NOT_SUPP_BY_DEV;

}  // xdevfeat_has_serouts

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_serouts;



/*HDR*/
/**
 * @brief Check if a device supports the ::BVAR_STAT structure and API
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else ::MBG_ERR_NOT_SUPP_BY_DEV
 *         or ::MBG_ERR_DEV_NOT_SUPP (see @ref xdevfeat_chk_supp_fncs)
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_bvar_stat( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_builtin_feature( GPS_MODEL_HAS_BVAR_STAT, &p_xdf->receiver_info );

}  // xdevfeat_has_bvar_stat

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_bvar_stat;



/*HDR*/
/**
 * @brief Check if a device supports reading the position as ::XYZ array
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else ::MBG_ERR_NOT_SUPP_BY_DEV
 *         or ::MBG_ERR_DEV_NOT_SUPP (see @ref xdevfeat_chk_supp_fncs)
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_pos_xyz( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_builtin_feature( GPS_MODEL_HAS_POS_XYZ, &p_xdf->receiver_info );

}  // xdevfeat_has_pos_xyz

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_pos_xyz;



/*HDR*/
/**
 * @brief Check if a device supports reading the position as ::LLA array
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else ::MBG_ERR_NOT_SUPP_BY_DEV
 *         or ::MBG_ERR_DEV_NOT_SUPP (see @ref xdevfeat_chk_supp_fncs)
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_pos_lla( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_builtin_feature( GPS_MODEL_HAS_POS_LLA, &p_xdf->receiver_info );

}  // xdevfeat_has_pos_lla

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_pos_lla;



/*HDR*/
/**
 * @brief Check if the device supports the builtin feature TIME
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else ::MBG_ERR_NOT_SUPP_BY_DEV
 *         or ::MBG_ERR_DEV_NOT_SUPP (see @ref xdevfeat_chk_supp_fncs)
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_time_ttm( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_builtin_feature( GPS_MODEL_HAS_TIME_TTM, &p_xdf->receiver_info );

} // xdevfeat_has_time_ttm



/*HDR*/
/**
 * @brief Check if a device supports the ::MBG_TIME_SCALE_INFO structure and API
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else error code from ::check_ri_feature
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see ::mbgextio_get_time_scale_info
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_time_scale( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_ri_feature( GPS_HAS_TIME_SCALE, &p_xdf->receiver_info );

}  // xdevfeat_has_time_scale

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_time_scale;



/*HDR*/
/**
 * @brief Check if a device supports the ::TZDL structure and API
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else ::MBG_ERR_NOT_SUPP_BY_DEV
 *         or ::MBG_ERR_DEV_NOT_SUPP (see @ref xdevfeat_chk_supp_fncs)
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_tzdl( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_builtin_feature( GPS_MODEL_HAS_TZDL, &p_xdf->receiver_info );

}  // xdevfeat_has_tzdl

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_tzdl;



/*HDR*/
/**
 * @brief Check if a device supports the ::TZCODE API
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else ::MBG_ERR_NOT_SUPP_BY_DEV
 *         or ::MBG_ERR_DEV_NOT_SUPP (see @ref xdevfeat_chk_supp_fncs)
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_tzcode( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_builtin_feature( GPS_MODEL_HAS_TZCODE, &p_xdf->receiver_info );

} // xdevfeat_has_tzcode

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_tzcode;



/*HDR*/
/**
 * @brief Check if a device supports the ::ANT_INFO structure and API
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else ::MBG_ERR_NOT_SUPP_BY_DEV
 *         or ::MBG_ERR_DEV_NOT_SUPP (see @ref xdevfeat_chk_supp_fncs)
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_ant_info( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_builtin_feature( GPS_MODEL_HAS_ANT_INFO, &p_xdf->receiver_info );

}  // xdevfeat_has_ant_info

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_ant_info;



/*HDR*/
/**
 * @brief Check if a device supports the ::ENABLE_FLAGS structure and API
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else ::MBG_ERR_NOT_SUPP_BY_DEV
 *         or ::MBG_ERR_DEV_NOT_SUPP (see @ref xdevfeat_chk_supp_fncs)
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_enable_flags( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_builtin_feature( GPS_MODEL_HAS_ENABLE_FLAGS, &p_xdf->receiver_info );

}  // xdevfeat_has_enable_flags

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_enable_flags;



/*HDR*/
/**
 * @brief Check if a device supports the ::STAT_INFO structure and API
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else ::MBG_ERR_NOT_SUPP_BY_DEV
 *         or ::MBG_ERR_DEV_NOT_SUPP (see @ref xdevfeat_chk_supp_fncs)
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_gps_stat_info( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_builtin_feature( GPS_MODEL_HAS_STAT_INFO, &p_xdf->receiver_info );

}  // xdevfeat_has_gps_stat_info

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_gps_stat_info;



/*HDR*/
/**
 * @brief Check if a device supports the ::ANT_CABLE_LEN structure and API
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else ::MBG_ERR_NOT_SUPP_BY_DEV
 *         or ::MBG_ERR_DEV_NOT_SUPP (see @ref xdevfeat_chk_supp_fncs)
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_ant_cable_length( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_builtin_feature( GPS_MODEL_HAS_ANT_CABLE_LEN, &p_xdf->receiver_info );

}  // xdevfeat_has_ant_cable_length

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_ant_cable_length;



/*HDR*/
/**
 * @brief Check if a device supports the ::IGNORE_LOCK structure and API
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else ::MBG_ERR_NOT_SUPP_BY_DEV
 *         or ::MBG_ERR_DEV_NOT_SUPP (see @ref xdevfeat_chk_supp_fncs)
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_gps_ignore_lock( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_ri_feature( GPS_HAS_IGNORE_LOCK, &p_xdf->receiver_info );

}  // xdevfeat_has_gps_ignore_lock

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_gps_ignore_lock;



#if 0 //### TODO

 /*HDR*/
/**
 * @brief Check if a device supports the :: structure and API
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else ::MBG_ERR_NOT_SUPP_BY_DEV
 *         or ::MBG_ERR_DEV_NOT_SUPP (see @ref xdevfeat_chk_supp_fncs)
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_builtin_feature( GPS_MODEL_HAS_, &p_xdf->receiver_info );

}  // xdevfeat_has_

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_;



 /*HDR*/
/**
 * @brief Check if a device supports the :: structure and API
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else ::MBG_ERR_NOT_SUPP_BY_DEV
 *         or ::MBG_ERR_DEV_NOT_SUPP (see @ref xdevfeat_chk_supp_fncs)
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_builtin_feature( GPS_MODEL_HAS_, &p_xdf->receiver_info );

}  // xdevfeat_has_

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_;

#endif  // ###


/*HDR*/
/**
 * @brief Check if the device supports the SCU_STAT structures
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else ::MBG_ERR_NOT_SUPP_BY_DEV
 *         or ::MBG_ERR_DEV_NOT_SUPP (see @ref xdevfeat_chk_supp_fncs)
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see @ref xdevfeat_chk_supp_fncs
 * @see @ref group_scu
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_scu_stat( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_builtin_feature( GPS_MODEL_HAS_SCU_STAT, &p_xdf->receiver_info );

} // xdevfeat_has_scu_stat

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_scu_stat;


/*HDR*/
/**
 * @brief Check if the device supports the SV_INFO structures
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else ::MBG_ERR_NOT_SUPP_BY_DEV
 *         or ::MBG_ERR_DEV_NOT_SUPP (see @ref xdevfeat_chk_supp_fncs)
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_sv_info( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_builtin_feature( GPS_MODEL_HAS_SV_INFO, &p_xdf->receiver_info );

} // xdevfeat_has_sv_info

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_sv_info;


/*HDR*/
/**
 * @brief Check if a timecode receiver provides ::MBG_RAW_IRIG_DATA
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else error code from ::check_ri_feature
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see ::mbgextio_get_raw_irig_data
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_raw_irig_data( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_ri_feature( GPS_HAS_RAW_IRIG_DATA, &p_xdf->receiver_info );

}  // xdevfeat_has_raw_irig_data

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_raw_irig_data;



/*HDR*/
/**
 * @brief Check if a device supports the old LAN_IP4 API
 *
 * The LAN_IP4 API provides structures and functions to configure
 * parts of the networking of a device and is superseded by the
 * NET_CFG API. Some devices combine NET_CFG and LAN_IP4.
 * Therefore, ::mbgextio_get_all_net_cfg_info should be used
 * preferably to read the network configuration.
 * It will translate the old structures into the new ones.
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else error code from ::check_ri_feature
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see ::mbgextio_get_all_net_cfg_info
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_lan_ip4( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_ri_feature( GPS_HAS_LAN_IP4, &p_xdf->receiver_info );

}  // xdevfeat_has_lan_ip4

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_lan_ip4;



/*HDR*/
/**
 * @brief Check if a device supports the new NET_CFG API
 *
 * The NET_CFG API provides structures and functions to configure
 * the complete networking part of a device and supersedes the
 * LAN_IP4 API. Not all devices support the whole feature set
 * of the NET_CFG API or combine NET_CFG and LAN_IP4.
 * Therefore, ::mbgextio_get_all_net_cfg_info should be used
 * preferably to read the network configuration.
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else error code from ::check_ri_feature
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see ::mbgextio_get_all_net_cfg_info
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_net_cfg( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_ri_feature( GPS_HAS_NET_CFG, &p_xdf->receiver_info );

}  // xdevfeat_has_net_cfg

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_net_cfg;



/*HDR*/
/**
 * @brief Check if a device supports the PTP API
 *
 * The PTP API consists of different calls and associated structures
 * which * have evolved over time. Not all devices support every call,
 * so ::mbgextio_get_all_ptp_cfg_info takes care to check which parts are
 * supported and thus should be used preferably to read PTP information.
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else error code from ::check_ri_feature
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see ::mbgextio_get_all_ptp_cfg_info
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_ptp( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_ri_feature( GPS_HAS_PTP, &p_xdf->receiver_info );

}  // xdevfeat_has_ptp

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_ptp;


/*HDR*/
/**
 * @brief Check if a device supports the NTP API
 *
 * The NTP API consists of different calls and associated structures
 * which have evolved over time. Not all devices support every call,
 * so ::mbgextio_get_all_ntp_cfg_info takes care to check which parts are
 * supported and thus should be used preferably to read NTP information.
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else error code from ::check_ri_feature
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see ::mbgextio_get_all_ntp_cfg_info
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_ntp( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_ri_feature( GPS_HAS_NTP, &p_xdf->receiver_info );

} // xdevfeat_has_ntp

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_ntp;



/*HDR*/
/**
 * @brief Check if a device supports the event log API
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else error code from ::check_ri_feature
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_evt_log( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_ri_feature( GPS_HAS_EVT_LOG, &p_xdf->receiver_info );

} // xdevfeat_has_evt_log

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_evt_log;


/*HDR*/
/**
 * @brief Check if a device supports the user capture API
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else error code from ::check_ri_feature
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_ucap( const MBG_XDEV_FEATURES *p_xdf )
{
  const RECEIVER_INFO *ri = &p_xdf->receiver_info;

  if ( ri->n_ucaps > 0 )
    return MBG_SUCCESS;

  return MBG_ERR_NOT_SUPP_BY_DEV;

} // xdevfeat_has_ucap

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_ucap;


/*HDR*/
/**
 * @brief Check if a device supports the user capture via network feature
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else error code from ::check_xfeature
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see @ref group_ucap_net
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_ucap_net( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_xfeature( MBG_XFEATURE_UCAP_NET, &p_xdf->xfeature_buffer );

} // xdevfeat_has_ucap_net

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_ucap_net;



/*HDR*/
/**
 * @brief Check if a device supports the TLV API
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else error code from ::check_xfeature
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see @ref group_tlv_api
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_tlv_api( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_xfeature( MBG_XFEATURE_TLV_API, &p_xdf->xfeature_buffer );

}  // xdevfeat_has_ptp

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_tlv_api;



/*HDR*/
/**
 * @brief Check if a device supports a firmware update via TLV
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else error code from ::check_tlv_feat_supp
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see ::mbgextio_xmt_fw_update
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_supp_tlv_fw_update( const MBG_XDEV_FEATURES *p_xdf )
{
#if defined( _PRELIMINARY_CODE )
  return check_tlv_feat_supp( MBG_TLV_FEAT_TYPE_FW_UPDATE, &p_xdf->tlv_info );
#else
  return MBG_ERR_NOT_SUPP_BY_DEV;
#endif

}  // xdevfeat_supp_tlv_fw_update

XDEVFEAT_CHK_SUPP_FNC xdevfeat_supp_tlv_fw_update;



/*HDR*/
/**
 * @brief Check if a device supports creating / sending a diagnostics file via TLV
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else error code from ::check_tlv_feat_supp
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see ::TODO  //refer to get diag function
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_supp_tlv_diag_file( const MBG_XDEV_FEATURES *p_xdf )
{
#if defined( _PRELIMINARY_CODE )
  return check_tlv_feat_supp( MBG_TLV_FEAT_TYPE_DIAG_FILE, &p_xdf->tlv_info );
#else
  return MBG_ERR_NOT_SUPP_BY_DEV;
#endif

}  // xdevfeat_supp_tlv_diag_file

XDEVFEAT_CHK_SUPP_FNC xdevfeat_supp_tlv_diag_file;



/*HDR*/
/**
 * @brief Check if a device supports PTPv2 license infos
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else error code from ::check_tlv_feat_supp
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_supp_tlv_ptpv2_license( const MBG_XDEV_FEATURES *p_xdf )
{
#if defined( _PRELIMINARY_CODE )
  return check_tlv_feat_supp( MBG_TLV_FEAT_TYPE_LICENSE_PTPV2_IDX, &p_xdf->tlv_info );
#else
  return MBG_ERR_NOT_SUPP_BY_DEV;
#endif

}  // xdevfeat_supp_tlv_ptpv2_license

XDEVFEAT_CHK_SUPP_FNC xdevfeat_supp_tlv_ptpv2_license;



/*HDR*/
/**
 * @brief Check if a device supports NTP license infos via TLV
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else error code from ::check_tlv_feat_supp
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_supp_tlv_ntp_license( const MBG_XDEV_FEATURES *p_xdf )
{
#if defined( _PRELIMINARY_CODE )
  return check_tlv_feat_supp( MBG_TLV_FEAT_TYPE_LICENSE_NTP_IDX, &p_xdf->tlv_info );
#else
  return MBG_ERR_NOT_SUPP_BY_DEV;
#endif

}  // xdevfeat_supp_tlv_ntp_license

XDEVFEAT_CHK_SUPP_FNC xdevfeat_supp_tlv_ntp_license;



/*HDR*/
/**
 * @brief Check if a device supports PTPv1 License Infos via TLV
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else error code from ::check_tlv_feat_supp
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_supp_tlv_ptpv1_license( const MBG_XDEV_FEATURES *p_xdf )
{
#if defined( _PRELIMINARY_CODE )
  return check_tlv_feat_supp( MBG_TLV_FEAT_TYPE_LICENSE_PTPV1_IDX, &p_xdf->tlv_info );
#else
  return MBG_ERR_NOT_SUPP_BY_DEV;
#endif

}  // xdevfeat_supp_tlv_ptpv1_license

XDEVFEAT_CHK_SUPP_FNC xdevfeat_supp_tlv_ptpv1_license;



/*HDR*/
/**
 * @brief Check if a device supports Time Monitor License infos via TLV
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else error code from ::check_tlv_feat_supp
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_supp_tlv_time_monitor_license( const MBG_XDEV_FEATURES *p_xdf )
{
#if defined( _PRELIMINARY_CODE )
  return check_tlv_feat_supp( MBG_TLV_FEAT_TYPE_LICENSE_TIME_MONITOR_IDX, &p_xdf->tlv_info );
#else
  return MBG_ERR_NOT_SUPP_BY_DEV;
#endif

}  // xdevfeat_supp_tlv_time_monitor_license

XDEVFEAT_CHK_SUPP_FNC xdevfeat_supp_tlv_time_monitor_license;



/*HDR*/
/**
 * @brief Check if a device supports the ::GPS_SAVE_CFG command
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else error code from ::check_xfeature
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see ::mbgextio_cmd_save_cfg
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_cmd_save_cfg( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_xfeature( MBG_XFEATURE_SAVE_CFG, &p_xdf->xfeature_buffer );

}  // xdevfeat_has_cmd_save_cfg

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_cmd_save_cfg;



/*HDR*/
/**
 * @brief Check if a device supports the extended feature monitoring
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else error code from ::check_xfeature
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_monitoring( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_xfeature( MBG_XFEATURE_MONITORING, &p_xdf->xfeature_buffer );

}  // xdevfeat_has_monitoring

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_monitoring;



/*HDR*/
/**
 * @brief Check if a device supports the LED API
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else error code from ::check_xfeature
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see ::TODO ###
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_led_api( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_xfeature( MBG_XFEATURE_LED_API, &p_xdf->xfeature_buffer );

}  // xdevfeat_has_led_api

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_led_api;



/*HDR*/
/**
 * @brief Check if a device supports the LNE API
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else error code from ::check_xfeature
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see ::TODO ###
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_lne_api( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_xfeature( MBG_XFEATURE_LNE_API, &p_xdf->xfeature_buffer );

}  // xdevfeat_has_lne_api

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_lne_api;



/*HDR*/
/**
 * @brief Check if a device supports the power control API
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else error code from ::check_xfeature
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see ::TODO ###
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_pwr_ctl_api( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_xfeature( MBG_XFEATURE_PWR_CTL_API, &p_xdf->xfeature_buffer );

}  // xdevfeat_has_pwr_ctl_api

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_pwr_ctl_api;



/*HDR*/
/**
 * @brief Check if a device supports the ::MBG_EXT_SYS_INFO command
 *
 * @param[in,out] p_xdf  Pointer to a valid message control structure
 *
 * @return ::MBG_SUCCESS if supported, else error code from ::check_xfeature
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see ::TODO ###
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_ext_sys_info( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_xfeature( MBG_XFEATURE_EXT_SYS_INFO, &p_xdf->xfeature_buffer );

}  // xdevfeat_has_ext_sys_info

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_ext_sys_info;



/*HDR*/
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_io_ports( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_xfeature( MBG_XFEATURE_IO_PORTS, &p_xdf->xfeature_buffer );

}  // xdevfeat_has_io_ports

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_io_ports;



/*HDR*/
/**
 * @brief Check if a device has ::MBG_XFEATURE_TRANSACTIONS
 *
 * @param[in,out] p_xdf  Pointer to a valid message control structure
 *
 * @return ::MBG_SUCCESS if supported, else error code from ::check_xfeature
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see ::TODO ###
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_transactions( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_xfeature( MBG_XFEATURE_TRANSACTIONS, &p_xdf->xfeature_buffer );

}  // xdevfeat_has_transactions

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_transactions;



/*HDR*/
/**
 * @brief Check if a device has ::MBG_XFEATURE_REBOOT
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else error code from ::check_xfeature
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_reboot( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_xfeature( MBG_XFEATURE_REBOOT, &p_xdf->xfeature_buffer );

}  // xdevfeat_has_reboot

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_reboot;



/*HDR*/
/**
 * @brief Check if a device has ::MBG_XFEATURE_REQ_TTM
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else error code from ::check_xfeature
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see @ref xdevfeat_chk_supp_fncs
 * @see mbgextio_get_time
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_req_ttm( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_xfeature( MBG_XFEATURE_REQ_TTM, &p_xdf->xfeature_buffer );

} // xdevfeat_has_req_ttm

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_req_ttm;



/*HDR*/
/**
 * @brief Check if a device supports the extended multi ref features including multi instances
 *
 * The different multi ref feature and its appropriate flags have evolved over time.
 * This function only checks the currently up-to-date GPS_HAS_XMRS_MULT_INSTC flag.
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else error code from ::check_ri_feature
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see ::mbgextio_get_all_xmulti_ref_info
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_xmulti_ref( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_ri_feature( GPS_HAS_XMRS_MULT_INSTC, &p_xdf->receiver_info );

}  // xdevfeat_has_xmulti_ref

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_xmulti_ref;



/*HDR*/
/**
 * @brief Check if a device supports the extended binary protocol (XBP) feature
 *
 * @param[in,out] p_xdf  Pointer to a ::MBG_XDEV_FEATURES buffer associated with the device
 *
 * @return ::MBG_SUCCESS if supported, else error code from ::check_ri_feature
 *
 * @ingroup xdevfeat_chk_supp_fncs
 * @see @ref xdevfeat_chk_supp_fncs
 */
_NO_MBG_API_ATTR int _NO_MBG_API xdevfeat_has_xbp( const MBG_XDEV_FEATURES *p_xdf )
{
  return check_ri_feature( GPS_HAS_XBP, &p_xdf->receiver_info );

}  // xdevfeat_has_xbp

XDEVFEAT_CHK_SUPP_FNC xdevfeat_has_xbp;