mbgtools-lx  4.2.8
deviohlp.h
Go to the documentation of this file.
1 
2 /**************************************************************************
3  *
4  * $Id: deviohlp.h 1.4 2017/07/05 13:50:18 martin REL_M $
5  *
6  * Copyright (c) Meinberg Funkuhren, Bad Pyrmont, Germany
7  *
8  * Description:
9  * Definitions and prototypes for deviohlp.c.
10  *
11  * -----------------------------------------------------------------------
12  * $Log: deviohlp.h $
13  * Revision 1.4 2017/07/05 13:50:18 martin
14  * Moved definition of PCPS_SER_PACK here.
15  * Defined function type MBG_ERR_MSG_FNC.
16  * New structure PCPS_TIME_EXT.
17  * New inline function pcps_time_is_valid().
18  * Updated function prototypes.
19  * Revision 1.3 2013/09/26 08:25:18Z martin
20  * Moved ALL_PTP_CFG_INFO definition to cfg_hlp.h.
21  * Updated doxygen comments.
22  * Revision 1.2 2012/10/15 13:51:18Z martin
23  * Include cfg_hlp.h.
24  * Added structure ALL_PTP_CFG_INFO.
25  * Updated function prototypes.
26  * Revision 1.1 2011/08/03 15:36:44Z martin
27  * Initial revision with functions moved here from mbgdevio.
28  *
29  **************************************************************************/
30 
31 #ifndef _DEVIOHLP_H
32 #define _DEVIOHLP_H
33 
34 
35 /* Other headers to be included */
36 
37 #include <mbgdevio.h>
38 #include <cfg_hlp.h>
39 
40 
41 #ifdef _DEVIOHLP
42  #define _ext
43  #define _DO_INIT
44 #else
45  #define _ext extern
46 #endif
47 
48 
49 /* Start of header body */
50 
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54 
55 
63 typedef struct
64 {
66 
70 
72 
73 
74 
75 typedef int MBG_ERR_MSG_FNC( const PCPS_DEV *p_dev, const char *s );
76 
77 
87 typedef struct
88 {
92  int32_t utc_offs;
95  uint32_t flags;
96 
98 
99 
100 
108 static __mbg_inline
110 {
111  return ( p->sec100 <= 99 )
112  && ( p->sec <= 60 ) // allow for leap second
113  && ( p->min <= 59 )
114  && ( p->hour <= 23 )
115  && ( p->mday >= 1 ) && ( p->mday <= 31 )
116  && ( p->wday >= 1 ) && ( p->wday <= 7 )
117  && ( p->month >= 1 ) && ( p->month <= 12 )
118  && ( p->year <= 99 );
119 
120 } // pcps_time_is_valid
121 
122 
123 
124 /* ----- function prototypes begin ----- */
125 
126 /* This section was generated automatically */
127 /* by MAKEHDR, do not remove the comments. */
128 
129  int chk_feat_supp( MBG_DEV_HANDLE dh, const PCPS_DEV *p_dev, MBG_CHK_SUPP_FNC *chk_supp_fnc, MBG_ERR_MSG_FNC *err_msg_fnc, const char *not_supp_msg ) ;
159 
181  int mbg_get_serial_settings( MBG_DEV_HANDLE dh, const PCPS_DEV *p_dev, RECEIVER_PORT_CFG *p_rpcfg, const RECEIVER_INFO *p_ri ) ;
182 
208  int mbg_save_serial_settings( MBG_DEV_HANDLE dh, const PCPS_DEV *p_dev, RECEIVER_PORT_CFG *p_rpcfg, int port_num ) ;
209 
234 
256 
281 
301 
321 
339 
354 
373 
392 
393  void test_gpio( MBG_DEV_HANDLE dh, const PCPS_DEV *p_dev, int verbose ) ;
394  void test_xmr( MBG_DEV_HANDLE dh, const PCPS_DEV *p_dev, int verbose ) ;
395  void port_info_from_pcps_serial( PORT_INFO_IDX *p_pii, PCPS_SERIAL pcps_serial, uint32_t supp_baud_rates ) ;
396  void pcps_serial_from_port_info( PCPS_SERIAL *p, const PORT_INFO_IDX *p_pii ) ;
397  void pcps_unpack_serial( PCPS_SER_PACK *p ) ;
398  void pcps_pack_serial( PCPS_SER_PACK *p ) ;
399  void pcps_setup_isa_ports( char *s, int *port_vals, int n_vals ) ;
400  const char *setup_device_type_name( char *s, size_t max_len, MBG_DEV_HANDLE dh, const RECEIVER_INFO *p_ri ) ;
401  const char *setup_asic_features( char *s, size_t max_len, MBG_DEV_HANDLE dh ) ;
402 
403 /* ----- function prototypes end ----- */
404 
405 #ifdef __cplusplus
406 }
407 #endif
408 
409 
410 /* End of header body */
411 
412 #undef _ext
413 #undef _DO_INIT
414 
415 #endif /* _DEVIOHLP_H */
MBG_DATABASE_INFO info
Definition: cfg_hlp.h:736
uint8_t year
year of the century, 0..99
Definition: pcpsdefs.h:1138
uint16_t year
full year number
Definition: deviohlp.h:94
uint8_t mday
day of month, 0..31
Definition: pcpsdefs.h:1135
uint8_t sec100
hundredths of seconds, 0..99, 10 ms resolution
Definition: pcpsdefs.h:1130
void test_xmr(MBG_DEV_HANDLE dh, const PCPS_DEV *p_dev, int verbose)
static int verbose
Definition: mbghrtime.c:80
short int16_t
Definition: words.h:212
int mbg_get_all_xmulti_ref_status(MBG_DEV_HANDLE dh, const ALL_XMULTI_REF_INFO *info, ALL_XMULTI_REF_STATUS **p)
Read all XMR status info into a newly or re-allocated ALL_XMULTI_REF_STATUS.
Definition: deviohlp.c:1096
int mbg_save_serial_settings(MBG_DEV_HANDLE dh, const PCPS_DEV *p_dev, RECEIVER_PORT_CFG *p_rpcfg, int port_num)
Write the configuration settings for a single serial port to a device.
Definition: deviohlp.c:353
unsigned short uint16_t
Definition: words.h:213
void pcps_setup_isa_ports(char *s, int *port_vals, int n_vals)
Definition: deviohlp.c:1662
#define _NO_MBG_API_ATTR
Definition: mbg_tgt.h:1032
uint8_t frame
The unpacked framing code, see PCPS_FR_CODES.
Definition: deviohlp.h:68
uint8_t PCPS_SERIAL
Legacy definitions used to configure a device&#39;s serial port.
Definition: pcpsdefs.h:1342
uint8_t baud
The unpacked baud rate code, see PCPS_BD_CODES.
Definition: deviohlp.h:67
int mbg_save_all_net_cfg_info(MBG_DEV_HANDLE dh, ALL_NET_CFG_INFO *p)
Write all network settings to a device.
Definition: deviohlp.c:615
Summary information on all supported GNSS systems.
Definition: cfg_hlp.h:447
A helper structure used with configuration of old DCF77 clocks.
Definition: deviohlp.h:63
const char * setup_device_type_name(char *s, size_t max_len, MBG_DEV_HANDLE dh, const RECEIVER_INFO *p_ri)
Definition: deviohlp.c:1685
static __mbg_inline int pcps_time_is_valid(const PCPS_TIME *p)
Check if a PCPS_TIME structure contains valid date and time.
Definition: deviohlp.h:109
_NO_MBG_API_ATTR int _MBG_API mbg_save_all_xmulti_ref_info(MBG_DEV_HANDLE dh, ALL_XMULTI_REF_INFO *p)
Set all extended multi ref settings to a device.
Definition: deviohlp.c:1052
All network configuration parameters.
Definition: cfg_hlp.h:236
int MBG_CHK_SUPP_FNC(MBG_DEV_HANDLE dh)
The type of functions to check if a feature is supported.
Definition: mbgdevio.h:845
All PTP configuration parameters.
Definition: cfg_hlp.h:369
void port_info_from_pcps_serial(PORT_INFO_IDX *p_pii, PCPS_SERIAL pcps_serial, uint32_t supp_baud_rates)
Definition: deviohlp.c:1532
unsigned char uint8_t
Definition: words.h:210
uint32_t flags
see PCPS_TIME_EXT_FLAGS
Definition: deviohlp.h:95
int mbg_get_all_ucap_info(MBG_DEV_HANDLE dh, ALL_UCAP_INFO **p)
Read all user capture information and store it into a newly allocated or reused ALL_UCAP_INFO.
Definition: deviohlp.c:1169
int mbg_get_all_ptp_cfg_info(MBG_DEV_HANDLE dh, ALL_PTP_CFG_INFO *p)
Read all PTP settings and supported configuration parameters.
Definition: deviohlp.c:869
void pcps_serial_from_port_info(PCPS_SERIAL *p, const PORT_INFO_IDX *p_pii)
Definition: deviohlp.c:1567
const char * setup_asic_features(char *s, size_t max_len, MBG_DEV_HANDLE dh)
Definition: deviohlp.c:1711
int mbg_get_serial_settings(MBG_DEV_HANDLE dh, const PCPS_DEV *p_dev, RECEIVER_PORT_CFG *p_rpcfg, const RECEIVER_INFO *p_ri)
Read all serial port settings and supported configuration parameters.
Definition: deviohlp.c:244
uint8_t hour
hours, 0..23
Definition: pcpsdefs.h:1133
int32_t utc_offs
UTC offset, always expanded to [seconds]
Definition: deviohlp.h:92
int chk_feat_supp(MBG_DEV_HANDLE dh, const PCPS_DEV *p_dev, MBG_CHK_SUPP_FNC *chk_supp_fnc, MBG_ERR_MSG_FNC *err_msg_fnc, const char *not_supp_msg)
Definition: deviohlp.c:84
PCPS_SERIAL pack
This packed byte is read from or written to the board.
Definition: deviohlp.h:65
Current settings and general capabilities of a specific serial port.
Definition: gpsdefs.h:3677
int mbg_get_all_net_status_info(MBG_DEV_HANDLE dh, ALL_NET_STATUS_INFO **p)
Read current network status into an ALL_NET_STATUS_INFO structure.
Definition: deviohlp.c:676
uint8_t comp_sig_mode
0..N_CONN_SIG_MODES-1, see COMP_SIG_MODES
Definition: deviohlp.h:90
Local calendar date and time, plus sync status.
Definition: pcpsdefs.h:1128
uint16_t PCPS_TIME_STATUS_X
Extended status code.
Definition: pcpsdefs.h:1022
int mbg_get_all_net_cfg_info(MBG_DEV_HANDLE dh, ALL_NET_CFG_INFO **p)
Read all network configuration into an ALL_NET_CFG_INFO structure.
Definition: deviohlp.c:420
#define _MBG_API
Definition: mbg_tgt.h:1020
void test_gpio(MBG_DEV_HANDLE dh, const PCPS_DEV *p_dev, int verbose)
int mbg_chk_get_all_gnss_info(MBG_DEV_HANDLE dh, ALL_GNSS_INFO *p_agi)
Read or setup all GNSS status information.
Definition: deviohlp.c:159
int mbg_save_all_ptp_cfg_info(MBG_DEV_HANDLE dh, const ALL_PTP_CFG_INFO *p)
Write all PTP settings to a device.
Definition: deviohlp.c:925
uint8_t min
minutes, 0..59
Definition: pcpsdefs.h:1132
int MBG_ERR_MSG_FNC(const PCPS_DEV *p_dev, const char *s)
Definition: deviohlp.h:75
An extended time and status structure.
Definition: deviohlp.h:87
uint8_t mode
The unpacked mode code, see PCPS_MOD_CODES.
Definition: deviohlp.h:69
int16_t comp_sig_val
compensated signal value, see PCPS_SIG_VAL_DEFS
Definition: deviohlp.h:91
void pcps_pack_serial(PCPS_SER_PACK *p)
Definition: deviohlp.c:1638
void pcps_unpack_serial(PCPS_SER_PACK *p)
Definition: deviohlp.c:1614
A structure used to identify a device type and supported features.
Definition: gpsdefs.h:873
uint8_t month
month, 1..12
Definition: pcpsdefs.h:1137
Device info structure.
Definition: pcpsdev.h:1043
PCPS_TIME_STATUS_X status_x
extended status, see
Definition: deviohlp.h:93
uint8_t sec
seconds, 0..59, or 60 if leap second
Definition: pcpsdefs.h:1131
uint8_t wday
day of week, 1..7, 1 = Monday
Definition: pcpsdefs.h:1136
PCPS_TIME t
current date, time, and limited status
Definition: deviohlp.h:89
int mbg_get_all_xmulti_ref_info(MBG_DEV_HANDLE dh, ALL_XMULTI_REF_INFO **p)
Read all XMR info into a newly or re-allocated ALL_XMULTI_REF_INFO.
Definition: deviohlp.c:978
All configuration parameters for all serial ports.
Definition: cfg_hlp.h:190