PdcommTcpEventInfo
Struct
Decoded description of an event, filled by pdcomm_tcp_event_info().
typedef struct PdcommTcpEventInfo { ... } PdcommTcpEventInfoFields 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 abortedbody_length
Field
Length of the message body in bytes; nonzero only for #PDCOMM_TCP_RECEIVED.
size_t body_lengthcode
Field
Kind-specific code.
uint32_t codeA 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 detailA 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_statefunction
Field
Function (header byte 3); valid when PdcommTcpEventInfo::header_present is 1.
uint8_t functionheader_present
Field
1 when the header fields are valid.
uint8_t header_presentAlways 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_replykind
Field
Event kind, such as #PDCOMM_TCP_RECEIVED.
uint32_t kindp_type
Field
Header PType; valid when PdcommTcpEventInfo::header_present is 1.
uint8_t p_typereply_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_expecteds_type
Field
Header SType (0 for data messages); valid when PdcommTcpEventInfo::header_present is 1.
uint8_t s_typesession_id
Field
Session ID from the message header; valid when PdcommTcpEventInfo::header_present is 1.
uint16_t session_idstream
Field
Stream (header byte 2 without the W-bit); valid when PdcommTcpEventInfo::header_present is 1.
uint8_t streamstruct_size
Field
Structure size in bytes.
size_t struct_sizeSet 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_statetoken
Field
Token of the event.
PdcommTcpToken tokenFor 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 value1value2
Field
Second code-specific value, as described for each failure reason, protocol error, and frame error.
uint64_t value2