Dimse.Message.Assembler (Dimse v0.8.7)

Copy Markdown View Source

Stateful accumulator for reassembling DIMSE messages from PDV fragments.

Phases

  1. :command — accumulating command set fragments
  2. :data — accumulating data set fragments (if CommandDataSetType != 0x0101)
  3. :complete — message fully assembled

Summary

Functions

Feeds a PDV item into the assembler.

Creates a new assembler.

Types

phase()

@type phase() :: :command | :data | :complete

t()

@type t() :: %Dimse.Message.Assembler{
  command: map() | nil,
  command_buffer: iodata(),
  context_id: pos_integer() | nil,
  data_buffer: iodata(),
  phase: phase()
}

Functions

feed(asm, pdv)

@spec feed(t(), Dimse.Pdu.PresentationDataValue.t()) ::
  {:continue, t()} | {:complete, Dimse.Message.t()} | {:error, term()}

Feeds a PDV item into the assembler.

Returns:

  • {:continue, assembler} — more fragments needed
  • {:complete, message} — message fully assembled
  • {:error, reason} — protocol error

new()

@spec new() :: t()

Creates a new assembler.