Skip to content

Commit

Permalink
use real time, not sdr sample based
Browse files Browse the repository at this point in the history
  • Loading branch information
rpatel3001 committed Apr 23, 2024
1 parent 53e2c61 commit 951a3ce
Showing 1 changed file with 27 additions and 6 deletions.
33 changes: 27 additions & 6 deletions iridium-toolkit.patch
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)

0 comments on commit 951a3ce

Please sign in to comment.