Fixed TCAS packet reporting -- the slicer wasn't reporting long pkt type for types 20/21. Hardcoded constant.

This commit is contained in:
Nick Foster 2012-10-17 17:56:49 -07:00
parent 3a358b2334
commit 5f89eba234
2 changed files with 12 additions and 12 deletions

View File

@ -134,7 +134,7 @@ int air_modes_slicer::work(int noutput_items,
slice_result_t slice_result = slicer(in[i+j*2], in[i+j*2+1], rx_packet.reference_level);
if(slice_result.decision) pkt_hdr += 1 << (4-j);
}
if(pkt_hdr == 17) rx_packet.type = Long_Packet;
if(pkt_hdr == 17 or pkt_hdr == 20 or pkt_hdr == 21) rx_packet.type = Long_Packet;
else rx_packet.type = Short_Packet;
int packet_length = (rx_packet.type == framer_packet_type(Short_Packet)) ? 56 : 112;

View File

@ -194,17 +194,17 @@ class output_print(air_modes.parse):
bds2 = data["bds2"]
if bds2 != 0:
retstr = "No handler for BDS2 == %i from %x" % (bds2, ecc)
retstr = "No handler in type %i for BDS2 == %i from %x" % (msgtype, bds2, ecc)
elif bds1 == 0:
retstr = "No handler for BDS1 == 0 from %x" % ecc
retstr = "No handler in type %i for BDS1 == 0 from %x" % (msgtype, ecc)
elif bds1 == 1:
retstr = "Type 20 link capability report from %x: ACS: 0x%x, BCS: 0x%x, ECS: 0x%x, continues %i" \
% (ecc, data["acs"], data["bcs"], data["ecs"], data["cfs"])
retstr = "Type %i link capability report from %x: ACS: 0x%x, BCS: 0x%x, ECS: 0x%x, continues %i" \
% (msgtype, ecc, data["acs"], data["bcs"], data["ecs"], data["cfs"])
elif bds1 == 2:
retstr = "Type 20 identification from %x with text %s" % (ecc, self.parseMB_id(data))
elif bds2 == 3:
retstr = "Type 20 TCAS report from %x: " % ecc
retstr = "Type %i identification from %x with text %s" % (msgtype, ecc, self.parseMB_id(data))
elif bds1 == 3:
retstr = "Type %i TCAS report from %x: " % (msgtype, ecc)
tti = data["tti"]
if tti == 1:
(resolutions, complements, rat, mte, threat_id) = self.parseMB_TCAS_threatid(data)
@ -221,9 +221,9 @@ class output_print(air_modes.parse):
else:
retstr = "No handler for BDS1 == %i from %x" % (bds1, ecc)
# if(msgtype == 20):
# retstr += " at %ift" % altitude
# else:
# retstr += " ident %x" % ident
if(msgtype == 20):
retstr += " at %ift" % alt
else:
retstr += " ident %x" % ident
return retstr