Skip to content

Commit

Permalink
allow numeric airline code
Browse files Browse the repository at this point in the history
  • Loading branch information
rpatel3001 committed Nov 24, 2024
1 parent 00ce6ed commit ad6e34a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/MessageDecoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export class MessageDecoder {
// C-Band puts a 10 char header in front of some message types
// First 4 chars are some kind of message number
// Last 6 chars are the flight number
let cband = message.text.match(/^(?<msgno>[A-Z]\d{2}[A-Z])(?<airline>[A-Z]{2})(?<number>[0-9]{4})/);
let cband = message.text.match(/^(?<msgno>[A-Z]\d{2}[A-Z])(?<airline>[A-Z0-9]{2})(?<number>[0-9]{4})/);
if (cband?.groups) {
message.text = message.text.substring(10);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/plugins/Label_4N.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class Label_4N extends DecoderPlugin {
ResultFormatter.departureAirport(decodeResult, message.text.substring(8, 11));
ResultFormatter.arrivalAirport(decodeResult, message.text.substring(13, 16));
ResultFormatter.position(decodeResult, CoordinateUtils.decodeStringCoordinatesDecimalMinutes(message.text.substring(30, 45).replace(/^(.)0/, "$1")));
ResultFormatter.altitude(decodeResult, Number(messge.text.substring(48, 51)) * 100);
ResultFormatter.altitude(decodeResult, Number(message.text.substring(48, 51)) * 100);
ResultFormatter.unknownArr(decodeResult, [message.text.substring(2, 4), message.text.substring(19, 29)], " ");
} else if (fields.length === 33) {
// variant 2
Expand Down

0 comments on commit ad6e34a

Please sign in to comment.