@squawk
    Preparing search index...

    Function parseModeSFrame

    • 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';

      const envelope = parseModeSFrame(rawMessageBytes);
      if (envelope.downlinkFormat === 17 && envelope.crcRemainder === 0) {
      // unmodified DF17 extended squitter, safe to decode further
      }

      Parameters

      • bytes: Uint8Array

        Raw message bytes (7 or 14 bytes).

      Returns ModeSMessageEnvelope

      The parsed envelope.