Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/ntp merge conflicts



details:   https://anonhg.NetBSD.org/src/rev/ce40489ad38f
branches:  trunk
changeset: 337227:ce40489ad38f
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Apr 07 17:34:18 2015 +0000

description:
merge conflicts

diffstat:

 external/bsd/ntp/dist/include/audio.h                                      |     2 +-
 external/bsd/ntp/dist/include/binio.h                                      |    12 +-
 external/bsd/ntp/dist/include/icom.h                                       |     2 +-
 external/bsd/ntp/dist/include/mbg_gps166.h                                 |  1205 ++++++---
 external/bsd/ntp/dist/include/ntp.h                                        |    37 +-
 external/bsd/ntp/dist/include/ntp_calendar.h                               |     8 +-
 external/bsd/ntp/dist/include/ntp_config.h                                 |     2 +-
 external/bsd/ntp/dist/include/ntp_filegen.h                                |     2 +-
 external/bsd/ntp/dist/include/ntp_fp.h                                     |     7 +-
 external/bsd/ntp/dist/include/ntp_md5.h                                    |     4 +-
 external/bsd/ntp/dist/include/ntp_stdlib.h                                 |     2 +-
 external/bsd/ntp/dist/include/ntpd.h                                       |    15 +-
 external/bsd/ntp/dist/include/parse.h                                      |    51 +-
 external/bsd/ntp/dist/include/parse_conf.h                                 |    16 +-
 external/bsd/ntp/dist/include/timepps-Solaris.h                            |     4 +-
 external/bsd/ntp/dist/kernel/sys/parsestreams.h                            |     4 +-
 external/bsd/ntp/dist/lib/isc/backtrace.c                                  |     2 +-
 external/bsd/ntp/dist/lib/isc/event.c                                      |     2 +-
 external/bsd/ntp/dist/lib/isc/include/isc/backtrace.h                      |     6 +-
 external/bsd/ntp/dist/lib/isc/include/isc/socket.h                         |    16 +-
 external/bsd/ntp/dist/lib/isc/inet_ntop.c                                  |     3 +-
 external/bsd/ntp/dist/lib/isc/log.c                                        |    26 +-
 external/bsd/ntp/dist/lib/isc/netaddr.c                                    |     2 +-
 external/bsd/ntp/dist/lib/isc/result.c                                     |    14 +-
 external/bsd/ntp/dist/lib/isc/sockaddr.c                                   |     2 +-
 external/bsd/ntp/dist/lib/isc/unix/file.c                                  |     8 +-
 external/bsd/ntp/dist/lib/isc/unix/ifiter_getifaddrs.c                     |     5 +-
 external/bsd/ntp/dist/lib/isc/unix/ifiter_ioctl.c                          |    20 +-
 external/bsd/ntp/dist/lib/isc/unix/net.c                                   |     5 +-
 external/bsd/ntp/dist/libjsmn/jsmn.c                                       |     5 +-
 external/bsd/ntp/dist/libntp/atoint.c                                      |     2 +-
 external/bsd/ntp/dist/libntp/atolfp.c                                      |     2 +-
 external/bsd/ntp/dist/libntp/atouint.c                                     |     2 +-
 external/bsd/ntp/dist/libntp/audio.c                                       |     8 +-
 external/bsd/ntp/dist/libntp/authkeys.c                                    |     2 +-
 external/bsd/ntp/dist/libntp/authreadkeys.c                                |     2 +-
 external/bsd/ntp/dist/libntp/emalloc.c                                     |     2 +-
 external/bsd/ntp/dist/libntp/hextoint.c                                    |     2 +-
 external/bsd/ntp/dist/libntp/hextolfp.c                                    |     2 +-
 external/bsd/ntp/dist/libntp/humandate.c                                   |     2 +-
 external/bsd/ntp/dist/libntp/icom.c                                        |     2 +-
 external/bsd/ntp/dist/libntp/modetoa.c                                     |     2 +-
 external/bsd/ntp/dist/libntp/mstolfp.c                                     |     2 +-
 external/bsd/ntp/dist/libntp/ntp_calendar.c                                |    76 +-
 external/bsd/ntp/dist/libntp/ntp_crypto_rnd.c                              |    18 +-
 external/bsd/ntp/dist/libntp/ntp_intres.c                                  |     2 +-
 external/bsd/ntp/dist/libntp/ntp_lineedit.c                                |     2 +-
 external/bsd/ntp/dist/libntp/octtoint.c                                    |     2 +-
 external/bsd/ntp/dist/libntp/prettydate.c                                  |     2 +-
 external/bsd/ntp/dist/libntp/ssl_init.c                                    |     2 +-
 external/bsd/ntp/dist/libntp/timetoa.c                                     |     2 +-
 external/bsd/ntp/dist/libntp/work_fork.c                                   |     4 +-
 external/bsd/ntp/dist/libparse/clk_computime.c                             |    64 +-
 external/bsd/ntp/dist/libparse/clk_dcf7000.c                               |    29 +-
 external/bsd/ntp/dist/libparse/clk_hopf6021.c                              |    41 +-
 external/bsd/ntp/dist/libparse/clk_meinberg.c                              |   179 +-
 external/bsd/ntp/dist/libparse/clk_rawdcf.c                                |    46 +-
 external/bsd/ntp/dist/libparse/clk_rcc8000.c                               |    33 +-
 external/bsd/ntp/dist/libparse/clk_schmid.c                                |    38 +-
 external/bsd/ntp/dist/libparse/clk_sel240x.c                               |    18 +-
 external/bsd/ntp/dist/libparse/clk_trimtaip.c                              |    25 +-
 external/bsd/ntp/dist/libparse/clk_trimtsip.c                              |    62 +-
 external/bsd/ntp/dist/libparse/clk_varitext.c                              |    89 +-
 external/bsd/ntp/dist/libparse/clk_wharton.c                               |    15 +-
 external/bsd/ntp/dist/libparse/data_mbg.c                                  |   145 +-
 external/bsd/ntp/dist/libparse/gpstolfp.c                                  |    15 +-
 external/bsd/ntp/dist/libparse/info_trimble.c                              |     6 +-
 external/bsd/ntp/dist/libparse/parse.c                                     |   122 +-
 external/bsd/ntp/dist/libparse/parse_conf.c                                |     6 +-
 external/bsd/ntp/dist/libparse/parsesolaris.c                              |   110 +-
 external/bsd/ntp/dist/libparse/parsestreams.c                              |   128 +-
 external/bsd/ntp/dist/libparse/trim_info.c                                 |     4 +-
 external/bsd/ntp/dist/ntpd/cmd_args.c                                      |    11 +-
 external/bsd/ntp/dist/ntpd/keyword-gen.c                                   |     4 +-
 external/bsd/ntp/dist/ntpd/ntp_config.c                                    |    22 +-
 external/bsd/ntp/dist/ntpd/ntp_control.c                                   |   144 +-
 external/bsd/ntp/dist/ntpd/ntp_crypto.c                                    |   125 +-
 external/bsd/ntp/dist/ntpd/ntp_filegen.c                                   |     2 +-
 external/bsd/ntp/dist/ntpd/ntp_io.c                                        |    32 +-
 external/bsd/ntp/dist/ntpd/ntp_keyword.h                                   |   973 ++++---
 external/bsd/ntp/dist/ntpd/ntp_leapsec.c                                   |    17 +-
 external/bsd/ntp/dist/ntpd/ntp_loopfilter.c                                |   180 +-
 external/bsd/ntp/dist/ntpd/ntp_parser.y                                    |     6 +-
 external/bsd/ntp/dist/ntpd/ntp_peer.c                                      |    22 +-
 external/bsd/ntp/dist/ntpd/ntp_proto.c                                     |    89 +-
 external/bsd/ntp/dist/ntpd/ntp_request.c                                   |     2 +-
 external/bsd/ntp/dist/ntpd/ntp_restrict.c                                  |     2 +-
 external/bsd/ntp/dist/ntpd/ntp_scanner.c                                   |     2 +-
 external/bsd/ntp/dist/ntpd/ntp_util.c                                      |     6 +-
 external/bsd/ntp/dist/ntpd/ntpd-opts.c                                     |   630 ++--
 external/bsd/ntp/dist/ntpd/ntpd-opts.h                                     |    75 +-
 external/bsd/ntp/dist/ntpd/ntpd.c                                          |     3 +-
 external/bsd/ntp/dist/ntpd/refclock_acts.c                                 |     2 +-
 external/bsd/ntp/dist/ntpd/refclock_arc.c                                  |     2 +-
 external/bsd/ntp/dist/ntpd/refclock_chu.c                                  |     2 +-
 external/bsd/ntp/dist/ntpd/refclock_gpsdjson.c                             |     4 +-
 external/bsd/ntp/dist/ntpd/refclock_heath.c                                |     2 +-
 external/bsd/ntp/dist/ntpd/refclock_irig.c                                 |     2 +-
 external/bsd/ntp/dist/ntpd/refclock_jjy.c                                  |     2 +-
 external/bsd/ntp/dist/ntpd/refclock_jupiter.c                              |     2 +-
 external/bsd/ntp/dist/ntpd/refclock_neoclock4x.c                           |     2 +-
 external/bsd/ntp/dist/ntpd/refclock_nmea.c                                 |     4 +-
 external/bsd/ntp/dist/ntpd/refclock_oncore.c                               |     2 +-
 external/bsd/ntp/dist/ntpd/refclock_palisade.c                             |    12 +-
 external/bsd/ntp/dist/ntpd/refclock_palisade.h                             |     3 +-
 external/bsd/ntp/dist/ntpd/refclock_parse.c                                |   875 +++---
 external/bsd/ntp/dist/ntpd/refclock_pcf.c                                  |     2 +-
 external/bsd/ntp/dist/ntpd/refclock_shm.c                                  |   204 +-
 external/bsd/ntp/dist/ntpd/refclock_true.c                                 |     2 +-
 external/bsd/ntp/dist/ntpd/refclock_wwv.c                                  |     2 +-
 external/bsd/ntp/dist/ntpdate/ntpdate.c                                    |     2 +-
 external/bsd/ntp/dist/ntpdc/ntpdc-opts.c                                   |   238 +-
 external/bsd/ntp/dist/ntpdc/ntpdc-opts.h                                   |    12 +-
 external/bsd/ntp/dist/ntpdc/ntpdc.c                                        |     2 +-
 external/bsd/ntp/dist/ntpdc/ntpdc.h                                        |     2 +-
 external/bsd/ntp/dist/ntpdc/ntpdc_ops.c                                    |     2 +-
 external/bsd/ntp/dist/ntpq/ntpq-opts.c                                     |   236 +-
 external/bsd/ntp/dist/ntpq/ntpq-opts.h                                     |    12 +-
 external/bsd/ntp/dist/ntpq/ntpq-subs.c                                     |     9 +-
 external/bsd/ntp/dist/ntpq/ntpq.c                                          |     2 +-
 external/bsd/ntp/dist/ntpq/ntpq.h                                          |     2 +-
 external/bsd/ntp/dist/ntpsnmpd/netsnmp_daemonize.c                         |     3 +-
 external/bsd/ntp/dist/ntpsnmpd/ntp_snmp.h                                  |     5 +-
 external/bsd/ntp/dist/ntpsnmpd/ntpsnmpd-opts.c                             |   160 +-
 external/bsd/ntp/dist/ntpsnmpd/ntpsnmpd-opts.h                             |    12 +-
 external/bsd/ntp/dist/parseutil/dcfd.c                                     |    64 +-
 external/bsd/ntp/dist/parseutil/testdcf.c                                  |    27 +-
 external/bsd/ntp/dist/sntp/crypto.c                                        |     2 +-
 external/bsd/ntp/dist/sntp/libevent/README                                 |   218 -
 external/bsd/ntp/dist/sntp/libevent/WIN32-Code/nmake/event2/event-config.h |     6 +-
 external/bsd/ntp/dist/sntp/libevent/WIN32-Code/tree.h                      |   679 +-----
 external/bsd/ntp/dist/sntp/libevent/buffer.c                               |    86 +-
 external/bsd/ntp/dist/sntp/libevent/bufferevent.c                          |    15 +-
 external/bsd/ntp/dist/sntp/libevent/bufferevent_async.c                    |    12 +-
 external/bsd/ntp/dist/sntp/libevent/bufferevent_filter.c                   |    71 +-
 external/bsd/ntp/dist/sntp/libevent/bufferevent_openssl.c                  |     4 +-
 external/bsd/ntp/dist/sntp/libevent/bufferevent_pair.c                     |    35 +-
 external/bsd/ntp/dist/sntp/libevent/evbuffer-internal.h                    |    16 +-
 external/bsd/ntp/dist/sntp/libevent/evdns.c                                |   115 +-
 external/bsd/ntp/dist/sntp/libevent/event.c                                |    50 +-
 external/bsd/ntp/dist/sntp/libevent/event_tagging.c                        |    17 +-
 external/bsd/ntp/dist/sntp/libevent/evrpc-internal.h                       |     3 +-
 external/bsd/ntp/dist/sntp/libevent/evthread-internal.h                    |     9 +-
 external/bsd/ntp/dist/sntp/libevent/evthread.c                             |    25 +-
 external/bsd/ntp/dist/sntp/libevent/evutil.c                               |    44 +-
 external/bsd/ntp/dist/sntp/libevent/evutil_time.c                          |    52 +-
 external/bsd/ntp/dist/sntp/libevent/ht-internal.h                          |     3 +-
 external/bsd/ntp/dist/sntp/libevent/http-internal.h                        |     4 +-
 external/bsd/ntp/dist/sntp/libevent/http.c                                 |    49 +-
 external/bsd/ntp/dist/sntp/libevent/include/event2/buffer.h                |    13 +-
 external/bsd/ntp/dist/sntp/libevent/include/event2/bufferevent.h           |    11 +-
 external/bsd/ntp/dist/sntp/libevent/include/event2/dns.h                   |    20 +-
 external/bsd/ntp/dist/sntp/libevent/include/event2/event.h                 |    12 +-
 external/bsd/ntp/dist/sntp/libevent/include/event2/http.h                  |    16 +-
 external/bsd/ntp/dist/sntp/libevent/include/event2/listener.h              |    11 +-
 external/bsd/ntp/dist/sntp/libevent/include/event2/util.h                  |    71 +-
 external/bsd/ntp/dist/sntp/libevent/kqueue.c                               |    19 +-
 external/bsd/ntp/dist/sntp/libevent/listener.c                             |     7 +-
 external/bsd/ntp/dist/sntp/libevent/m4/openldap-thread-check.m4            |   683 -----
 external/bsd/ntp/dist/sntp/libevent/m4/openldap.m4                         |  1131 ---------
 external/bsd/ntp/dist/sntp/libevent/sample/http-server.c                   |     9 +-
 external/bsd/ntp/dist/sntp/libevent/sample/https-client.c                  |    19 +-
 external/bsd/ntp/dist/sntp/libevent/test/regress.c                         |    39 +-
 external/bsd/ntp/dist/sntp/libevent/test/regress.h                         |     8 +-
 external/bsd/ntp/dist/sntp/libevent/test/regress_buffer.c                  |    55 +-
 external/bsd/ntp/dist/sntp/libevent/test/regress_bufferevent.c             |   154 +-
 external/bsd/ntp/dist/sntp/libevent/test/regress_dns.c                     |   157 +-
 external/bsd/ntp/dist/sntp/libevent/test/regress_finalize.c                |     3 +-
 external/bsd/ntp/dist/sntp/libevent/test/regress_http.c                    |   118 +-
 external/bsd/ntp/dist/sntp/libevent/test/regress_main.c                    |     6 +-
 external/bsd/ntp/dist/sntp/libevent/test/regress_minheap.c                 |     7 +-
 external/bsd/ntp/dist/sntp/libevent/test/regress_ssl.c                     |     3 +-
 external/bsd/ntp/dist/sntp/libevent/test/regress_thread.c                  |     7 +-
 external/bsd/ntp/dist/sntp/libevent/test/regress_util.c                    |    38 +-
 external/bsd/ntp/dist/sntp/libevent/test/regress_zlib.c                    |    19 +-
 external/bsd/ntp/dist/sntp/libevent/test/test-fdleak.c                     |    22 +-
 external/bsd/ntp/dist/sntp/libevent/test/test-ratelim.c                    |    13 +-
 external/bsd/ntp/dist/sntp/libevent/test/test-time.c                       |    17 +-
 external/bsd/ntp/dist/sntp/libevent/test/tinytest.c                        |    35 +-
 external/bsd/ntp/dist/sntp/libevent/test/tinytest.h                        |     4 +-
 external/bsd/ntp/dist/sntp/libevent/test/tinytest_macros.h                 |    29 +-
 external/bsd/ntp/dist/sntp/libevent/time-internal.h                        |     5 +-
 external/bsd/ntp/dist/sntp/libevent/util-internal.h                        |     4 +-
 external/bsd/ntp/dist/sntp/libopts/autoopts.h                              |     2 +-
 external/bsd/ntp/dist/sntp/libopts/autoopts/options.h                      |     2 +-
 external/bsd/ntp/dist/sntp/libopts/configfile.c                            |     2 +-
 external/bsd/ntp/dist/sntp/libopts/enum.c                                  |     2 +-
 external/bsd/ntp/dist/sntp/libopts/file.c                                  |     2 +-
 external/bsd/ntp/dist/sntp/libopts/find.c                                  |     2 +-
 external/bsd/ntp/dist/sntp/libopts/init.c                                  |     2 +-
 external/bsd/ntp/dist/sntp/libopts/load.c                                  |     2 +-
 external/bsd/ntp/dist/sntp/libopts/makeshell.c                             |     2 +-
 external/bsd/ntp/dist/sntp/libopts/nested.c                                |     2 +-
 external/bsd/ntp/dist/sntp/libopts/numeric.c                               |     2 +-
 external/bsd/ntp/dist/sntp/libopts/parse-duration.c                        |     2 +-
 external/bsd/ntp/dist/sntp/libopts/pgusage.c                               |     2 +-
 external/bsd/ntp/dist/sntp/libopts/reset.c                                 |     2 +-
 external/bsd/ntp/dist/sntp/libopts/save.c                                  |     2 +-
 external/bsd/ntp/dist/sntp/libopts/tokenize.c                              |     2 +-
 external/bsd/ntp/dist/sntp/libopts/usage.c                                 |     6 +-
 external/bsd/ntp/dist/sntp/main.c                                          |    24 +-
 external/bsd/ntp/dist/sntp/networking.c                                    |    21 +-
 external/bsd/ntp/dist/sntp/sntp-opts.c                                     |   346 +-
 external/bsd/ntp/dist/sntp/sntp-opts.h                                     |    12 +-
 external/bsd/ntp/dist/util/jitter.c                                        |     5 +-
 external/bsd/ntp/dist/util/jitter.h                                        |   403 ---
 external/bsd/ntp/dist/util/ntp-keygen-opts.c                               |   370 +-
 external/bsd/ntp/dist/util/ntp-keygen-opts.h                               |    12 +-
 external/bsd/ntp/dist/util/ntp-keygen.c                                    |    32 +-
 external/bsd/ntp/dist/util/ntptime.c                                       |     2 +-
 external/bsd/ntp/importdate                                                |     2 +-
 external/bsd/ntp/include/config.h                                          |    18 +-
 external/bsd/ntp/ntp2netbsd                                                |     9 +-
 external/bsd/ntp/scripts/mkver                                             |     2 +-
 214 files changed, 5685 insertions(+), 6960 deletions(-)

diffs (truncated from 23808 to 300 lines):

diff -r 9296dca8d651 -r ce40489ad38f external/bsd/ntp/dist/include/audio.h
--- a/external/bsd/ntp/dist/include/audio.h     Tue Apr 07 16:48:53 2015 +0000
+++ b/external/bsd/ntp/dist/include/audio.h     Tue Apr 07 17:34:18 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: audio.h,v 1.3 2014/12/19 20:43:14 christos Exp $       */
+/*     $NetBSD: audio.h,v 1.4 2015/04/07 17:34:18 christos Exp $       */
 
 /*
  * Header file for audio drivers
diff -r 9296dca8d651 -r ce40489ad38f external/bsd/ntp/dist/include/binio.h
--- a/external/bsd/ntp/dist/include/binio.h     Tue Apr 07 16:48:53 2015 +0000
+++ b/external/bsd/ntp/dist/include/binio.h     Tue Apr 07 17:34:18 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: binio.h,v 1.2 2014/12/19 20:43:14 christos Exp $       */
+/*     $NetBSD: binio.h,v 1.3 2015/04/07 17:34:18 christos Exp $       */
 
 /*
  * /src/NTP/ntp4-dev/include/binio.h,v 4.5 2005/04/16 17:32:10 kardel RELEASE_20050508_A
@@ -44,11 +44,21 @@
 long get_lsb_long (unsigned char **);
 void put_lsb_long (unsigned char **, long);
 
+#define get_lsb_int16( _x_ )   ((int16_t) get_lsb_short( _x_ ))
+#define get_lsb_uint16( _x_ )  ((uint16_t) get_lsb_short( _x_ ))
+#define get_lsb_int32( _x_ )   ((int32_t) get_lsb_long( _x_ ))
+#define get_lsb_uint32( _x_ )  ((uint32_t) get_lsb_long( _x_ ))
+
 long get_msb_short (unsigned char **);
 void put_msb_short (unsigned char **, long);
 long get_msb_long (unsigned char **);
 void put_msb_long (unsigned char **, long);
 
+#define get_msb_int16( _x_ )   ((int16_t) get_msb_short( _x_ ))
+#define get_msb_uint16( _x_ )  ((uint16_t) get_msb_short( _x_ ))
+#define get_msb_int32( _x_ )   ((int32_t) get_msb_long( _x_ ))
+#define get_msb_uint32( _x_ )  ((uint32_t) get_msb_long( _x_ ))
+
 #endif
 /*
  * History:
diff -r 9296dca8d651 -r ce40489ad38f external/bsd/ntp/dist/include/icom.h
--- a/external/bsd/ntp/dist/include/icom.h      Tue Apr 07 16:48:53 2015 +0000
+++ b/external/bsd/ntp/dist/include/icom.h      Tue Apr 07 17:34:18 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: icom.h,v 1.3 2014/12/19 20:43:14 christos Exp $        */
+/*     $NetBSD: icom.h,v 1.4 2015/04/07 17:34:18 christos Exp $        */
 
 /*
  * Header file for ICOM radios
diff -r 9296dca8d651 -r ce40489ad38f external/bsd/ntp/dist/include/mbg_gps166.h
--- a/external/bsd/ntp/dist/include/mbg_gps166.h        Tue Apr 07 16:48:53 2015 +0000
+++ b/external/bsd/ntp/dist/include/mbg_gps166.h        Tue Apr 07 17:34:18 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mbg_gps166.h,v 1.2 2014/12/19 20:43:14 christos Exp $  */
+/*     $NetBSD: mbg_gps166.h,v 1.3 2015/04/07 17:34:18 christos Exp $  */
 
 /*
  * /src/NTP/REPOSITORY/ntp4-dev/include/mbg_gps166.h,v 4.7 2006/06/22 18:41:43 kardel RELEASE_20060622_A
@@ -41,206 +41,459 @@
 #define MBG_GPS166_H
 
 
-/***************************************************************************/
-/*                                                                         */
-/*   File:         GPSSERIO.H                    4.1                       */
-/*                                                                         */
-/*   Project:      Common C Library                                        */
-/*                                                                         */
-/*   Compiler:     Borland C++                                             */
-/*                                                                         */
-/*   Author:       M. Burnicki,  Meinberg Funkuhren                        */
-/*                                                                         */
-/*                                                                         */
-/*   Description:                                                          */
-/*     This file defines structures and codes to be used to access GPS166  */
-/*     via its serial interface COM0. COM0 should be set to a high baud    */
-/*     rate, default is 19200.                                             */
-/*                                                                         */
-/*     Standard GPS166 serial operation is to send a time string that is   */
-/*     compatible with Meinberg UA31 or PZF535 DCF77 radio remote clocks.  */
-/*     That string can be transmitted automatically once per second, once  */
-/*     per minute or on request per ASCII '?'.                             */
-/*                                                                         */
-/*     Parameter setup or parameter readout works using blocks of binary   */
-/*     data which have to be isolated from the standard string. A block of */
-/*     data starts with a SOH code (ASCII Start Of Header, 0x01) followed  */
-/*     by a message header with constant length and a data portion with    */
-/*     variable length. The first field (cmd) of the message header holds  */
-/*     the command code rsp. the type of data to be transmitted. The next  */
-/*     field (len) gives the number of data bytes that are transmitted     */
-/*     after the header. This number ranges from 0 to sizeof( MSG_DATA ).  */
-/*     The third field (data_csum) holds a checksum of all data bytes and  */
-/*     the last field of the header finally holds the checksum of the.     */
-/*     header.                                                             */
-/*                                                                         */
-/***************************************************************************/
+/***************************************************************************
+ *
+ *  Definitions taken from Meinberg's gpsserio.h and gpsdefs.h files.
+ *
+ *  Author:  Martin Burnicki, Meinberg Funkuhren
+ *
+ *  Copyright (c) Meinberg Funkuhren, Bad Pyrmont, Germany
+ *
+ *  Description:
+ *    Structures and codes to be used to access Meinberg GPS clocks via
+ *    their serial interface COM0. COM0 should be set to a high baud rate,
+ *    default is 19200.
+ *
+ *    Standard Meinberg GPS serial operation is to send the Meinberg
+ *    standard time string automatically once per second, once per
+ *    minute, or on request per ASCII '?'.
+ *
+ *    GPS parameter setup or parameter readout uses blocks of binary
+ *    data which have to be isolated from the standard string. A block
+ *    of data starts with a SOH code (ASCII Start Of Header, 0x01)
+ *    followed by a message header with constant length and a block of
+ *    data with variable length.
+ *
+ *    The first field (cmd) of the message header holds the command
+ *    code resp. the type of data to be transmitted. The next field (len)
+ *    gives the number of data bytes that follow the header. This number
+ *    ranges from 0 to sizeof( MSG_DATA ). The third field (data_csum)
+ *    holds a checksum of all data bytes and the last field of the header
+ *    finally holds the checksum of the header itself.
+ *
+ ***************************************************************************/
 
-/* the control codes defined below are to be or'ed with a command/type code */
-
-#define GPS_REQACK    0x8000   /* to GPS166: request acknowledge */
-#define GPS_ACK       0x4000   /* from GPS166: acknowledge a command */
-#define GPS_NACK      0x2000   /* from GPS166: error receiving command */
-
-#define GPS_CTRL_MSK  0xF000   /* masks control code from command */
+/**
+ * @brief GPS epoch bias from ordinary time_t epoch
+ *
+ * The Unix time_t epoch is usually 1970-01-01 00:00 whereas
+ * the GPS epoch is 1980-01-06 00:00, so the difference is 10 years,
+ * plus 2 days due to leap years (1972 and 1976), plus the difference
+ * of the day-of-month (6 - 1), so:<br>
+ *
+ * time_t t = ( gps_week * ::SECS_PER_WEEK ) + sec_of_week + ::GPS_SEC_BIAS
+ */
+#define GPS_SEC_BIAS   315964800UL     // ( ( ( 10UL * 365UL ) + 2 + 5 ) * SECS_PER_DAY )
 
 
-/* The codes below specify commands/types of data to be supplied to GPS166: */
+#ifndef _COM_HS_DEFINED
+  /**
+   * @brief Enumeration of handshake modes
+   */
+  enum COM_HANSHAKE_MODES { HS_NONE, HS_XONXOFF, HS_RTSCTS, N_COM_HS };
+  #define _COM_HS_DEFINED
+#endif
+
+#ifndef _COM_PARM_DEFINED
+  /**
+   * @brief A data type to configure a serial port's baud rate
+   *
+   * @see ::MBG_BAUD_RATES
+   */
+  typedef int32_t BAUD_RATE;
+
+  /**
+   * @brief Indices used to identify a parameter in the framing string
+   *
+   * @see ::MBG_FRAMING_STRS
+   */
+  enum MBG_FRAMING_STR_IDXS { F_DBITS, F_PRTY, F_STBITS };
+
+  /**
+   * @brief A structure to store the configuration of a serial port
+   */
+  typedef struct
+  {
+    BAUD_RATE baud_rate;  ///< transmission speed, e.g. 19200L, see ::MBG_BAUD_RATES
+    char framing[4];      ///< ASCIIZ framing string, e.g. "8N1" or "7E2", see ::MBG_FRAMING_STRS
+    int16_t handshake;    ///< handshake mode, yet only ::HS_NONE supported
+
+  } COM_PARM;
+
+  #define _COM_PARM_DEFINED
+#endif
+
 
-/*                            GPS166 auto-message to host            */
-/*                            þ   host request, GPS166 response      */
-/*                            þ   þ   host download to GPS166        */
-/*                            þ   þ   þ                              */
-enum {  /*                    þ   þ   þ                              */
-  /* system data */
-  GPS_AUTO_ON = 0x000,   /* þ   þ   þ X þ enable auto-messages from GPS166 */
-  GPS_AUTO_OFF,          /* þ   þ   þ X þ disable auto-messages from GPS166 */
-  GPS_SW_REV,            /* þ   þ X þ   þ request software revision */
-  GPS_STAT,              /* þ   þ X þ   þ request status of buffered variables */
-  GPS_TIME,              /* þ X þ   þ X þ current time or capture or init board time */
-  GPS_POS_XYZ,           /* þ   þ X þ X þ current position in ECEF coords */
-  GPS_POS_LLA,           /* þ   þ X þ X þ current position in geographic coords */
-  GPS_TZDL,              /* þ   þ X þ X þ time zone / daylight saving */
-  GPS_PORT_PARM,         /* þ   þ X þ X þ parameters of the serial ports */
-  GPS_SYNTH,             /* þ   þ X þ X þ synthesizer's frequency and phase */
-  GPS_ANT_INFO,          /* þ X þ X þ   þ time diff after antenna disconnect */
-  GPS_UCAP,              /* þ X þ X þ   þ user capture */
+/**
+ * @brief Enumeration of modes supported for time string transmission
+ *
+ * This determines e.g. at which point in time a string starts
+ * to be transmitted via the serial port.
+ * Used with ::PORT_SETTINGS::mode.
+ *
+ * @see ::STR_MODE_MASKS
+ */
+enum STR_MODES
+{
+  STR_ON_REQ,     ///< transmission on request by received '?' character only
+  STR_PER_SEC,    ///< transmission automatically if second changes
+  STR_PER_MIN,    ///< transmission automatically if minute changes
+  STR_AUTO,       ///< transmission automatically if required, e.g. on capture event
+  STR_ON_REQ_SEC, ///< transmission if second changes and a request has been received before
+  N_STR_MODE      ///< the number of known modes
+};
+
+
+/**
+ * The number of serial ports which are at least available
+ * even with very old GPS receiver models. For devices providing
+ * a ::RECEIVER_INFO structure the number of provided COM ports
+ * is available in ::RECEIVER_INFO::n_com_ports.
+ */
+#define DEFAULT_N_COM   2
+
 
-  /* GPS data */
-  GPS_CFGH = 0x100,      /* þ   þ X þ X þ SVs' configuration and health codes */
-  GPS_ALM,               /* þ   þ X þ X þ one SV's almanac */
-  GPS_EPH,               /* þ   þ X þ X þ one SV's ephemeris */
-  GPS_UTC,               /* þ   þ X þ X þ UTC correction parameters */
-  GPS_IONO,              /* þ   þ X þ X þ ionospheric correction parameters */
-  GPS_ASCII_MSG          /* þ   þ X þ   þ the GPS ASCII message */
+/**
+ * @brief A The structure used to store the configuration of two serial ports
+ *
+ * @deprecated This structure is deprecated, ::PORT_SETTINGS and related structures
+ * should be used instead, if supported by the device.
+ */
+typedef struct
+{
+  COM_PARM com[DEFAULT_N_COM];    ///< COM0 and COM1 settings
+  uint8_t mode[DEFAULT_N_COM];    ///< COM0 and COM1 output mode
+
+} PORT_PARM;
+
+
+/**
+ * @brief The type of a GPS command code
+ *
+ * @see ::GPS_CMD_CODES
+ */
+typedef uint16_t GPS_CMD;
+
+
+/**
+ * @brief Control codes to be or'ed with a particular command/type code
+ */
+enum GPS_CMD_CTRL_CODES
+{
+  GPS_REQACK = 0x8000,   ///< to device: request acknowledge
+  GPS_ACK    = 0x4000,   ///< from device: acknowledge a command
+  GPS_NACK   = 0x2000,   ///< from device: error evaluating a command
 };
 
-/*
- * modelled after GPSDEFS.H Revision 1.5
+#define GPS_CTRL_MSK  0xF000   ///< bit mask of all ::GPS_CMD_CTRL_CODES
+
+
+/**
+ * @brief Command codes for the binary protocol
+ *
+ * These codes specify commands and associated data types used by Meinberg's
+ * binary protocol to exchange data with a device via serial port, direct USB,
+ * or socket I/O.
+ *
+ * Some commands and associated data structures can be read (r) from a device, others
+ * can be written (w) to the device, and some can also be sent automatically (a) by
+ * a device after a ::GPS_AUTO_ON command has been sent to the device.
+ * The individual command codes are marked with (rwa) accordingly, where '-' is used
+ * to indicate that a particular mode is not supported.
+ *
+ * @note Not all command code are supported by all devices.
+ * See the hints for a particular command.
+ *
+ * @note If ::GPS_ALM, ::GPS_EPH or a code named ..._IDX is sent to retrieve
+ * some data from a device then an uint16_t parameter must be also supplied
+ * in order to specify the index number of the data set to be returned.
+ * The valid index range depends on the command code.
+ * For ::GPS_ALM and ::GPS_EPH the index is the SV number which may be 0 or
+ * ::MIN_SVNO_GPS to ::MAX_SVNO_GPS. If the number is 0 then all ::N_SVNO_GPS



Home | Main Index | Thread Index | Old Index