Module pdu_syntax

SMPP PDU Library

Library functions for the SMPP PDU manipulation.

Changes 0.1 -> 0.2

[10 Feb 2004] [01 Mar 2004]

Changes 0.2 -> 1.2

[13 Jul 2004] .

Copyright © 2003 - 2004 Enrique Marcote Peña

Version: 1.2, {19 Mar 2003} 11:56:46.

Authors: Enrique Marcote Peña (mpquique_at_users.sourceforge.net) [web site: http://oserl.sourceforge.net/].

Description

SMPP PDU Library

Library functions for the SMPP PDU manipulation.

Changes 0.1 -> 0.2

[10 Feb 2004] [01 Mar 2004]

Changes 0.2 -> 1.2

[13 Jul 2004]

Function Index

command_id/1Gets the command_id of a PDU (binary or dictionary).
new_pdu/4Creates a new PDU dictionary for a given the CommandId, a CommandStatus, SequenceNumber and a list of initial body values.
pack/2Packs an SMPP PDU dictionary into the corresponding byte stream given the PduType.
sequence_number/1Gets the sequence_number of a PDU (binary or dictionary).
unpack/2Unpacks an SMPP Binary PDU (octet stream) into the corresponding PDU dictionary according to PduType.

Function Details

command_id/1

command_id(PduDict::Pdu) -> int()

Gets the command_id of a PDU (binary or dictionary).

If the PDU is malformed and the command_id can not be found, the function crashes.

new_pdu/4

new_pdu(CommandId, CommandStatus, SequenceNumber, Body) -> PduDict

Creates a new PDU dictionary for a given the CommandId, a CommandStatus, SequenceNumber and a list of initial body values. Every pair of the Body list must be on the form {Key, Value}.

The Body parameter list is ignored whenever CommandStatus is different from 0.

pack/2

pack(PduDict, Type::PduType) -> Result

Packs an SMPP PDU dictionary into the corresponding byte stream given the PduType.

This function generates an exception if command_id, command_status, sequence_number are not present on the PDU dictionary.

Possible return values are:

See also: pack_body/3.

sequence_number/1

sequence_number(PduDict::Pdu) -> int()

Gets the sequence_number of a PDU (binary or dictionary).

If the PDU is malformed and the sequence_number can not be found, the function crashes.

unpack/2

unpack(BinaryPdu, Type::PduType) -> Result

Unpacks an SMPP Binary PDU (octet stream) into the corresponding PDU dictionary according to PduType.

This function returns:

See also: unpack_body/3.