From 951a3ce55d452e805c3cc081a8b1470740e81fae Mon Sep 17 00:00:00 2001 From: rpatel3001 Date: Mon, 22 Apr 2024 22:04:36 -0400 Subject: [PATCH] use real time, not sdr sample based --- iridium-toolkit.patch | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/iridium-toolkit.patch b/iridium-toolkit.patch index 3672b16..ba136dd 100644 --- a/iridium-toolkit.patch +++ b/iridium-toolkit.patch @@ -1,3 +1,24 @@ +diff --git a/iridiumtk/reassembler/base.py b/iridiumtk/reassembler/base.py +index fa36d5c..656cdc1 100755 +--- a/iridiumtk/reassembler/base.py ++++ b/iridiumtk/reassembler/base.py +@@ -3,6 +3,7 @@ + + import sys + import datetime ++import time + import math + + from util import base_freq, channel_width, channelize_str, parse_channel +@@ -58,7 +59,7 @@ class MyObject(object): + self.level=0 + + if self.ftype=='p': +- self.time=float(self.starttime)+self.mstime/1000 ++ self.time=time.time() + elif self.ftype=='j': # deperec + self.time=self.mstime + self.timens=int(self.mstime*(10**9)) diff --git a/iridiumtk/reassembler/ida.py b/iridiumtk/reassembler/ida.py index 0938146..177be65 100755 --- a/iridiumtk/reassembler/ida.py @@ -7,28 +28,28 @@ index 0938146..177be65 100755 self.odata=m.data self.ofreq=m.frequency + self.olevel=m.level - + ok=False for (idx,(freq,time,ctr,dat,cont,ul)) in enumerate(self.buf[:]): diff --git a/iridiumtk/reassembler/sbd.py b/iridiumtk/reassembler/sbd.py -index 103c1c0..43982de 100755 +index 103c1c0..aa687f1 100755 --- a/iridiumtk/reassembler/sbd.py +++ b/iridiumtk/reassembler/sbd.py @@ -319,7 +319,7 @@ class ReassembleIDASBDACARS(ReassembleIDASBD): if len(q.errors)>0 and not 'showerrs' in config.args: return - + - q.timestamp = datetime.datetime.fromtimestamp(q.time).strftime("%Y-%m-%dT%H:%M:%S%z") + q.timestamp = datetime.datetime.fromtimestamp(q.time, datetime.timezone.utc).strftime("%Y-%m-%dT%H:%M:%S") - + while len(q.f_reg)>0 and q.f_reg[0:1]==b'.': q.f_reg=q.f_reg[1:] @@ -362,6 +362,8 @@ class ReassembleIDASBDACARS(ReassembleIDASBD): # that we want to include in the output. For example, we could include the raw SBD message in the output. # Or possibly other embedded modes if they are present in the SBD message. - + + out['freq'] = self.ofreq + out['level'] = self.olevel out['header'] = q.hdr.hex() - + print(json.dumps(out), file=outfile)