Skip to content

Commit

Permalink
Merge pull request #14 from ianrenton/feature/report-zero-alt-tracks-…
Browse files Browse the repository at this point in the history
…as-on-ground

Feature/report zero alt tracks as on ground
  • Loading branch information
jvde-github authored Jul 28, 2024
2 parents 3d5ef4c + 415a2f3 commit 146b60d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ais2adsb.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,12 @@ def sendBaseStation(decoded):
dstr = now_utc.strftime("%Y/%m/%d")
tstr = now_utc.strftime("%H:%M:%S.%f")[:-3]
callsign = "V:" + ("00000" + str(decoded['mmsi']) )[-6:]
ground_flag = 1 if alt < 1 else 0
alt_str = "" if alt < 1 else str(alt)

global client_socket

spos = f'MSG,2,1,0,{ICAO},1,{dstr},{tstr},{dstr},{tstr},,{alt},{speed},{heading},{lat},{lon},,,,,,0\n'
spos = f'MSG,2,1,0,{ICAO},1,{dstr},{tstr},{dstr},{tstr},,{alt_str},{speed},{heading},{lat},{lon},,,,,,{ground_flag}\n'
scs = f'MSG,1,1,0,{ICAO},1,{dstr},{tstr},{dstr},{tstr},{callsign},,,,,,,,,,,\n'

if client_socket == None:
Expand Down

0 comments on commit 146b60d

Please sign in to comment.