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); 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(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; else rx_packet.type = Short_Packet;
int packet_length = (rx_packet.type == framer_packet_type(Short_Packet)) ? 56 : 112; 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"] bds2 = data["bds2"]
if bds2 != 0: 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: 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: elif bds1 == 1:
retstr = "Type 20 link capability report from %x: ACS: 0x%x, BCS: 0x%x, ECS: 0x%x, continues %i" \ retstr = "Type %i 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"]) % (msgtype, ecc, data["acs"], data["bcs"], data["ecs"], data["cfs"])
elif bds1 == 2: elif bds1 == 2:
retstr = "Type 20 identification from %x with text %s" % (ecc, self.parseMB_id(data)) retstr = "Type %i identification from %x with text %s" % (msgtype, ecc, self.parseMB_id(data))
elif bds2 == 3: elif bds1 == 3:
retstr = "Type 20 TCAS report from %x: " % ecc retstr = "Type %i TCAS report from %x: " % (msgtype, ecc)
tti = data["tti"] tti = data["tti"]
if tti == 1: if tti == 1:
(resolutions, complements, rat, mte, threat_id) = self.parseMB_TCAS_threatid(data) (resolutions, complements, rat, mte, threat_id) = self.parseMB_TCAS_threatid(data)
@ -221,9 +221,9 @@ class output_print(air_modes.parse):
else: else:
retstr = "No handler for BDS1 == %i from %x" % (bds1, ecc) retstr = "No handler for BDS1 == %i from %x" % (bds1, ecc)
# if(msgtype == 20): if(msgtype == 20):
# retstr += " at %ift" % altitude retstr += " at %ift" % alt
# else: else:
# retstr += " ident %x" % ident retstr += " ident %x" % ident
return retstr return retstr