Skip to content

Commit

Permalink
Set the SBS "isonground" flag to true for ships or aircraft with zero…
Browse files Browse the repository at this point in the history
… altitude.
  • Loading branch information
ianrenton committed Jul 28, 2024
1 parent e61e8f1 commit 5e8483c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ais2adsb.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,11 @@ 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

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},{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 5e8483c

Please sign in to comment.