edgeport - v1.0.3
    Preparing search index...

    Function decodePdu

    • Decodes one complete, already-framed SMPP PDU.

      Reads the header, then dispatches on command_id to parse the body, returning a DecodedPdu discriminated on command. The buffer must hold exactly one PDU whose command_length matches its size. Commands an ESME never has to parse the body of are rejected with a ProtocolError so the session can answer them with a generic_nack.

      Parameters

      • bytes: Uint8Array

        A buffer beginning with a single complete PDU.

      Returns DecodedPdu

      The decoded PDU.

      If the header is malformed or the command is unsupported.

      1.0.3

      import { decodePdu, Command } from 'edgeport/smpp';

      const pdu = decodePdu(respBytes);
      if (pdu.command === Command.SubmitSmResp) console.log(pdu.messageId);