Zweiter Versuch FMS Debug

This commit is contained in:
MrMurdog 2024-01-17 09:44:39 +01:00
parent 4cffe7aeb8
commit 13c4ee0764

View file

@ -111,7 +111,27 @@ class BoswatchPlugin(PluginBase):
requests.request("POST", url, headers=headers, data=payload)
def _getInfo(get_tacticalInfo2, get_direction2):
# BosMon-Telegramin expected assembly group, direction and tsi in one field
# structure (binary as hex in base10):
# Byte 1: assembly group; Byte 2: Direction; Byte 3+4: tactic short info
info = 0
# assembly group:
info = info + 1 # + b0001 (Assumption: is in every time 1 (no output from multimon-ng))
# direction:
if get_direction2 == "1":
info = info + 2 # + b0010
# tsi:
if "IV" in get_tacticalInfo2:
info = info + 12 # + b1100
elif "III" in get_tacticalInfo2:
info = info + 8 # + b1000
elif "II" in get_tacticalInfo2:
info = info + 4 # + b0100
# "I" is nothing to do + b0000
return info
def _BosmonRequest_Zvei(self, BM_hostname, BM_port, BM_user, BM_passwd, BM_channel, get_zvei_adress):
@ -123,26 +143,4 @@ class BoswatchPlugin(PluginBase):
'Authorization': encode(BM_user, BM_passwd)
}
requests.request("POST", url, headers=headers, data=payload)
def _getInfo(get_tacticalInfo, get_direction):
# BosMon-Telegramin expected assembly group, direction and tsi in one field
# structure (binary as hex in base10):
# Byte 1: assembly group; Byte 2: Direction; Byte 3+4: tactic short info
info = 0
# assembly group:
info = info + 1 # + b0001 (Assumption: is in every time 1 (no output from multimon-ng))
# direction:
if get_direction == "1":
info = info + 2 # + b0010
# tsi:
if "IV" in get_tacticalInfo:
info = info + 12 # + b1100
elif "III" in get_tacticalInfo:
info = info + 8 # + b1000
elif "II" in get_tacticalInfo:
info = info + 4 # + b0100
# "I" is nothing to do + b0000
return info
requests.request("POST", url, headers=headers, data=payload)