Skip to content
Start free evaluation

PdcommTcpEventInfo

Struct

Decoded description of an event, filled by pdcomm_tcp_event_info().

typedef struct PdcommTcpEventInfo { ... } PdcommTcpEventInfo

Declared in: #include <pdcomm_tcp.h>

Fields that do not apply to the event kind are 0.

Members

aborted

Field

For a received reply: 1 when the reply is an SxF0 abort (function 0).

uint8_t aborted

Declared in: #include <pdcomm_tcp.h>

body_length

Field

Length of the message body in bytes; nonzero only for #PDCOMM_TCP_RECEIVED.

size_t body_length

Declared in: #include <pdcomm_tcp.h>

code

Field

Kind-specific code.

uint32_t code

Declared in: #include <pdcomm_tcp.h>

A failure reason (such as #PDCOMM_TCP_T3_TIMEOUT) for #PDCOMM_TCP_FAILED, a protocol error (such as #PDCOMM_TCP_INVALID_FRAME) for #PDCOMM_TCP_PROTOCOL_ERROR, or a socket operation (such as #PDCOMM_TCP_OP_READ) for #PDCOMM_TCP_TRANSPORT_ERROR.

detail

Field

Kind-specific detail.

uint32_t detail

Declared in: #include <pdcomm_tcp.h>

A frame error (PDCOMM_TCP_FRAME_*) for #PDCOMM_TCP_INVALID_FRAME, or a portable I/O error kind (PDCOMM_TCP_IO_*) for #PDCOMM_TCP_TRANSPORT_ERROR.

from_state

Field

Previous state for #PDCOMM_TCP_STATE_CHANGED.

uint32_t from_state

Declared in: #include <pdcomm_tcp.h>

function

Field

Function (header byte 3); valid when PdcommTcpEventInfo::header_present is 1.

uint8_t function

Declared in: #include <pdcomm_tcp.h>

header_present

Field

1 when the header fields are valid.

uint8_t header_present

Declared in: #include <pdcomm_tcp.h>

Always 1 for #PDCOMM_TCP_RECEIVED; 1 for #PDCOMM_TCP_PROTOCOL_ERROR when the error relates to a received header. For control messages, PdcommTcpEventInfo::stream and PdcommTcpEventInfo::function hold the raw header bytes 2 and 3.

is_reply

Field

For #PDCOMM_TCP_RECEIVED: 1 for a reply to one of your requests, 0 for a primary.

uint8_t is_reply

Declared in: #include <pdcomm_tcp.h>

kind

Field

Event kind, such as #PDCOMM_TCP_RECEIVED.

uint32_t kind

Declared in: #include <pdcomm_tcp.h>

p_type

Field

Header PType; valid when PdcommTcpEventInfo::header_present is 1.

uint8_t p_type

Declared in: #include <pdcomm_tcp.h>

reply_expected

Field

1 when the header's W-bit is set (a reply is expected); valid when PdcommTcpEventInfo::header_present is 1.

uint8_t reply_expected

Declared in: #include <pdcomm_tcp.h>

s_type

Field

Header SType (0 for data messages); valid when PdcommTcpEventInfo::header_present is 1.

uint8_t s_type

Declared in: #include <pdcomm_tcp.h>

session_id

Field

Session ID from the message header; valid when PdcommTcpEventInfo::header_present is 1.

uint16_t session_id

Declared in: #include <pdcomm_tcp.h>

stream

Field

Stream (header byte 2 without the W-bit); valid when PdcommTcpEventInfo::header_present is 1.

uint8_t stream

Declared in: #include <pdcomm_tcp.h>

struct_size

Field

Structure size in bytes.

size_t struct_size

Declared in: #include <pdcomm_tcp.h>

Set it to sizeof(PdcommTcpEventInfo) or larger before the call. On success the library stores the size of the layout it wrote.

to_state

Field

New state for #PDCOMM_TCP_STATE_CHANGED.

uint32_t to_state

Declared in: #include <pdcomm_tcp.h>

token

Field

Token of the event.

PdcommTcpToken token

Declared in: #include <pdcomm_tcp.h>

For a received primary it identifies the primary (endpoint, generation, system bytes); for a reply, a failure, or #PDCOMM_TCP_W0_WRITTEN it equals the token of the original request; for protocol and transport errors it carries the endpoint and generation, plus the system bytes of the offending header when one is present. It is all zeros for #PDCOMM_TCP_STATE_CHANGED.

value1

Field

First code-specific value, as described for each failure reason, protocol error, and frame error.

uint64_t value1

Declared in: #include <pdcomm_tcp.h>

value2

Field

Second code-specific value, as described for each failure reason, protocol error, and frame error.

uint64_t value2

Declared in: #include <pdcomm_tcp.h>