mirror of
https://codeberg.org/ET-Kiel/tk102gpx.git
synced 2026-05-01 13:44:23 +02:00
Compare commits
2 commits
6a3bef6e1a
...
03f011fb80
| Author | SHA1 | Date | |
|---|---|---|---|
| 03f011fb80 | |||
| a95e164595 |
2 changed files with 8 additions and 4 deletions
2
cron.sh
2
cron.sh
|
|
@ -1,3 +1,3 @@
|
|||
#! /bin/bash
|
||||
|
||||
make -C /home/ncrs1/stephan/tk102gpx TIMELIMIT=-t1d tk102-1.gpx tk102-1.png tk102-2.gpx tk102-2.png
|
||||
make -C /home/ncrs1/stephan/tk102gpx TIMELIMIT=-t1d tk102-1.gpx tk102-1.png tk102-2.gpx tk102-2.png tk102-1.txt tk102-2.txt
|
||||
|
|
|
|||
10
tk102gpx.py
10
tk102gpx.py
|
|
@ -55,9 +55,11 @@ for o,v in options:
|
|||
serial = time.strftime("%y%m%d%H%M", time.gmtime(time.time()-t)).encode()
|
||||
if verbose:
|
||||
print(f"--serial={serial}", file=sys.stderr)
|
||||
|
||||
"""
|
||||
2403182137,<E9><F0><8F><CC>^]<CB><FE><CD>g<EE>^]}<FE><FD><DC>_<FF>P,GPRMC,213722.000,A,5416.3748,N,00952.1328,E,0.01,0.00,180324,,,A*6C,F,imei:013777002752663,110<D1>i
|
||||
"""
|
||||
tk_re = re.compile(b"".join((
|
||||
b"(?P<SERIAL>23[0-9]+),",
|
||||
b"(?P<SERIAL>24[0-9]+),",
|
||||
b"(?P<PHONE>[^,]+(,[^,]*)?),",
|
||||
b"GPRMC,",
|
||||
b"(?P<TIME>[0-9]{6}(\.[0-9]+)?),",
|
||||
|
|
@ -76,7 +78,7 @@ tk_re = re.compile(b"".join((
|
|||
b"(?P<MESSAGE>[^,]+,)?",
|
||||
b"imei:(?P<IMEI>[0-9]+),",
|
||||
b"(?P<LEN>[0-9]{3})",
|
||||
b"(?P<BCKS>2[^23]|[^2][^2])?"
|
||||
b"(?P<BCKS>2[^234]|[^2][^2])?"
|
||||
)), flags=re.DOTALL)
|
||||
|
||||
def gprmc2deg(d,dd):
|
||||
|
|
@ -114,6 +116,8 @@ class TKGPX(gpxpy.gpx.GPX):
|
|||
while data or follow or files:
|
||||
m = tk_re.search(data)
|
||||
while not m:
|
||||
if verbose >= 3:
|
||||
print(len(data), repr(data[-80:]))
|
||||
ndata = inp.read(0x100000)
|
||||
while not ndata and files:
|
||||
inp.close()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue