[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gpsd-commit-watch
Subject:    [Gpsd-commit-watch] r4022 - in trunk: . test
From:       esr at BerliOS <esr () mail ! berlios ! de>
Date:       2006-11-29 10:18:33
Message-ID: 200611291018.kATAIXs4028358 () sheep ! berlios ! de
[Download RAW message or body]

Author: esr
Date: 2006-11-29 11:18:32 +0100 (Wed, 29 Nov 2006)
New Revision: 4022

Modified:
   trunk/gpsfake.py
   trunk/gpsfake.xml
   trunk/test/trimble-lassen_iq-3dfix.log
Log:
gpsfake can now recognize and gather TSIP packets.


Modified: trunk/gpsfake.py
===================================================================
--- trunk/gpsfake.py	2006-11-29 10:03:34 UTC (rev 4021)
+++ trunk/gpsfake.py	2006-11-29 10:18:32 UTC (rev 4022)
@@ -131,6 +131,10 @@
             self.packtype = "SiRF binary"
             self.legend = "gpsfake: packet %d"
             self.textual = False
+        elif self.sentences[0][0] == '\x10':
+            self.packtype = "TSIP binary"
+            self.legend = "gpsfake: packet %d"
+            self.textual = False
         elif self.type == "RTCM":
             self.packtype = "RTCM"
             self.legend = None
@@ -165,6 +169,22 @@
             id = ord(third) | (ord(fourth) << 8)
             ndata = ord(fifth) | (ord(sixth) << 8)
             return "\xff\x81" + third + fourth + fifth + sixth + self.logfp.read(2*ndata+6)
+        elif first == '\x10':					# TSIP
+            packet = first + second
+            delcnt = 0
+            while True:
+                next = self.logfp.read(1)
+                if not next:
+                    return ''
+                packet += next
+                if next == '\x10':
+                    delcnt += 1
+                elif next == '\x03':
+                    if delcnt % 2:
+                        break
+                else:
+                    delcnt = 0
+            return packet
         else:
             raise PacketError("unknown packet type, leader %s, (0x%x)" % (first, ord(first)))
 

Modified: trunk/gpsfake.xml
===================================================================
--- trunk/gpsfake.xml	2006-11-29 10:03:34 UTC (rev 4021)
+++ trunk/gpsfake.xml	2006-11-29 10:18:32 UTC (rev 4022)
@@ -47,9 +47,9 @@
 privileges, and can be run concurrently with a production 
 <application>gpsd</application> instance without causing problems.</para>
 
-<para>The logfile may be of NMEA, SiRF packets, or Zodiac packets.
-Leading lines beginning with # will be treated as comments and
-ignored.</para>
+<para>The logfile may be of NMEA, SiRF packets, TSIP packets, or
+Zodiac packets.  Leading lines beginning with # will be treated as
+comments and ignored.</para>
 
 <para>The <application>gpsd</application> instance is run in
 foreground.  The thread sending fake GPS data to the daemon 

Modified: trunk/test/trimble-lassen_iq-3dfix.log
===================================================================
(Binary files differ)

_______________________________________________
Gpsd-commit-watch mailing list
Gpsd-commit-watch@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/gpsd-commit-watch
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic