SMPPEX.Pdu.new

You're seeing just the function new, go back to SMPPEX.Pdu module for more information.
Link to this function

new(header, mandatory_fields \\ %{}, optional_fields \\ %{})

View Source

Specs

new(header(), map(), map()) :: t()

Construct a new Pdu from header, mandatory fields and optional(TLV) fields.

Header may be either an integer, then it is treated as command id, or a tuple {command_id, command_status, sequence_number}

Each Pdu is created with a unique ref field, by which one can later trace Pdu's identity.

Examples

iex(1)> SMPPEX.Pdu.new(1)
%SMPPEX.Pdu{command_id: 1, command_status: 0, mandatory: %{}, optional: %{},
ref: #Reference<0.0.3.215>, sequence_number: 0}
iex(2)> SMPPEX.Pdu.new({1, 0, 123}, %{system_id: "sid", password: "pass"}, %{})
%SMPPEX.Pdu{command_id: 1, command_status: 0,
mandatory: %{password: "pass", system_id: "sid"}, optional: %{},
ref: #Reference<0.0.3.219>, sequence_number: 123}