SMPPEX.Pdu.Multipart.extract_from_message
You're seeing just the function
extract_from_message
, go back to SMPPEX.Pdu.Multipart module for more information.
Specs
extract_from_message(binary()) :: extract_result()
Extracts multipart information from binary message.
Returns one of the following:
{:ok, :single, message}
if themessage
does not contain any multipart information and represents a single message. The outcomingmessage
is cleared from UDH bytes.{:ok, {ref_num, count, seq_num}, message}
if the original message contains multipart information in UDH fields. The outcomingmessage
is cleared from UDH bytes.{:error, reason}
Example
iex> data = <<0x05, 0x00, 0x03, 0x03, 0x02, 0x01, "message">>
iex> SMPPEX.Pdu.Multipart.extract_from_message(data)
{:ok, {3,2,1}, "message"}
iex> data = <<0x06, 0x08, 0x04, 0x00, 0x03, 0x02, 0x01, "message">>
iex> SMPPEX.Pdu.Multipart.extract_from_message(data)
{:ok, {3,2,1}, "message"}