Dimse.Pdu.Encoder (Dimse v0.8.7)

Copy Markdown View Source

Encodes Dimse.Pdu structs into binary iodata for transmission.

Produces iodata (not flat binaries) to avoid unnecessary copying. The caller can pass the result directly to :gen_tcp.send/2 which accepts iodata.

Implements the wire format defined in PS3.8 Section 9.3.

Usage

iodata = Dimse.Pdu.Encoder.encode(%Dimse.Pdu.AssociateRq{...})
:ok = :gen_tcp.send(socket, iodata)

Summary

Functions

Encodes a PDU struct into iodata.

Functions

encode(pdu)

@spec encode(struct()) :: iodata()

Encodes a PDU struct into iodata.

Returns iodata suitable for sending over a TCP socket.