Dimse.Message (Dimse v0.8.7)

Copy Markdown View Source

DIMSE message assembly from P-DATA-TF fragments.

A DIMSE message consists of a command set (always one P-DATA fragment with the command flag set) followed by zero or one data sets (one or more P-DATA fragments with the command flag cleared). Messages may span multiple P-DATA-TF PDUs when the data exceeds the negotiated max PDU length.

Fragment Assembly Rules (PS3.7 Section 6.3.1)

  1. A command set is carried in PDVs with is_command: true
  2. The last command fragment has is_last: true
  3. If CommandDataSetType != 0x0101, a data set follows
  4. Data set fragments have is_command: false
  5. The last data fragment has is_last: true
  6. All fragments for a message use the same presentation context ID

Summary

Functions

Fragments a DIMSE message into P-DATA-TF PDUs respecting max PDU length.

Types

t()

@type t() :: %Dimse.Message{
  command: map() | nil,
  context_id: pos_integer() | nil,
  data: binary() | nil
}

Functions

fragment(command_set, data, context_id, max_pdu_length)

@spec fragment(map(), binary() | nil, pos_integer(), pos_integer()) :: [
  Dimse.Pdu.PDataTf.t()
]

Fragments a DIMSE message into P-DATA-TF PDUs respecting max PDU length.

Returns a list of Dimse.Pdu.PDataTf structs ready for encoding.