mbgtools-lx  4.2.8
cfg_hlp.c
Go to the documentation of this file.
1 
2 /**************************************************************************
3  *
4  * $Id: cfg_hlp.c 1.4 2018/09/19 16:55:08 martin REL_M $
5  *
6  * Copyright (c) Meinberg Funkuhren, Bad Pyrmont, Germany
7  *
8  * Description:
9  * Meinberg device configuration helper functions.
10  *
11  * -----------------------------------------------------------------------
12  * $Log: cfg_hlp.c $
13  * Revision 1.4 2018/09/19 16:55:08 martin
14  * Account for renamed global variables.
15  * Revision 1.3 2018/07/05 10:28:07Z martin
16  * Renamed setup_port_info_from_port_settings()
17  * to setup_port_info_from_port_parm().
18  * Added function chk_dev_receiver_info().
19  * Function free_all_firmware_info() added by thomas-b.
20  * Syslog option added to monitoring feature by philipp.
21  * I/O helper structures and API refuctored by philipp.
22  * Service feature and API added by philipp.
23  * Database feature support added by philipp.
24  * Function to free ALL_USER_INFO structure added by thomas-b.
25  * MBG_EVENT stuff integrated with common/general monitoring
26  * stuff by philipp.
27  * Monitoring events refactored and tainted config support
28  * added by philipp.
29  * Account for renamed library symbol NSEC_PER_SEC.
30  * Documented some conversion functions for legacy parameters.
31  * Doxygen fixes.
32  * Revision 1.2 2017/07/05 12:17:38 martin
33  * Support functions for TLV, IMS, GPIO, and
34  * mbg_snprint_revision() provided by philipp.
35  * Support functions for network configuration,
36  * NTP configuration, ALL_UCAP stuff, SNMP and
37  * MONITORING, as well as ALL_PTP_V2_COMMON_DATASETS
38  * and ALL_PTP_V1_COMMON_DATASETS provided by thomas-b.
39  * Support functions for xmulti_ref and IO PORT stuff
40  * provided by philipp and thomas-b.
41  * More common GNSS support.
42  * New functions alloc_dev_hw_id() and chk_free_dev_hw_id().
43  * Tried portable printing of int64_t types.
44  * Account for frac_sec_from_bin() obsoleted by
45  * bin_frac_32_to_dec_frac().
46  * Revision 1.1 2014/04/25 09:14:49 martin
47  * Initial revision.
48  *
49  **************************************************************************/
50 
51 #define _CFG_HLP
52  #include <cfg_hlp.h>
53 #undef _CFG_HLP
54 
55 #include <mbgerror.h>
56 #include <timeutil.h>
57 #include <str_util.h>
58 #include <myutil.h>
59 #include <mbgtime.h>
60 
61 #if defined( _PRELIMINARY_CODE )
62  #include <mbgmktm.h>
63 #endif
64 
65 #include <stdio.h>
66 #include <stdlib.h>
67 #include <string.h>
68 #include <time.h>
69 
70 
71 
72 /*HDR*/
90 {
91  if ( verbose > 1 ) // more than just verbose
92  return 1; // just return raw string
93 
94  trim_whitespace( p->name );
95 
96  // Some firmware versions have "CC_STANDARD" in their standard version,
97  // which doesn't provide any valuable information.
98  // We discard this by default.
99  if ( strstr( p->name, "CC_STANDARD" ) )
100  p->name[0] = 0;
101 
102  if ( verbose )
103  return 1; // calling app should display string, even if empty
104 
105  // calling app should display string only if not empty
106  return strlen( p->name ) != 0;
107 
108 } // chk_sw_rev_name
109 
110 
111 
112 /*HDR*/
113 int get_str_idx( const char *search,
114  const char *str_table[],
115  int n_entries )
116 {
117  int i;
118 
119  for ( i = 0; i < n_entries; i++ )
120  if ( strcmp( search, str_table[i] ) == 0 )
121  return i;
122 
123  return -1;
124 
125 } // get_str_idx
126 
127 
128 
129 /*HDR*/
130 int get_baud_rate_idx( BAUD_RATE baud_rate )
131 {
132  int i;
133 
134  for ( i = 0; i < N_MBG_BAUD_RATES; i++ )
135  if ( baud_rate == mbg_baud_rates[i] )
136  return i;
137 
138  return -1;
139 
140 } // get_baud_rate_idx
141 
142 
143 
144 /*HDR*/
145 int get_framing_idx( const char *framing )
146 {
147  return get_str_idx( framing, mbg_framing_strs, N_MBG_FRAMINGS );
148 
149 } // get_framing_idx
150 
151 
152 
153 /*HDR*/
171  int cap_str_idx )
172 {
173  if ( pp_mode >= LGCY_STR_UCAP )
174  {
175  // If @p pp_mode is ::LGCY_STR_UCAP or greater
176  // then the string is a capture string which
177  // can have the mode ::STR_AUTO or ::STR_ON_REQ,
178  // and the string type is a capture string, which
179  // usually has index 1 for legacy devices.
180  p_ps->str_type = cap_str_idx;
181  p_ps->mode = ( pp_mode == LGCY_STR_UCAP ) ? STR_AUTO : STR_ON_REQ;
182  }
183  else
184  {
185  // If @p pp_mode is less than ::LGCY_STR_UCAP
186  // then the string is the default time string,
187  // the format of which depends on the firmware
188  // version if the device is legacy.
189  // The mode numbers are compatible in this case.
190  p_ps->str_type = 0;
191  p_ps->mode = pp_mode;
192  }
193 
194 } // port_settings_from_port_parm_mode
195 
196 
197 
198 /*HDR*/
214  int cap_str_idx )
215 {
216  if ( p_ps->str_type == cap_str_idx )
217  {
218  // If the string type is a capture string
219  // then convert the mode accordingly.
220  *pp_mode = ( p_ps->mode == STR_ON_REQ ) ? LGCY_STR_UCAP_REQ : LGCY_STR_UCAP;
221  }
222  else
223  {
224  // Other string modes are compatible, so just copy the mode.
225  *pp_mode = p_ps->mode;
226  }
227 
228 } // port_parm_mode_from_port_settings
229 
230 
231 
232 /*HDR*/
245 void port_settings_from_port_parm( PORT_SETTINGS *p_ps, int port_idx,
246  const PORT_PARM *p_pp, int cap_str_idx )
247 {
248  // The basic serial settings can simply be copied.
249  p_ps->parm = p_pp->com[port_idx];
250 
251  // The string mode may need to be translated.
252  port_settings_from_port_parm_mode( p_ps, p_pp->mode[port_idx],
253  cap_str_idx );
254 
255 } // port_info_from_port_parm
256 
257 
258 
259 /*HDR*/
272 void port_parm_from_port_settings( PORT_PARM *p_pp, int port_idx,
273  const PORT_SETTINGS *p_ps, int cap_str_idx )
274 {
275  // The basic serial settings can simply be copied.
276  p_pp->com[port_idx] = p_ps->parm;
277 
278  // The string mode may need to be translated.
279  port_parm_mode_from_port_settings( &p_pp->mode[port_idx],
280  p_ps, cap_str_idx );
281 
282 } // port_parm_from_port_settings
283 
284 
285 
286 /*HDR*/
287 uint32_t check_valid_port_info( const PORT_INFO *p_pi,
288  const STR_TYPE_INFO_IDX str_type_info_idx[],
289  int n_str_type )
290 {
291  const PORT_SETTINGS *p_ps = &p_pi->port_settings;
292  int idx;
293  uint32_t flags = 0;
294 
295 
296  if ( p_pi->supp_baud_rates & ~_mask( N_MBG_BAUD_RATES ) )
297  flags |= MBG_PS_MSK_BAUD_RATE_OVR_SW; // dev. supports more baud rates than driver
298 
299  idx = get_baud_rate_idx( p_ps->parm.baud_rate );
300 
301  if ( !_inrange( idx, 0, N_MBG_BAUD_RATES ) ||
302  !_is_supported( idx, p_pi->supp_baud_rates ) )
303  flags |= MBG_PS_MSK_BAUD_RATE;
304 
305 
306  if ( p_pi->supp_framings & ~_mask( N_MBG_FRAMINGS ) )
307  flags |= MBG_PS_MSK_FRAMING_OVR_SW; // dev. supports more framings than driver
308 
309  idx = get_framing_idx( p_ps->parm.framing );
310 
311  if ( !_inrange( idx, 0, N_MBG_FRAMINGS ) ||
312  !_is_supported( idx, p_pi->supp_framings ) )
313  flags |= MBG_PS_MSK_FRAMING;
314 
315 
316  if ( p_ps->parm.handshake >= N_COM_HS )
317  flags |= MBG_PS_MSK_HS_OVR_SW; // handshake index exceeds max.
318 
319  if ( p_ps->parm.handshake != HS_NONE ) // currently no device supports any handshake
320  flags |= MBG_PS_MSK_HS; // handshake mode not supp. by dev.
321 
322 
323  if ( p_pi->supp_str_types & ~_mask( n_str_type ) )
324  flags |= MBG_PS_MSK_STR_TYPE_OVR_SW; // firmware error: more string types supported than reported
325 
326  idx = p_ps->str_type;
327 
328  if ( idx >= n_str_type )
329  flags |= MBG_PS_MSK_STR_TYPE_OVR_DEV; // string type index exceeds max.
330  else
331  {
332  if ( !_is_supported( idx, p_pi->supp_str_types ) )
333  flags |= MBG_PS_MSK_STR_TYPE; // string type not supported by this port
334  else
335  {
336  // Use the str_type index to get the supported output mode mask
337  // from the string type info table. This is required to check
338  // whether the selected mode is supported by the selected
339  // string type.
340  ulong supp_modes = str_type_info_idx[idx].str_type_info.supp_modes;
341 
342  if ( supp_modes & ~_mask( N_STR_MODE ) )
343  flags |= MBG_PS_MSK_STR_MODE_OVR_SW; // dev. supports more string modes than driver
344 
345  idx = p_ps->mode;
346 
347  if ( idx >= N_STR_MODE ) // mode is always >= 0
348  flags |= MBG_PS_MSK_STR_MODE_OVR_SW; // string mode index exceeds max.
349  else
350  if ( !_is_supported( idx, supp_modes ) )
351  flags |= MBG_PS_MSK_STR_MODE; // string mode not supp. by this string type and port
352  }
353  }
354 
355 
356  if ( p_ps->flags != 0 ) /* currently always 0 */
358 
359 
360  return flags;
361 
362 } // check_valid_port_info
363 
364 
365 
366 /*HDR*/
367 int valid_port_info( const PORT_INFO *p_pi,
368  const STR_TYPE_INFO_IDX str_type_info_idx[],
369  int n_str_type )
370 {
371  return check_valid_port_info( p_pi, str_type_info_idx, n_str_type ) == 0;
372 
373 } // valid_port_info
374 
375 
376 
377 /*HDR*/
398  const RECEIVER_INFO *p_ri )
399 {
400  int i;
401 
402  for ( i = 0; i < p_ri->n_com_ports; i++ )
403  {
404  PORT_INFO_IDX *p_pii = &pii[i];
405  PORT_INFO *p_pi = &p_pii->port_info;
406 
407  p_pii->idx = i;
408  port_settings_from_port_parm( &p_pi->port_settings, i, p_pp, 1 );
409 
413  }
414 
415  return MBG_SUCCESS;
416 
417 } // setup_port_info_from_port_parm
418 
419 
420 
421 /*HDR*/
423 {
424  int i;
425 
426  for ( i = 0; i < p_ri->n_str_type; i++ )
427  {
428  STR_TYPE_INFO_IDX *stip = &stii[i];
429  stip->idx = i;
431  }
432 
433  return MBG_SUCCESS;
434 
435 } // setup_default_str_type_info_idx
436 
437 
438 
439 /*HDR*/
441 {
443 
444  if ( p_agi->n_gnss_supp > N_GNSS_TYPES )
446 
447  return MBG_SUCCESS;
448 
449 } // chk_set_n_gnss_supp
450 
451 
452 
453 /*HDR*/
460 {
461  STAT_INFO *p_si = &p_agi->stat_info;
463  GNSS_SAT_INFO *p_gsi = &p_gsii->gnss_sat_info;
464 
465  memset( p_gsii, 0, sizeof( *p_gsii ) );
466  p_gsii->idx = GNSS_TYPE_GPS;
467 
468  p_gsi->gnss_type = GNSS_TYPE_GPS;
469  p_gsi->svs_in_view = p_si->svs_in_view;
470  p_gsi->good_svs = p_si->good_svs;
471 
472 } // setup_gps_only_sat_info_idx_from_statinfo
473 
474 
475 
476 /*HDR*/
483 {
484  MBG_GNSS_MODE_INFO *p_gmi = &p_agi->gnss_mode_info;
485 
486  memset( p_gmi, 0, sizeof( *p_gmi ) );
487 
489  p_gmi->settings.gnss_set = p_gmi->supp_gnss_types;
490 
491  memset( p_agi->gnss_sat_info_idx, 0, sizeof( p_agi->gnss_sat_info_idx ) );
492 
494 
495  return chk_set_n_gnss_supp( p_agi );
496 
497 } // setup_gps_only_gnss_info_from_statinfo
498 
499 
500 
501 /*HDR*/
503 {
504  if ( p->hw_id )
505  {
506  free( p->hw_id );
507  p->hw_id = NULL;
508  }
509 
510 } // chk_free_dev_hw_id
511 
512 
513 
514 /*HDR*/
515 int alloc_dev_hw_id( DEVICE_INFO *p, size_t len )
516 {
517  if ( p->hw_id )
518  return MBG_ERR_ALREADY_ALLOC;
519 
520 
521  p->hw_id = (char *) malloc( len );
522 
523  if ( p->hw_id == NULL )
524  return MBG_ERR_NO_MEM;
525 
526  return MBG_SUCCESS;
527 
528 } // alloc_dev_hw_id
529 
530 
531 
532 /*HDR*/
533 const char *get_fw_id_from_hw_id( const char *hw_id )
534 {
535  int i;
536 
537  for ( i = 0; i < N_SUPP_DEV_TOTAL; i++ )
538  {
539  DEVICE_INFO *p = &device_list[i];
540 
541  if ( strlen( p->fw_id ) && p->hw_id ) //### TODO check if this still works as expected
542  {
543  if ( strcmp( hw_id, p->hw_id ) == 0 )
544  {
545  if ( strlen( p->fw_id ) > 0 )
546  return p->fw_id;
547 
548  #if defined( DEBUG )
549  fprintf( stderr, "Length of fw_id is 0 in %s for device %i (%s)\n",
550  __func__, i, p->hw_id );
551  #endif
552  }
553  }
554  }
555 
556  return NULL;
557 
558 } // get_fw_id_from_hw_id
559 
560 
561 
562 /*HDR*/
563 const char *get_hw_id_from_fw_id( const char *fw_id )
564 {
565  int i;
566 
567  for ( i = 0; i < N_SUPP_DEV_TOTAL; i++ )
568  {
569  DEVICE_INFO *p = &device_list[i];
570 
571  if ( strlen( p->fw_id ) && p->hw_id ) //### TODO check if this still works as expected
572  {
573  if ( strcmp( fw_id, p->fw_id ) == 0 )
574  {
575  if ( strlen( p->hw_id ) > 0 )
576  return p->hw_id;
577 
578  #if defined( DEBUG )
579  fprintf( stderr, "Length of hw_id is 0 in %s for device %i (%s)\n",
580  __func__, i, p->fw_id );
581  #endif
582  }
583  }
584  }
585 
586  return NULL;
587 
588 } // get_hw_id_from_fw_id
589 
590 
591 
592 /*HDR*/
602  uint16_t port_type )
603 {
604  unsigned i;
606 
607  if ( !port )
608  return NULL;
609 
610  for ( i = 0; i < port->p_info.num_types; ++i )
611  {
612  pti = &port->pt_infos[i];
613 
614  if ( pti->port_type == port_type )
615  {
616  if ( pti->port_type == MBG_IO_PORT_TYPE_GPIO )
617  {
618  if ( pti->data.gpio_limits.type == port->setts->data.gpio_settings.type )
619  return pti;
620  }
621  else
622  return pti;
623  }
624  }
625 
626  return NULL;
627 
628 } // get_io_port_type_info
629 
630 
631 
632 /*HDR*/
643  MBG_TLV_TYPE tlv_feat_type, uint32_t total_bytes )
644 {
645  memset( tlv, 0, sizeof( *tlv ) );
646  tlv->data.uid = uid;
647  tlv->data.type = tlv_feat_type;
648  tlv->data.total_bytes = total_bytes;
649  tlv->data.reserved_1 = 0;
650  tlv->reserved_1 = 0;
651  tlv->reserved_2 = 0;
652 
653 } // mbg_tlv_announce_init
654 
655 
656 
657 /*HDR*/
669  MBG_TLV_TYPE tlv_type, uint32_t total_bytes )
670 {
671  memset( tlv, 0, sizeof( *tlv ) );
672  tlv->hdr.uid = uid;
673  tlv->hdr.tlv_type = tlv_type;
674  tlv->hdr.cur_bytes = 0;
675  tlv->hdr.trans_bytes = 0;
676  tlv->hdr.total_bytes = total_bytes;
677  tlv->hdr.reserved_1 = 0;
678  tlv->hdr.reserved_2 = 0;
679  tlv->hdr.reserved_3 = 0;
680 
681 } // mbg_tlv_init
682 
683 
684 
685 /*HDR*/
695 void mbg_tlv_rcv_state_init( MBG_TLV_RCV_STATE *state, MBG_TLV_UID uid, uint32_t total_bytes )
696 {
697  state->data.uid = uid;
698  state->data.type = 0;
699  state->data.total_bytes = total_bytes;
700  state->data.reserved_1 = 0;
701  state->read_bytes = 0;
702  state->reserved_1 = 0;
703 
704 } // mbg_tlv_state_init
705 
706 
707 
708 /*HDR*/
709 int mbg_snprint_revision( char *buf, size_t buflen,
710  const char *prefix, const char *suffix,
711  uint32_t rev)
712 {
713  size_t bytes = 0;
714  uint32_t major, minor, patch;
715 
716  if ( prefix )
717  bytes += snprintf_safe( &buf[bytes], buflen, "%s", prefix );
718 
719  _mbg_decode_revision( rev, major, minor, patch );
720  bytes += snprintf_safe( &buf[bytes], buflen - bytes, "%u.%u.%u",
721  major, minor, patch);
722 
723  if ( suffix )
724  bytes += snprintf_safe( &buf[bytes], buflen - bytes, "%s", suffix );
725 
726  return _int_from_size_t( bytes );
727 
728 } // mbg_snprint_revision
729 
730 
731 
732 /*HDR*/
734 {
735  // Make sure this program supports at least as many serial ports
736  // as the current device.
737  if ( p->n_com_ports > MAX_PARM_PORT )
739 
740  // Make sure this program supports at least as many string types
741  // as the current device.
742  if ( p->n_str_type > MAX_PARM_STR_TYPE )
744 
745  // Make sure this program supports at least as many programmable
746  // outputs as the current device.
747  if ( p->n_prg_out > MAX_PARM_POUT )
749 
750  return MBG_SUCCESS;
751 
752 } // chk_dev_receiver_info
753 
754 
755 
756 /*HDR*/
758 {
759  if ( info )
760  {
762  return MBG_SUCCESS;
763 
765  }
766 
767  return MBG_ERR_INV_PARM;
768 
769 } // chk_dev_xbp_supp_nodes
770 
771 
772 
773 /*HDR*/
775 {
777  return MBG_SUCCESS;
778 
780 
781 } // chk_dev_net_cfg_supp_stage_2
782 
783 
784 
785 /*HDR*/
787 {
790  return MBG_SUCCESS;
791 
793 
794 } // chk_dev_ntp_supp_client
795 
796 
797 /*HDR*/
799 {
802  return MBG_SUCCESS;
803 
805 
806 } // chk_dev_ntp_supp_server
807 
808 
809 /*HDR*/
811 {
813  return MBG_SUCCESS;
814 
816 
817 } // chk_dev_xmulti_ref_supp_mrf_none
818 
819 
820 /*HDR*/
822 {
824  return MBG_SUCCESS;
825 
827 
828 } // chk_dev_xmulti_ref_supp_ext_src_info
829 
830 
831 /*HDR*/
833 {
835  return MBG_SUCCESS;
836 
838 
839 } // chk_dev_xmulti_ref_supp_holdover_status
840 
841 
842 /*HDR*/
843 /*
844  * Type is NOT an index of ::XMULTI_REF_INSTANCES::n_xmr_settings,
845  * but of ::MULTI_REF_TYPES.
846  * Depends on chk_dev_supp_xmulti_ref_ext_src_info.
847  * @see chk_dev_supp_xmulti_ref_ext_src_info
848  */
850 {
851  if (
852  ( type < N_MULTI_REF ) &&
853  (( info->ext_src_infos[type].info.feat_flags & XMR_EXT_SRC_FEAT_FLAG_MSK_STATS ) == XMR_EXT_SRC_FEAT_FLAG_MSK_STATS )
854  ) return MBG_SUCCESS;
855 
857 
858 } // chk_dev_xmulti_ref_supp_ext_source_stats
859 
860 
861 /*HDR*/
862 /*
863  * Type is NOT an index of ::XMULTI_REF_INSTANCES::n_xmr_settings,
864  * but of ::MULTI_REF_TYPES.
865  * Depends on chk_dev_supp_xmulti_ref_ext_src_info.
866  * @see chk_dev_supp_xmulti_ref_ext_src_info
867  */
869 {
870  if (
871  ( type < N_MULTI_REF ) &&
872  (( info->ext_src_infos[type].info.feat_flags & XMR_EXT_SRC_FEAT_FLAG_MSK_METRICS ) == XMR_EXT_SRC_FEAT_FLAG_MSK_METRICS )
873  ) return MBG_SUCCESS;
874 
876 
877 } // chk_dev_xmulti_ref_supp_ext_source_metrics
878 
879 
880 /*HDR*/
882 {
884  return MBG_SUCCESS;
885 
887 
888 } // chk_dev_ims_has_fdm
889 
890 
891 /*HDR*/
893 {
894  const MBG_IMS_SENSOR_STATE *sstate = &ims_state->sensor_state_idx[idx].state;
895 
896  if (
897  ( sstate->type == MBG_IMS_SENSOR_VOLTAGE ) &&
899  ) return MBG_SUCCESS;
900 
902 
903 } // chk_dev_ims_is_volt_out_enabled
904 
905 
906 /*HDR*/
908 {
909  const MBG_IMS_SENSOR_STATE *sstate = &ims_state->sensor_state_idx[idx].state;
910 
911  if (
912  ( sstate->type == MBG_IMS_SENSOR_VOLTAGE ) &&
914  ) return MBG_SUCCESS;
915 
917 
918 } // chk_dev_ims_is_volt_out_overload
919 
920 
921 /*HDR*/
923 {
924  const MBG_IMS_SENSOR_STATE *sstate = &ims_state->sensor_state_idx[idx].state;
925 
926  if (
927  ( sstate->type == MBG_IMS_SENSOR_PLL ) &&
929  ) return MBG_SUCCESS;
930 
932 
933 } // chk_dev_ims_is_pll_locked
934 
935 
936 /*HDR*/
938 {
939  const MBG_GPIO_LIMITS *limits = &gpio_info->infos[idx].info.limits;
940 
942  return MBG_SUCCESS;
943 
945 
946 } // chk_dev_gpio_supp_ass_idx
947 
948 
949 /*HDR*/
951 {
952  const MBG_GPIO_SETTINGS *settings = &gpio_info->infos[idx].info.settings;
953 
955  return MBG_SUCCESS;
956 
958 
959 } // chk_dev_gpio_dep_on_ass_idx
960 
961 
962 /*HDR*/
975 {
977  return MBG_SUCCESS;
978 
980 
981 } // chk_dev_gpio_has_status
982 
983 
984 
985 /*HDR*/
994 {
995  if ( p )
996  {
997  if ( p->node_limits )
998  free( p->node_limits );
999 
1000  if ( p->node_infos )
1001  free( p->node_infos );
1002 
1003  free( p );
1004  }
1005 
1006 } // free_all_xbp_info
1007 
1008 
1009 
1010 /*HDR*/
1019 {
1020  if ( p )
1021  {
1022  if ( p->link_infos )
1023  free( p->link_infos );
1024 
1025  if ( p->addr_infos )
1026  free( p->addr_infos );
1027 
1028  if ( p->dns_srvrs )
1029  free( p->dns_srvrs );
1030 
1031  if ( p->dns_srch_doms )
1032  free( p->dns_srch_doms );
1033 
1034  if ( p->route_infos )
1035  free( p->route_infos );
1036 
1037  free( p );
1038  }
1039 
1040 } // free_all_net_cfg_info
1041 
1042 
1043 
1044 /*HDR*/
1053 {
1054  if ( p )
1055  {
1056  if ( p->link_infos )
1057  free( p->link_infos );
1058 
1059  if ( p->addr_infos )
1060  free( p->addr_infos );
1061 
1062  if ( p->dns_srvrs )
1063  free( p->dns_srvrs );
1064 
1065  if ( p->dns_srch_doms )
1066  free( p->dns_srch_doms );
1067 
1068  if ( p->route_infos )
1069  free( p->route_infos );
1070 
1071  free( p );
1072  }
1073 
1074 } // free_all_net_status_info
1075 
1076 
1077 
1078 /*HDR*/
1085 {
1086  if ( p )
1087  {
1088  if ( p->v12_infos )
1089  free( p->v12_infos );
1090 
1091  if ( p->v12_trap_infos )
1092  free( p->v12_trap_infos );
1093 
1094  if ( p->v3_infos )
1095  free( p->v3_infos );
1096 
1097  if ( p->v3_trap_infos )
1098  free( p->v3_trap_infos );
1099 
1100  free( p );
1101  }
1102 
1103 } // free_all_snmp_info
1104 
1105 
1106 
1107 /*HDR*/
1114 {
1115  if ( p )
1116  {
1117  if ( p->servers )
1118  {
1119  unsigned i;
1120  MBG_SYSLOG_SERVER *srv;
1121 
1122  for (i = 0; i < p->glb_info.settings.num_servers; ++i)
1123  {
1124  srv = &p->servers[i];
1125 
1126  if ( srv->release_priv )
1127  srv->release_priv( srv );
1128  }
1129 
1130  free( p->servers );
1131  }
1132 
1133  free( p );
1134  }
1135 
1136 } // free_all_syslog_info
1137 
1138 
1139 
1140 /*HDR*/
1147 {
1148  if ( p )
1149  {
1150  if ( p->all_snmp_info )
1152 
1153  if ( p->all_events )
1155 
1156  if ( p->all_syslog_info )
1158 
1159  free ( p );
1160  }
1161 }
1162 
1163 
1164 /*HDR*/
1171 {
1172  if ( p )
1173  {
1174  if ( p->events )
1175  {
1176  unsigned i;
1177  MBG_EVENT *evt;
1178 
1179  for (i = 0; i < p->num_events; ++i)
1180  {
1181  evt = &p->events[i];
1182 
1183  if ( evt->release_priv )
1184  evt->release_priv( evt );
1185 
1186  if ( evt->release_backref )
1187  evt->release_backref( evt );
1188 
1189  if ( evt->dict_entries )
1190  free ( evt->dict_entries );
1191  }
1192 
1193  free( p->events );
1194  }
1195 
1196  free ( p );
1197  }
1198 }
1199 
1200 
1201 /*HDR*/
1211 {
1212  if ( p )
1213  {
1214  if ( p->infos )
1215  free( p->infos );
1216 
1217  if ( p->ext_src_infos )
1218  free( p->ext_src_infos );
1219 
1220  free ( p );
1221  }
1222 
1223 } // free_all_xmulti_ref_info
1224 
1225 
1226 
1227 /*HDR*/
1237 {
1238  if ( p )
1239  {
1240  if ( p->status )
1241  free( p->status );
1242 
1243  if ( p->holdover_status )
1244  free( p->holdover_status );
1245 
1246  if ( p->stats_idx )
1247  free( p->stats_idx );
1248 
1249  if ( p->metrics_idx )
1250  free( p->metrics_idx );
1251 
1252  free( p );
1253  }
1254 
1255 } // free_all_xmulti_ref_status
1256 
1257 
1258 
1259 /*HDR*/
1268 {
1269  if ( p )
1270  {
1271  if ( p->port_datasets )
1272  free( p->port_datasets );
1273 
1274  free( p );
1275  }
1276 
1277 } // free_all_ptp_v1_common_datasets
1278 
1279 
1280 
1281 /*HDR*/
1290 {
1291  if ( p )
1292  {
1293  if ( p->port_datasets )
1294  free( p->port_datasets );
1295 
1296  free( p );
1297  }
1298 
1299 } // free_all_ptp_v2_common_datasets
1300 
1301 
1302 
1303 /*HDR*/
1312 {
1313  if ( p )
1314  {
1315  if ( p->symm_key_limits )
1316  free( p->symm_key_limits );
1317 
1318  if ( p->symm_key_info_idx )
1319  free( p->symm_key_info_idx );
1320 
1321  if ( p->trusted_key_info_idx )
1322  free( p->trusted_key_info_idx );
1323 
1324  if ( p->clnt_info )
1325  free( p->clnt_info );
1326 
1327  if ( p->peer_settings_idx )
1328  free( p->peer_settings_idx );
1329 
1330  if ( p->srv_info )
1331  free( p->srv_info );
1332 
1333  if ( p->refclk_info_idx )
1334  free( p->refclk_info_idx );
1335 
1336  if ( p->misc_limits )
1337  free( p->misc_limits );
1338 
1339  if ( p->orphan_mode_info )
1340  free( p->orphan_mode_info );
1341 
1342  free( p );
1343  }
1344 
1345 } // free_all_ntp_cfg_info
1346 
1347 
1348 
1349 /*HDR*/
1358 {
1359  if ( p )
1360  {
1361  if ( p->refclk_states )
1362  free( p->refclk_states );
1363 
1364  if ( p->peer_states )
1365  free( p->peer_states );
1366 
1367  free( p );
1368  }
1369 
1370 } // free_all_ntp_status
1371 
1372 
1373 
1374 /*HDR*/
1385 {
1386  if ( p )
1387  {
1388  if ( p->fdm_info )
1389  free( p->fdm_info );
1390 
1391  if ( p->fdm_limits )
1392  free( p->fdm_limits );
1393 
1394  if ( p->fdm_outinfo_idx )
1395  free( p->fdm_outinfo_idx );
1396 
1397  free( p );
1398  }
1399 
1400 } // free_all_ims_info
1401 
1402 
1403 
1404 /*HDR*/
1415 {
1416  if ( p )
1417  {
1418  if ( p->sensor_state_idx )
1419  free( p->sensor_state_idx );
1420 
1421  if ( p->fdm_state )
1422  free( p->fdm_state );
1423 
1424  if ( p->fdm_output_state_idx )
1425  free( p->fdm_output_state_idx );
1426 
1427  free( p );
1428  }
1429 
1430 } // free_all_ims_state
1431 
1432 
1433 
1434 /*HDR*/
1446 {
1447  if ( p )
1448  {
1449  if ( p->infos )
1450  free( p->infos );
1451 
1452  free( p );
1453  }
1454 
1455 } // free_all_gpio_info
1456 
1457 
1458 
1459 /*HDR*/
1472 {
1473  if ( p )
1474  {
1475  if ( p->ports )
1476  {
1477  unsigned i;
1478  MBG_IO_PORT *port;
1479 
1480  for ( i = 0; i < p->num_ports; ++i )
1481  {
1482  port = &p->ports[i];
1483 
1484  if ( port->free_priv_data )
1485  port->free_priv_data( port, port->priv_data );
1486 
1487  if ( port->pt_infos )
1488  free( port->pt_infos );
1489  }
1490 
1491  free( p->ports );
1492  }
1493 
1494  free( p );
1495  }
1496 
1497 } // free_all_io_ports
1498 
1499 
1500 /*HDR*/
1512 {
1513  if ( p )
1514  {
1515  if ( p->states )
1516  free( p->states );
1517 
1518  free( p );
1519  }
1520 
1521 } // free_all_gpio_state
1522 
1523 
1524 
1525 /*HDR*/
1532 {
1533  UCAP_ENTRY *entry = (UCAP_ENTRY *) calloc( 1, sizeof( *entry ) );
1534 
1535  if ( entry )
1536  mbg_klist_init( &entry->head );
1537 
1538  return entry;
1539 
1540 } // calloc_ucap_entry
1541 
1542 
1543 /*HDR*/
1557 {
1558  if ( p )
1559  {
1560  UCAP_ENTRY *entry;
1561 
1562  while ( !mbg_klist_is_empty( &p->list ) )
1563  {
1564  entry = mbg_klist_first_entry( &p->list, UCAP_ENTRY, head );
1565  mbg_klist_delete_item( &entry->head );
1566  free( entry );
1567  }
1568 
1569  free( p );
1570  }
1571 
1572 } // free_all_ucap_info
1573 
1574 
1575 /*HDR*/
1584 {
1585  if ( p )
1586  {
1587  if ( p->recv_infos )
1588  free( p->recv_infos );
1589 
1590  free( p );
1591  }
1592 
1593 } // free_all_ucap_net_info
1594 
1595 
1596 
1597 /*HDR*/
1606 {
1607  if ( p )
1608  {
1609  if ( p->users )
1610  {
1611  unsigned i;
1612  MBG_USER *usr;
1613 
1614  for ( i = 0; i < p->user_mngmnt_info.settings.num_users; ++i )
1615  {
1616  usr = &p->users[i];
1617 
1618  if ( usr->release_priv )
1619  usr->release_priv( usr );
1620 
1621  if ( usr->release_backref )
1622  usr->release_backref( usr );
1623  }
1624 
1625  free( p->users );
1626  }
1627 
1628  free( p );
1629  }
1630 }
1631 
1632 
1633 
1634 /*HDR*/
1643 {
1644  if ( p )
1645  {
1646  if ( p->svcs )
1647  {
1648  unsigned i;
1649  MBG_SERVICE *svc;
1650 
1651  for ( i = 0; i < p->mgmt_info.num_services; ++i )
1652  {
1653  svc = &p->svcs[i];
1654 
1655  if ( svc->release_priv )
1656  svc->release_priv( svc );
1657 
1658  if ( svc->release_backref )
1659  svc->release_backref( svc );
1660  }
1661 
1662  free( p->svcs );
1663  }
1664 
1665  free( p );
1666  }
1667 }
1668 
1669 
1670 /*HDR*/
1679 {
1680  if ( p )
1681  {
1682  if ( p->firmwares )
1683  {
1684  MBG_FIRMWARE_UFU *ufu;
1685  MBG_FIRMWARE *fw;
1686  unsigned i, j;
1687 
1688  for ( i = 0; i < p->glb_info.installed_fws; ++i )
1689  {
1690  fw = &p->firmwares[i];
1691 
1692  for ( j = 0; j < fw->info.num_ufus; ++j )
1693  {
1694  ufu = &fw->ufus[j];
1695 
1696  if ( ufu->release_priv )
1697  ufu->release_priv( ufu );
1698  }
1699  free( fw->ufus );
1700 
1701  if ( fw->release_priv )
1702  fw->release_priv( fw );
1703  }
1704 
1705  free( p->firmwares );
1706  }
1707 
1708  free( p );
1709  }
1710 }
1711 
1712 
1713 
1714 /*HDR*/
1723 {
1724  if ( !p )
1725  return;
1726 
1727  if ( p->dbs )
1728  {
1729  uint8_t i;
1730  MBG_DATABASE *db;
1731 
1732  for ( i = 0; i < p->glb_info.num_dbs; ++i )
1733  {
1734  db = &p->dbs[i];
1735 
1736  if ( db->release_priv )
1737  db->release_priv( db );
1738  }
1739 
1740  free( p->dbs );
1741  }
1742 
1743  free( p );
1744 }
1745 
1746 
1747 
1748 /*HDR*/
1759 void str_ntp_hex_to_ntp_tstamp( const char *s, NTP_TSTAMP *p )
1760 {
1761  char *cp = NULL;
1762 
1763  p->seconds = strtoul( s, &cp, 16 );
1764 
1765  if ( *cp == '.' ) // fractions may follow
1766  {
1767  cp++; // skip '.'
1768 
1769  p->fractions = strtoul( cp, NULL, 16 );
1770  }
1771  else
1772  p->fractions = 0;
1773 
1774 } // str_ntp_hex_to_ntp_tstamp
1775 
1776 
1777 
1778 #if !defined( MBG_TGT_MISSING_64_BIT_TYPES )
1779 
1780 /*HDR*/
1788 {
1789  p_nt64->secs = p_nts->seconds - NTP_SEC_BIAS;
1791 
1792 } // ntp_tstamp_to_nanotime_64
1793 
1794 
1795 
1796 /*HDR*/
1808 {
1809  NTP_TSTAMP nts = { 0 };
1810 
1811  str_ntp_hex_to_ntp_tstamp( s, &nts );
1812  ntp_tstamp_to_nanotime_64( &nts, p );
1813 
1814 } // str_ntp_hex_to_nano_time_64
1815 
1816 #endif // !defined( MBG_TGT_MISSING_64_BIT_TYPES )
1817 
1818 
uint32_t fractions
binary fractional part of a second, 0xFFFFFFFF -> 0.9999999... s (resolution 2^-32s =~ 233 ps) ...
Definition: gpsdefs.h:16487
MBG_TLV_UID uid
Unique source ID. See MBG_TLV_DATA::uid.
Definition: gpsdefs.h:18373
_NO_MBG_API_ATTR int _MBG_API chk_dev_xmulti_ref_supp_ext_src_info(const ALL_XMULTI_REF_INFO *info)
Definition: cfg_hlp.c:821
MBG_SYSLOG_GLB_SETTINGS settings
MBG_SYSLOG_GLB_SETTINGS.
Definition: gpsdefs.h:22165
void free_all_gpio_info(ALL_GPIO_INFO *p)
Free memory allocated by mbgextio_get_all_gpio_info.
Definition: cfg_hlp.c:1445
MBG_IMS_SENSOR_STATE state
sensor state
Definition: gpsdefs.h:9866
int32_t BAUD_RATE
A data type to configure a serial port&#39;s baud rate.
Definition: gpsdefs.h:3190
MBG_GNSS_MODE_SETTINGS settings
Current GNSS mode settings.
Definition: gpsdefs.h:10696
NTP_REFCLK_STATE_IDX * refclk_states
Definition: cfg_hlp.h:497
MBG_IMS_FDM_STATE * fdm_state
Definition: cfg_hlp.h:554
MBG_IO_PORT * ports
Definition: cfg_hlp.h:590
the number of known modes
Definition: gpsdefs.h:3765
MBG_IO_PORT_TYPE_INFO_U data
Port type specific data.
Definition: gpsdefs.h:20990
#define MBG_PS_MSK_HS
see MBG_PS_BIT_HS
Definition: gpsdefs.h:3568
void ntp_tstamp_to_nanotime_64(const NTP_TSTAMP *p_nts, NANO_TIME_64 *p_nt64)
Convert a NTP_TSTAMP structure to a NANO_TIME_64 structure.
Definition: cfg_hlp.c:1787
uint8_t n_str_type
max num of string types supported by any port
Definition: gpsdefs.h:888
COM_PARM parm
transmission speed, framing, etc.
Definition: gpsdefs.h:3509
void chk_free_dev_hw_id(DEVICE_INFO *p)
Definition: cfg_hlp.c:502
MBG_SYSLOG_SERVER * servers
Definition: cfg_hlp.h:332
GNSS_SAT_INFO gnss_sat_info
see GNSS_SAT_INFO
Definition: gpsdefs.h:10782
MBG_GPIO_SETTINGS settings
current settings
Definition: gpsdefs.h:9256
voltage in val/exp, output state in flags
Definition: gpsdefs.h:9887
#define MBG_PS_MSK_FLAGS_OVR_SW
see MBG_PS_BIT_FLAGS_OVR_SW
Definition: gpsdefs.h:3575
struct mbg_klist_head list
User capture counter, see MAX_UCAP_ENTRIES.
Definition: cfg_hlp.h:611
MBG_GPIO_STATUS_IDX * states
Definition: cfg_hlp.h:569
void free_all_net_status_info(ALL_NET_STATUS_INFO *p)
Free an ALL_NET_STATUS_INFO structure.
Definition: cfg_hlp.c:1052
MBG_GPIO_SETTINGS gpio_settings
Definition: gpsdefs.h:20632
static int minor
void free_all_ims_state(ALL_IMS_STATE *p)
Free memory allocated by mbgextio_get_all_ims_state.
Definition: cfg_hlp.c:1414
_NO_MBG_API_ATTR int _MBG_API chk_dev_xmulti_ref_supp_ext_source_metrics(const ALL_XMULTI_REF_INFO *info, int type)
Definition: cfg_hlp.c:868
#define MBG_PS_MSK_STR_TYPE_OVR_SW
see MBG_PS_BIT_STR_TYPE_OVR_SW
Definition: gpsdefs.h:3569
XMULTI_REF_INFO_IDX * infos
Definition: cfg_hlp.h:523
int setup_default_str_type_info_idx(STR_TYPE_INFO_IDX stii[], const RECEIVER_INFO *p_ri)
Definition: cfg_hlp.c:422
void(* release_priv)(struct mbg_syslog_server *)
Definition: cfg_hlp.h:325
static __mbg_inline int mbg_klist_is_empty(const struct mbg_klist_head *head)
Definition: mbgklist.h:234
uint16_t idx
string type index, 0..RECEIVER_INFO::n_str_type-1
Definition: gpsdefs.h:3735
Structure that represents a timestamp in NTP Timestamp Format.
Definition: gpsdefs.h:16484
int valid_port_info(const PORT_INFO *p_pi, const STR_TYPE_INFO_IDX str_type_info_idx[], int n_str_type)
Definition: cfg_hlp.c:367
#define MBG_PS_MSK_STR_MODE
see MBG_PS_BIT_STR_MODE
Definition: gpsdefs.h:3574
XMR_EXT_SRC_INFO_IDX * ext_src_infos
Definition: cfg_hlp.h:524
uint32_t reserved_2
Future use.
Definition: gpsdefs.h:18380
A The structure used to store the configuration of two serial ports.
Definition: gpsdefs.h:3929
XMR_HOLDOVER_STATUS * holdover_status
Definition: cfg_hlp.h:531
MBG_GPIO_CFG_LIMITS cfg_limits
Definition: cfg_hlp.h:562
see NTP_ROLE_CLIENT_SERVER
Definition: gpsdefs.h:15123
_NO_MBG_API_ATTR int _MBG_API chk_dev_xmulti_ref_supp_ext_source_stats(const ALL_XMULTI_REF_INFO *info, int type)
Definition: cfg_hlp.c:849
All XBP information of a XBP supporting device.
Definition: cfg_hlp.h:207
_NO_MBG_API_ATTR int _MBG_API chk_dev_xbp_supp_nodes(const ALL_XBP_INFO *info)
Definition: cfg_hlp.c:757
MBG_SNMP_V12_INFO_IDX * v12_infos
Definition: cfg_hlp.h:261
#define MAX_PARM_POUT
The max number of programmable pulse outputs supported by configuration programs. ...
Definition: cfg_hlp.h:143
int n_gnss_supp
Definition: cfg_hlp.h:450
MBG_NET_INTF_ADDR_INFO_IDX * addr_infos
Definition: cfg_hlp.h:240
void free_all_ptp_v1_common_datasets(ALL_PTP_V1_COMMON_DATASETS *p)
Free an ALL_PTP_V1_COMMON_DATASETS structure allocated by mbgextio_get_all_ptp_v1_common_datasets.
Definition: cfg_hlp.c:1267
static int verbose
Definition: mbghrtime.c:80
void free_all_xmulti_ref_info(ALL_XMULTI_REF_INFO *p)
Free an ALL_XMULTI_REF_INFO structure.
Definition: cfg_hlp.c:1210
void free_all_ucap_info(ALL_UCAP_INFO *p)
Free memory allocated by mbgextio_get_all_ucap_info.
Definition: cfg_hlp.c:1556
uint32_t reserved_1
Future use.
Definition: gpsdefs.h:18351
Definition: cfg_hlp.h:602
A timestamp with nanosecond resolution, but 64 bit size.
Definition: words.h:621
COM_PARM com[2]
COM0 and COM1 settings.
Definition: gpsdefs.h:3931
uint32_t reserved_1
Reserved for future use.
Definition: gpsdefs.h:18312
uint32_t flags
see MBG_IMS_STATE_FLAG_MASKS
Definition: gpsdefs.h:9796
char name[(16+1)]
Optional string identifying a customized firmware version, should be empty in standard versions...
Definition: gpsdefs.h:735
#define MBG_ERR_INV_PARM
Invalid parameter.
Definition: mbgerror.h:329
void mbg_tlv_init(MBG_TLV *tlv, MBG_TLV_UID uid, MBG_TLV_TYPE tlv_type, uint32_t total_bytes)
Initializes a MBG_TLV.
Definition: cfg_hlp.c:668
#define MBG_PS_MSK_STR_TYPE
see MBG_PS_BIT_STR_TYPE
Definition: gpsdefs.h:3571
MBG_USER_MNGMNT_SETTINGS settings
settings, see MBG_USER_MNGMNT_SETTINGS
Definition: gpsdefs.h:22751
uint32_t type
GPIO type, see MBG_GPIO_TYPES.
Definition: gpsdefs.h:9129
#define MBG_ERR_ALREADY_ALLOC
pointer already allocated when trying to allocate memory
Definition: mbgerror.h:356
struct mbg_firmware_ufu * ufus
Array of MBG_FW_INFO::num_ufus.
Definition: cfg_hlp.h:691
MBG_IO_PORT_TYPE_INFO * get_io_port_type_info(const MBG_IO_PORT *port, uint16_t port_type)
Returns the currently used MBG_IO_PORT_TYPE_INFO for the appropriate MBG_IO_PORT. ...
Definition: cfg_hlp.c:601
All monitoring event data.
Definition: cfg_hlp.h:276
#define _inrange(_val, _min, _max)
Definition: myutil.h:151
MBG_IMS_FDM_OUTPUT_INFO_IDX * fdm_outinfo_idx
Definition: cfg_hlp.h:547
Configuration settings of a serial port.
Definition: gpsdefs.h:3507
unsigned short uint16_t
Definition: words.h:213
#define MAX_PARM_PORT
The max number of serial ports supported by configuration programs.
Definition: cfg_hlp.h:137
XMR_METRICS_IDX * metrics_idx
Definition: cfg_hlp.h:533
#define MBG_PS_MSK_STR_TYPE_OVR_DEV
see MBG_PS_BIT_STR_TYPE_OVR_DEV
Definition: gpsdefs.h:3570
uint16_t good_svs
Numb. of satellites that can currently be received and used.
Definition: gpsdefs.h:10594
static __mbg_inline int num_bits_set(long val)
Count the number of bits which are not 0.
Definition: cfg_hlp.h:1024
uint8_t num_servers
Number of configured servers.
Definition: gpsdefs.h:22151
uint32_t type
GPIO type, see MBG_GPIO_TYPES.
Definition: gpsdefs.h:9205
struct mbg_klist_head head
Definition: cfg_hlp.h:604
MBG_GNSS_MODE_INFO gnss_mode_info
Definition: cfg_hlp.h:451
MBG_NET_NAME_IDX * dns_srch_doms
Definition: cfg_hlp.h:242
uint32_t supp_modes
bit mask of modes supp. for this string type, see STR_MODE_MASKS
Definition: gpsdefs.h:3706
uint32_t read_bytes
Number of bytes read.
Definition: gpsdefs.h:18333
IO Port Type Info.
Definition: gpsdefs.h:20974
#define _int_from_size_t(_n)
Definition: words.h:662
void port_parm_from_port_settings(PORT_PARM *p_pp, int port_idx, const PORT_SETTINGS *p_ps, int cap_str_idx)
Set up a a legacy PORT_PARM structure from a PORT_SETTINGS structure.
Definition: cfg_hlp.c:272
void mbg_tlv_announce_init(MBG_TLV_ANNOUNCE *tlv, MBG_TLV_UID uid, MBG_TLV_TYPE tlv_feat_type, uint32_t total_bytes)
Initializes a MBG_TLV_ANNOUNCE structure.
Definition: cfg_hlp.c:642
void free_all_ims_info(ALL_IMS_INFO *p)
Free memory allocated by mbgextio_get_all_ims_info.
Definition: cfg_hlp.c:1384
see MBG_GPIO_DEPENDS_ON_ASS_IO_IDX
Definition: gpsdefs.h:9119
void str_ntp_hex_to_nano_time_64(const char *s, NANO_TIME_64 *p)
Set up a NANO_TIME_64 structure from a hex string with a time in seconds and binary fractions...
Definition: cfg_hlp.c:1807
uint32_t flags
currently unused, always 0
Definition: gpsdefs.h:9844
#define N_SUPP_DEV_TOTAL
Definition: cfg_hlp.h:117
uint32_t flags
see XMR_INST_FLAG_BIT_MASKS
Definition: gpsdefs.h:7056
uint16_t num_ufus
Number of available UFUs.
Definition: gpsdefs.h:23268
#define _NO_MBG_API_ATTR
Definition: mbg_tgt.h:1032
void mbg_tlv_rcv_state_init(MBG_TLV_RCV_STATE *state, MBG_TLV_UID uid, uint32_t total_bytes)
Initializes MBG_TLV_RCV_STATE structure.
Definition: cfg_hlp.c:695
void setup_gps_only_sat_info_idx_from_statinfo(ALL_GNSS_INFO *p_agi)
Setup GNSS info from stat_info so we can use the same printing routine
Definition: cfg_hlp.c:459
MBG_PTP_V1_PORT_DATASET_IDX * port_datasets
Definition: cfg_hlp.h:399
NTP_SRV_MODE_INFO * srv_info
Definition: cfg_hlp.h:486
MBG_IO_PORT_SETTINGS_U data
Data union for settings&#39; type.
Definition: gpsdefs.h:20704
MBG_TLV_TYPE type
One of the MBG_TLV_TYPES or MBG_TLV_FEAT_TYPES depending on the type of message.
Definition: gpsdefs.h:18310
MBG_SNMP_V12_TRAP_INFO_IDX * v12_trap_infos
Definition: cfg_hlp.h:262
void port_parm_mode_from_port_settings(uint8_t *pp_mode, const PORT_SETTINGS *p_ps, int cap_str_idx)
Convert a PORT_SETTINGS::mode to a legacy PORT_PARM::mode.
Definition: cfg_hlp.c:213
int alloc_dev_hw_id(DEVICE_INFO *p, size_t len)
Definition: cfg_hlp.c:515
see NTP_ROLE_SERVER
Definition: gpsdefs.h:15122
int get_baud_rate_idx(BAUD_RATE baud_rate)
Definition: cfg_hlp.c:130
void free_all_database_info(ALL_DATABASE_INFO *p)
Free an ALL_DATABASE_INFO structure.
Definition: cfg_hlp.c:1722
ALL_EVENTS * all_events
Definition: cfg_hlp.h:350
_NO_MBG_API_ATTR int _MBG_API chk_dev_net_cfg_supp_stage_2(const ALL_NET_CFG_INFO *info)
Definition: cfg_hlp.c:774
MBG_TLV_UID tlv_type
"Subtype" identifying current TLV, see MBG_TLV_TYPES
Definition: gpsdefs.h:18374
MBG_USER_MNGMNT_INFO user_mngmnt_info
Definition: cfg_hlp.h:647
MBG_GPIO_INFO info
limits and current settings of this GPIO port
Definition: gpsdefs.h:9276
uint32_t MBG_TLV_TYPE
A data type to hold one of the MBG_TLV_TYPES or MBG_TLV_FEAT_TYPES.
Definition: gpsdefs.h:18088
uint8_t n_com_ports
number of on-board serial ports
Definition: gpsdefs.h:887
MBG_TLV_DATA data
See MBG_TLV_DATA.
Definition: gpsdefs.h:18350
#define DEFAULT_GPS_BAUD_RATES_C166
Definition: gpsdefs.h:3453
NTP_CLNT_MODE_INFO * clnt_info
Definition: cfg_hlp.h:483
void free_all_user_info(ALL_USER_INFO *p)
Free an ALL_USER_INFO structure.
Definition: cfg_hlp.c:1605
_NO_MBG_API_ATTR int _MBG_API chk_dev_receiver_info(const RECEIVER_INFO *p)
Definition: cfg_hlp.c:733
NTP_REFCLK_CFG_INFO_IDX * refclk_info_idx
Definition: cfg_hlp.h:487
_NO_MBG_API_ATTR int _MBG_API chk_dev_ntp_supp_client(const ALL_NTP_CFG_INFO *info)
Definition: cfg_hlp.c:786
#define MBG_PS_MSK_BAUD_RATE_OVR_SW
Flag bit masks associated with MBG_COM_CFG_STATUS_BITS.
Definition: gpsdefs.h:3561
void free_all_monitoring_info(ALL_MONITORING_INFO *p)
Free an ALL_MONITORING_INFO structure.
Definition: cfg_hlp.c:1146
MBG_FIRMWARE * firmwares
Definition: cfg_hlp.h:728
A generic structure used to hold a GPIO port&#39;s settings.
Definition: gpsdefs.h:9127
MBG_UCAP_NET_RECV_INFO_IDX * recv_infos
Definition: cfg_hlp.h:618
All monitoring information.
Definition: cfg_hlp.h:346
static __mbg_inline void mbg_klist_init(struct mbg_klist_head *head)
Definition: mbgklist.h:131
#define MBG_ERR_N_STR_EXCEEDS_SUPP
Num. string formats of the device exceeds max. supp. by driver.
Definition: mbgerror.h:292
MBG_TLV_UID uid
Unique ID identifying following TLVs, 0 if empty/not set.
Definition: gpsdefs.h:18309
const char * get_hw_id_from_fw_id(const char *fw_id)
Definition: cfg_hlp.c:563
void free_all_io_ports(ALL_MBG_IO_PORTS *p)
Free memory allocated by mbgextio_get_all_io_ports.
Definition: cfg_hlp.c:1471
void(* release_priv)(struct mbg_firmware *)
Definition: cfg_hlp.h:701
see XMRIF_BIT_HOLDOVER_STATUS_SUPP
Definition: gpsdefs.h:7106
#define DEFAULT_GPS_FRAMINGS_C166
Definition: gpsdefs.h:3464
uint32_t trans_bytes
Number of bytes transferred so far related to this TLV type.
Definition: gpsdefs.h:18376
Generic state of an IMS sensor.
Definition: gpsdefs.h:9837
_NO_MBG_API_ATTR int _MBG_API chk_dev_xmulti_ref_supp_mrf_none(const ALL_XMULTI_REF_INFO *info)
Definition: cfg_hlp.c:810
Summary information on all supported GNSS systems.
Definition: cfg_hlp.h:447
TLV structure containing information on current TLV transaction and its current data.
Definition: gpsdefs.h:18403
char * hw_id
Definition: cfg_hlp.h:121
uint8_t num_dbs
Number of configurable databases.
Definition: gpsdefs.h:23428
MBG_IMS_FDM_INFO * fdm_info
Definition: cfg_hlp.h:545
Information on a specific supported string format.
Definition: gpsdefs.h:3733
MBG_IO_PORT_SETTINGS * setts
Definition: cfg_hlp.h:580
XMR_STATS_IDX * stats_idx
Definition: cfg_hlp.h:532
NTP_PEER_SETTINGS_IDX * peer_settings_idx
Definition: cfg_hlp.h:484
#define _mask(_n)
Definition: myutil.h:155
char framing[4]
ASCIIZ framing string, e.g. "8N1" or "7E2", see MBG_FRAMING_STRS.
Definition: gpsdefs.h:3205
uint8_t mode[2]
COM0 and COM1 output mode, see LGCY_STR_MODES.
Definition: gpsdefs.h:3932
the number of defined sources, must not exceed MAX_N_MULTI_REF_TYPES
Definition: gpsdefs.h:6440
uint8_t gnss_type
GNSS type as enumerated in MBG_GNSS_TYPES.
Definition: gpsdefs.h:10751
uint8_t str_type
index of the supported time string formats, see STR_TYPE_INFO_IDX
Definition: gpsdefs.h:3511
uint16_t svs_in_view
Num. of satellites that should be visible above the horizon.
Definition: gpsdefs.h:10754
XBP_NODE_LIMITS * node_limits
Definition: cfg_hlp.h:210
MBG_SNMP_V3_TRAP_INFO_IDX * v3_trap_infos
Definition: cfg_hlp.h:264
DEVICE_INFO device_list[(16+1)]
uint32_t flags
reserved, don&#39;t use, currently 0
Definition: gpsdefs.h:3512
#define MBG_PS_MSK_BAUD_RATE
see MBG_PS_BIT_BAUD_RATE
Definition: gpsdefs.h:3563
void(* release_priv)(struct mbg_event *)
Definition: cfg_hlp.h:292
see MBG_IMS_STATE_FLAG_BIT_HAS_FDM
Definition: gpsdefs.h:9829
void free_all_ucap_net_info(ALL_UCAP_NET_INFO *p)
Free an ALL_UCAP_NET_INFO structure.
Definition: cfg_hlp.c:1583
transmission automatically if required, e.g. on capture event
Definition: gpsdefs.h:3762
MBG_IMS_FDM_OUTPUT_STATE_IDX * fdm_output_state_idx
Definition: cfg_hlp.h:555
#define MBG_ERR_N_COM_EXCEEDS_SUPP
Num. COM ports of the device exceeds max. supp. by driver.
Definition: mbgerror.h:291
MBG_EVENT_VALUE * dict_entries
Definition: cfg_hlp.h:281
MBG_NET_INTF_LINK_INFO_IDX * link_infos
Definition: cfg_hlp.h:239
int setup_gps_only_gnss_info_from_statinfo(ALL_GNSS_INFO *p_agi)
Setup GNSS info from stat_info so we can use the same printing routine.
Definition: cfg_hlp.c:482
All network configuration parameters.
Definition: cfg_hlp.h:236
See XBP_FEAT_BIT_NODES.
Definition: gpsdefs.h:17916
All PTPv2 common datasets for a PTP device.
Definition: cfg_hlp.h:419
_NO_MBG_API_ATTR int _MBG_API chk_dev_ims_is_volt_out_enabled(const ALL_IMS_STATE *ims_state, unsigned idx)
Definition: cfg_hlp.c:892
MBG_FW_INFO info
Definition: cfg_hlp.h:690
XMULTI_REF_INSTANCES instances
Definition: cfg_hlp.h:522
MBG_NET_GLB_CFG_INFO glb_cfg_info
Definition: cfg_hlp.h:238
XBP_NODE_INFO_IDX * node_infos
Definition: cfg_hlp.h:211
void(* release_backref)(struct mbg_event *)
Definition: cfg_hlp.h:293
uint16_t idx
port index, 0..RECEIVER_INFO::n_com_ports-1
Definition: gpsdefs.h:3679
uint8_t num_services
Current number of supported services.
Definition: gpsdefs.h:23016
Satellite information for a particular GNSS type.
Definition: gpsdefs.h:10749
ALL_SYSLOG_INFO * all_syslog_info
Definition: cfg_hlp.h:351
NTP_PEER_STATE_IDX * peer_states
Definition: cfg_hlp.h:498
uint16_t good_svs
Num. of satellites that can currently be received and used.
Definition: gpsdefs.h:10753
uint32_t supp_ntp_roles
supported NTP roles, see NTP_ROLE_MASKS
Definition: gpsdefs.h:15256
STR_TYPE_INFO str_type_info
Definition: gpsdefs.h:3736
uint32_t reserved_1
Future use.
Definition: gpsdefs.h:18334
uint32_t total_bytes
Definition: gpsdefs.h:18377
Structure containing state information while reading TLV data.
Definition: gpsdefs.h:18330
_NO_MBG_API_ATTR int _MBG_API chk_dev_gpio_has_status(const ALL_GPIO_INFO *info)
Checks whether GPIO supports status function.
Definition: cfg_hlp.c:974
uint32_t flags
see MBG_GPIO_CFG_LIMIT_FLAG_MASKS
Definition: gpsdefs.h:7612
uint16_t feat_flags
see XMR_EXT_SRC_FEAT_FLAG_MSKS
Definition: gpsdefs.h:7280
uint32_t reserved_2
Future use.
Definition: gpsdefs.h:18352
void free_all_firmware_info(ALL_FIRMWARE_INFO *p)
Free an ALL_FIRMWARE_INFO structure.
Definition: cfg_hlp.c:1678
uint16_t svs_in_view
Numb. of satellites that should be visible above the horizon.
Definition: gpsdefs.h:10595
see NTP_ROLE_CLIENT
Definition: gpsdefs.h:15121
unsigned char uint8_t
Definition: words.h:210
PLL is locked.
Definition: gpsdefs.h:9921
MBG_FW_GLB_INFO glb_info
Definition: cfg_hlp.h:727
STAT_INFO stat_info
Definition: cfg_hlp.h:449
void free_all_events(ALL_EVENTS *p)
Free an ALL_EVENTS structure.
Definition: cfg_hlp.c:1170
All PTPv1 common datasets for a PTP device.
Definition: cfg_hlp.h:393
ALL_GNSS_SAT_INFO_IDX gnss_sat_info_idx
Definition: cfg_hlp.h:452
MBG_GPIO_LIMITS gpio_limits
Definition: gpsdefs.h:20918
#define _is_supported(_i, _msk)
Definition: myutil.h:163
MBG_GPIO_LIMITS limits
limits of this GPIO port
Definition: gpsdefs.h:9257
PORT_INFO port_info
Definition: gpsdefs.h:3680
NTP_MISC_LIMITS * misc_limits
Definition: cfg_hlp.h:488
MBG_PTP_V2_PORT_DATASET_IDX * port_datasets
Definition: cfg_hlp.h:425
Current settings and general capabilities of a serial port.
Definition: gpsdefs.h:3618
XBP_LIMITS limits
Definition: cfg_hlp.h:209
#define MBG_ERR_NO_MEM
Failed to allocate memory.
Definition: mbgerror.h:282
NTP_TRUSTED_KEY_INFO_IDX * trusted_key_info_idx
Definition: cfg_hlp.h:481
_NO_MBG_API_ATTR int _MBG_API chk_dev_ims_is_pll_locked(const ALL_IMS_STATE *ims_state, unsigned idx)
Definition: cfg_hlp.c:922
MBG_IO_PORT_INFO p_info
Definition: cfg_hlp.h:576
NTP_GLB_INFO glb_info
Definition: cfg_hlp.h:478
One of several sets of satellite information for a particular GNSS type.
Definition: gpsdefs.h:10773
ALL_SNMP_INFO * all_snmp_info
Definition: cfg_hlp.h:349
void trim_whitespace(char *s)
Trim both leading and trailing whitespace from a string.
Definition: str_util.c:387
see XMR_EXT_SRC_FEAT_FLAG_BIT_METRICS
Definition: gpsdefs.h:7271
the number of known baud rates
Definition: gpsdefs.h:3246
void free_all_ptp_v2_common_datasets(ALL_PTP_V2_COMMON_DATASETS *p)
Free an ALL_PTP_V2_COMMON_DATASETS structure allocated by mbgextio_get_all_ptp_v2_common_datasets.
Definition: cfg_hlp.c:1289
uint32_t feat_flags
Feature flags, see MBG_NET_GLB_CFG_INFO_MASKS.
Definition: gpsdefs.h:11880
#define MBG_SUCCESS
Error codes used with Meinberg devices and drivers.
Definition: mbgerror.h:259
#define mbg_klist_first_entry(ptr, type, member)
Definition: mbgklist.h:80
uint32_t total_bytes
Number of all bytes including header(s) that are related to a TLV block transaction.
Definition: gpsdefs.h:18311
uint32_t supp_flags
supported flags, see MBG_GPIO_FLAG_MASKS
Definition: gpsdefs.h:9207
A generic structure used to specify a GPIO port&#39;s limits.
Definition: gpsdefs.h:9203
MBG_IMS_FDM_LIMITS * fdm_limits
Definition: cfg_hlp.h:546
MBG_EVENT * events
Definition: cfg_hlp.h:300
#define MBG_PS_MSK_FRAMING_OVR_SW
see MBG_PS_BIT_FRAMING_OVR_SW
Definition: gpsdefs.h:3564
uint8_t num_types
See MBG_IO_PORT_TYPE_INFO.
Definition: gpsdefs.h:20808
void free_all_syslog_info(ALL_SYSLOG_INFO *p)
Free an ALL_SYSLOG_INFO structure.
Definition: cfg_hlp.c:1113
NTP_SYMM_KEY_LIMITS * symm_key_limits
Definition: cfg_hlp.h:479
uint32_t seconds
seconds since NTP epoch, see NTP_SEC_BIAS
Definition: gpsdefs.h:16486
void free_all_snmp_info(ALL_SNMP_INFO *p)
Free an ALL_SNMP_INFO structure.
Definition: cfg_hlp.c:1084
MBG_IO_PORT_TYPE_INFO * pt_infos
Definition: cfg_hlp.h:578
_NO_MBG_API_ATTR int _MBG_API chk_dev_ntp_supp_server(const ALL_NTP_CFG_INFO *info)
Definition: cfg_hlp.c:798
#define MBG_PS_MSK_FRAMING
see MBG_PS_BIT_FRAMING
Definition: gpsdefs.h:3566
uint32_t cur_bytes
Number of bytes in MBG_TLV::value.
Definition: gpsdefs.h:18375
void str_ntp_hex_to_ntp_tstamp(const char *s, NTP_TSTAMP *p)
Set up a NTP_TSTAMP structure from a hex string with a time in seconds and binary fractions...
Definition: cfg_hlp.c:1759
_NO_MBG_API_ATTR int _MBG_API chk_dev_gpio_dep_on_ass_idx(const ALL_GPIO_INFO *gpio_info, unsigned idx)
Definition: cfg_hlp.c:950
#define MBG_PS_MSK_FLAGS
see MBG_PS_BIT_FLAGS
Definition: gpsdefs.h:3576
uint32_t MBG_TLV_UID
A data type used to hold a unique ID (UID) for a TLV transaction.
Definition: gpsdefs.h:18075
A structure initiating a TLV transfer.
Definition: gpsdefs.h:18348
uint32_t reserved_3
Future use.
Definition: gpsdefs.h:18381
#define MBG_PS_MSK_STR_MODE_OVR_SW
see MBG_PS_BIT_STR_MODE_OVR_SW
Definition: gpsdefs.h:3572
const char * mbg_framing_strs[N_MBG_FRAMINGS]
MBG_SNMP_V3_INFO_IDX * v3_infos
Definition: cfg_hlp.h:263
see XMRIF_BIT_EXT_SRC_INFO_SUPP
Definition: gpsdefs.h:7107
MBG_SYSLOG_GLB_INFO glb_info
Definition: cfg_hlp.h:331
uint8_t mode
string mode, see STR_MODES
Definition: gpsdefs.h:3510
Automatically, when a capture event has occurred, COM1 only.
Definition: gpsdefs.h:3963
_NO_MBG_API_ATTR int _MBG_API chk_dev_gpio_supp_ass_idx(const ALL_GPIO_INFO *gpio_info, unsigned idx)
Definition: cfg_hlp.c:937
static __mbg_inline uint32_t bin_frac_32_to_dec_frac(uint32_t bin, uint32_t scale)
Convert a 32 bit binary fraction to a scaled decimal.
Definition: mbgtime.h:439
void * priv_data
Definition: cfg_hlp.h:581
_NO_MBG_API_ATTR int _MBG_API chk_dev_ims_has_fdm(const ALL_IMS_INFO *info)
Definition: cfg_hlp.c:881
uint32_t supp_str_types
bit mask of string types supp. by this port, i.e. bit 0 set if str_type[0] is supp.
Definition: gpsdefs.h:3623
uint8_t installed_fws
Currently installed firmwares.
Definition: gpsdefs.h:23184
void(* release_priv)(struct mbg_firmware_ufu *)
Definition: cfg_hlp.h:720
void free_all_gpio_state(ALL_GPIO_STATE *p)
Free memory allocated by mbgextio_get_all_gpio_state.
Definition: cfg_hlp.c:1511
void free_all_ntp_status(ALL_NTP_STATUS *p)
Free an ALL_NTP_STATUS structure.
Definition: cfg_hlp.c:1357
MBG_GPIO_INFO_IDX * infos
Definition: cfg_hlp.h:563
Satellite receiver status information.
Definition: gpsdefs.h:10591
MBG_NET_INTF_ROUTE_INFO_IDX * route_infos
Definition: cfg_hlp.h:243
XMR_EXT_SRC_INFO info
Definition: gpsdefs.h:7298
#define MBG_PS_MSK_HS_OVR_SW
see MBG_PS_BIT_HS_OVR_SW
Definition: gpsdefs.h:3567
Software revision information.
Definition: gpsdefs.h:732
MBG_IMS_STATE state
Definition: cfg_hlp.h:544
see GNSS_TYPE_GPS
Definition: gpsdefs.h:10643
uint32_t reserved_1
Future use.
Definition: gpsdefs.h:18379
Current settings and general capabilities of a specific serial port.
Definition: gpsdefs.h:3677
void free_all_ntp_cfg_info(ALL_NTP_CFG_INFO *p)
Free an ALL_NTP_CFG_INFO structure.
Definition: cfg_hlp.c:1311
uint32_t supp_framings
bit mask of framings supp. by this port, see MBG_FRAMING_MASKS
Definition: gpsdefs.h:3622
All SNMP configuration information.
Definition: cfg_hlp.h:258
control voltage in val/exp, lock state in flags
Definition: gpsdefs.h:9888
void free_all_svc_info(ALL_SERVICE_INFO *p)
Free an ALL_SERVICE_INFO structure.
Definition: cfg_hlp.c:1642
MBG_DATABASE * dbs
Definition: cfg_hlp.h:758
#define NSEC_PER_SEC
Definition: mbgtime.h:264
void free_all_xmulti_ref_status(ALL_XMULTI_REF_STATUS *p)
Free an ALL_XMULTI_REF_STATUS structure.
Definition: cfg_hlp.c:1236
MBG_SERVICE * svcs
Definition: cfg_hlp.h:678
see MBG_GPIO_CFG_LIMIT_FLAG_BIT_STATUS_SUPP
Definition: gpsdefs.h:7648
unsigned num_ports
Definition: cfg_hlp.h:589
MBG_IMS_SENSOR_STATE_IDX * sensor_state_idx
Definition: cfg_hlp.h:553
MBG_IP_ADDR_IDX * dns_srvrs
Definition: cfg_hlp.h:241
unsigned num_events
Definition: cfg_hlp.h:299
void(* free_priv_data)(const struct mbg_io_port *, void *)
Definition: cfg_hlp.h:582
void free_all_xbp_info(ALL_XBP_INFO *p)
Free an ALL_XBP_INFO structure.
Definition: cfg_hlp.c:993
#define _mbg_decode_revision(_rev, _major, _minor, _patch)
Definition: gpsdefs.h:19467
_NO_MBG_API_ATTR int _MBG_API chk_dev_xmulti_ref_supp_holdover_status(const ALL_XMULTI_REF_INFO *info)
Definition: cfg_hlp.c:832
int snprintf_safe(char *s, size_t max_len, const char *fmt,...)
A portable, safe implementation of snprintf()
Definition: str_util.c:156
#define _MBG_API
Definition: mbg_tgt.h:1020
uint8_t n_prg_out
number of programmable pulse outputs
Definition: gpsdefs.h:889
MBG_SERVICE_MGMT_INFO mgmt_info
Definition: cfg_hlp.h:677
All monitoring syslog data.
Definition: cfg_hlp.h:312
#define MBG_ERR_NOT_SUPP_BY_DEV
Command or feature not supported by device.
Definition: mbgerror.h:286
NTP_MISC_ORPHAN_MODE_INFO * orphan_mode_info
Definition: cfg_hlp.h:489
uint32_t gnss_set
bit mask of currently used GNSS systems, see MBG_GNSS_TYPE_MASKS
Definition: gpsdefs.h:10679
#define MBG_ERR_N_GNSS_EXCEEDS_SUPP
Num. of GNSS systems supp. by device exceeds max. supp. by driver.
Definition: mbgerror.h:308
int16_t handshake
handshake mode, yet only HS_NONE supported
Definition: gpsdefs.h:3206
MBG_USER * users
system users for internal authentication
Definition: cfg_hlp.h:648
output is enabled
Definition: gpsdefs.h:9908
void(* release_backref)(struct mbg_service *)
Definition: cfg_hlp.h:671
void(* release_backref)(struct mbg_user *)
Definition: cfg_hlp.h:641
void free_all_net_cfg_info(ALL_NET_CFG_INFO *p)
Free an ALL_NET_CFG_INFO structure.
Definition: cfg_hlp.c:1018
uint32_t features
Mask of XBP features, see XBP_FEAT_MASKS.
Definition: gpsdefs.h:17877
BAUD_RATE mbg_baud_rates[N_MBG_BAUD_RATES]
static int major
PORT_SETTINGS port_settings
current configuration of the port
Definition: gpsdefs.h:3620
see XMRIF_BIT_MRF_NONE_SUPP
Definition: gpsdefs.h:7105
int64_t nano_secs
[nanoseconds]
Definition: words.h:628
int64_t secs
[seconds], usually since 1970-01-01 00:00:00
Definition: words.h:627
UCAP_ENTRY * calloc_ucap_entry(void)
Definition: cfg_hlp.c:1531
uint32_t flags
flags, see MBG_GPIO_FLAG_MASKS
Definition: gpsdefs.h:9135
void(* release_priv)(struct mbg_database *)
Definition: cfg_hlp.h:747
MBG_DATABASE_GLB_INFO glb_info
Definition: cfg_hlp.h:754
void(* release_priv)(struct mbg_user *)
Definition: cfg_hlp.h:640
#define DEFAULT_SUPP_STR_TYPES_GPS
Bit mask of string types supported by legacy GPS receivers.
Definition: gpsdefs.h:3900
int setup_port_info_from_port_parm(PORT_INFO_IDX pii[], const PORT_PARM *p_pp, const RECEIVER_INFO *p_ri)
Setup an array of PORT_INFO_IDX structures from a PORT_PARM.
Definition: cfg_hlp.c:397
the number of known framings
Definition: gpsdefs.h:3346
see MBG_NET_GLB_SUPP_STAGE_2
Definition: gpsdefs.h:11404
int get_str_idx(const char *search, const char *str_table[], int n_entries)
Definition: cfg_hlp.c:113
static __mbg_inline void mbg_klist_delete_item(struct mbg_klist_head *item)
Definition: mbgklist.h:171
transmission on request by received &#39;?&#39; character only
Definition: gpsdefs.h:3759
GPS, United States.
Definition: gpsdefs.h:10625
unsigned long ulong
Definition: words.h:292
On request only, if a capture event is available, COM1 only.
Definition: gpsdefs.h:3964
uint16_t port_type
See MBG_IO_PORT_TYPES.
Definition: gpsdefs.h:20976
_NO_MBG_API_ATTR int _MBG_API chk_dev_ims_is_volt_out_overload(const ALL_IMS_STATE *ims_state, unsigned idx)
Definition: cfg_hlp.c:907
uint32_t supp_baud_rates
bit mask of baud rates supp. by this port, see MBG_BAUD_RATE_MASKS
Definition: gpsdefs.h:3621
BAUD_RATE baud_rate
transmission speed, e.g. 19200L, see MBG_BAUD_RATES
Definition: gpsdefs.h:3204
A structure used to identify a device type and supported features.
Definition: gpsdefs.h:873
STR_TYPE_INFO default_str_type_info[2]
uint32_t check_valid_port_info(const PORT_INFO *p_pi, const STR_TYPE_INFO_IDX str_type_info_idx[], int n_str_type)
Definition: cfg_hlp.c:287
void port_settings_from_port_parm(PORT_SETTINGS *p_ps, int port_idx, const PORT_PARM *p_pp, int cap_str_idx)
Set up a PORT_SETTINGS structure from a legacy PORT_PARM structure.
Definition: cfg_hlp.c:245
MBG_TLV_HDR hdr
See MBG_TLV_HDR.
Definition: gpsdefs.h:18405
int chk_sw_rev_name(SW_REV *p, int verbose)
Check if a software revision name should be displayed.
Definition: cfg_hlp.c:89
void port_settings_from_port_parm_mode(PORT_SETTINGS *p_ps, uint8_t pp_mode, int cap_str_idx)
Convert PORT_PARM::mode to PORT_SETTINGS::mode.
Definition: cfg_hlp.c:170
#define MAX_PARM_STR_TYPE
The max number of serial string types supported by configuration programs.
Definition: cfg_hlp.h:140
Number of defined codes.
Definition: gpsdefs.h:10632
const char * get_fw_id_from_hw_id(const char *hw_id)
Definition: cfg_hlp.c:533
int get_framing_idx(const char *framing)
Definition: cfg_hlp.c:145
see XMR_EXT_SRC_FEAT_FLAG_BIT_STATS
Definition: gpsdefs.h:7270
int mbg_snprint_revision(char *buf, size_t buflen, const char *prefix, const char *suffix, uint32_t rev)
Definition: cfg_hlp.c:709
int chk_set_n_gnss_supp(ALL_GNSS_INFO *p_agi)
Definition: cfg_hlp.c:440
NTP_SYMM_KEY_INFO_IDX * symm_key_info_idx
Definition: cfg_hlp.h:480
#define NTP_SEC_BIAS
NTP epoch bias from ordinary time_t epoch.
Definition: mbgtime.h:142
uint16_t type
sensor type, see MBG_IMS_SENSORS
Definition: gpsdefs.h:9839
uint32_t num_users
current number of users
Definition: gpsdefs.h:22729
uint32_t supp_gnss_types
Bit masks of supported GNSS types, see MBG_GNSS_TYPE_MASKS.
Definition: gpsdefs.h:10697
XMULTI_REF_STATUS_IDX * status
Definition: cfg_hlp.h:530
MBG_TLV_DATA data
See MBG_TLV_DATA.
Definition: gpsdefs.h:18332
char fw_id[100]
Definition: cfg_hlp.h:122
void(* release_priv)(struct mbg_service *)
Definition: cfg_hlp.h:670