Received: from huey.udel.edu by mail.eecis.udel.edu id aa25649;
          16 Sep 1998 05:50 EDT
Received: from copland.udel.edu by huey.udel.edu id aa10720;
          16 Sep 1998 05:50 EDT
Received: from post.thorcom.com (post.thorcom.com [194.75.130.70])
	by copland.udel.edu (8.8.8/8.8.8) with ESMTP id FAA16681
	for <mills@udel.edu>; Wed, 16 Sep 1998 05:50:19 -0400 (EDT)
Received: from mike.int.thorcom.com ([192.168.1.100] helo=mike)
	by post.thorcom.com with smtp (Exim 2.02 #1)
	id 0zJEDn-0000NQ-00; Wed, 16 Sep 1998 10:49:59 +0100
Message-ID: <001001bde155$92542620$6401a8c0@mike.int.thorcom.com>
From: "Michael J. Tubby B.Sc. G8TIC" <Mike.Tubby@thorcom.co.uk>
To: kardel@informatik.uni-erlangen.de, mills@udel.edu
MMDF-Warning:  Parse error in original version of preceding line at huey.udel.edu
Cc: djk@dirku.demon.co.uk
MMDF-Warning:  Parse error in original version of preceding line at huey.udel.edu
Subject: XNTPD ver 5.93 patch for GPS Week Number Roll Over
Date: Wed, 16 Sep 1998 10:37:07 +0100
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 4.72.3155.0
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0

David & Frank,

Please find enclosed a small patch for XNTPD Ver 5.93
to fix the GPS Week Number Roll Over problem on
Trimble GPS receivers which use the TSIP binary interface.

The problem is that GPS (as specified in ICD-GPS-200)
uses week numbering whichs runs 0-1023 and back to zero.

Many GPS receivers will malfunction or give incorrect dates
after midnight 21st Aug 1999 - the first GPS week number
rollover.  For a fuller description of the problem please see:

http://www.thorcom.co.uk/documents/wrno.html

Older GPS receivers output week numbers in the range
0-1023 and then reset to zero on a rollover. Trimble's latest
GPS receivers have an "extended week number" which
just continues to count upwards after week 1023.

The patch (below) is for the clk_trimstip.c module and fixes
the problem by adding 1024 weeks to the week number
if appropriate. The patch will work with all Trimble TSIP
interface receivers and allow those without an "extended
week number" to work until the year 2017 (an extra 1024
weeks) approximately.


--- /tmp/clk_trimtsip.c Mon Sep 14 18:19:03 1998
+++ libparse/clk_trimtsip.c     Mon Sep 14 18:22:52 1998
@@ -357,6 +357,9 @@
                  clock->flags = PARSEB_POWERUP;
                  return CVT_OK;
                }
+               if (week < 950) {
+                       week += 1024;
+               }

                /* time OK */
                secint  = secs; /* integer part, hopefully */


Hope you find this useful and can include it in the next release.


Regards


Mike Tubby (mike.tubby@thorcom.co.uk)



