Parses the shared envelope (downlink format, CRC remainder) out of a raw
Mode-S message. decodeModeSMessage uses this to decide how to
route a message before calling the per-type decoders - those decoders
take a raw ME field or an already-extracted field value, not the
envelope itself.
import { parseModeSFrame } from'@squawk/mode-s';
constenvelope = parseModeSFrame(rawMessageBytes); if (envelope.downlinkFormat === 17 && envelope.crcRemainder === 0) { // unmodified DF17 extended squitter, safe to decode further }
Parses the shared envelope (downlink format, CRC remainder) out of a raw Mode-S message. decodeModeSMessage uses this to decide how to route a message before calling the per-type decoders - those decoders take a raw ME field or an already-extracted field value, not the envelope itself.