pynetdicom.pdu.A_ASSOCIATE_RJ

class pynetdicom.pdu.A_ASSOCIATE_RJ(primitive: A_ASSOCIATE | None = None)[source]

An A-ASSOCIATE-RJ PDU.

An A-ASSOCIATE-RJ PDU is sent by an association acceptor to indicate that association negotiation has been unsuccessful.

pdu_type

The PDU Type field value (0x03).

Type:

int

reason_diagnostic

The Reason/Diagnostic field value.

Type:

int

result

The Result field value.

Type:

int

source

The Source field value.

Type:

int

Notes

An A-ASSOCIATE-RJ PDU requires the following parameters:

  • PDU type (1, fixed value, 0x03)

  • PDU length (1)

  • Result (1)

  • Source (1)

  • Reason/Diagnostic (1)

Encoding

When encoded, an A-ASSOCIATE-RJ PDU has the following structure, taken from Table 9-21 (offsets shown with Python indexing). PDUs are always encoded using Big Endian.

Offset

Length

Description

0

1

PDU type

1

1

Reserved

2

4

PDU length

6

1

Reserved

7

1

Result

8

1

Source

9

1

Reason/diagnostic

References

__init__(primitive: A_ASSOCIATE | None = None) None[source]

Initialise a new A-ASSOCIATE-RJ PDU.

Parameters:

primitive (pynetdicom.pdu_primitive.A_ASSOCIATE) – The primitive to use to initialise the PDU.

Methods

__init__([primitive])

Initialise a new A-ASSOCIATE-RJ PDU.

decode(bytestream)

Decode bytestream and use the result to set the field values of the PDU.

encode()

Return the encoded PDU as bytes.

from_primitive(primitive)

Setup the current PDU using an A-ASSOCIATE (reject) primitive.

to_primitive()

Return an A-ASSOCIATE (reject) primitive from the current PDU.

Attributes

pdu_length

Return the PDU Length field value as an int.

pdu_type

Return the PDU Type field value as int.

reason_str

Return a str describing the Reason/Diagnostic field value.

result_str

Return a str describing the Result field value.

source_str

Return a str describing the Source field value.

from_primitive(primitive: A_ASSOCIATE) None[source]

Setup the current PDU using an A-ASSOCIATE (reject) primitive.

Parameters:

primitive (pdu_primitives.A_ASSOCIATE) – The primitive to use to set the current PDU field values.

property pdu_length: int

Return the PDU Length field value as an int.

property reason_str: str

Return a str describing the Reason/Diagnostic field value.

property result_str: str

Return a str describing the Result field value.

property source_str: str

Return a str describing the Source field value.

to_primitive() A_ASSOCIATE[source]

Return an A-ASSOCIATE (reject) primitive from the current PDU.

Returns:

The primitive representation of the current PDU.

Return type:

pdu_primitives.A_ASSOCIATE