pdcomm_gem_begin_communication
Function
Sends S1F13 Establish Communications Request.
PdcommStatus pdcomm_gem_begin_communication(PdcommTcpEndpoint *endpoint, PdcommTcpToken *out_token)A host sends an empty List; equipment sends its model and software revision. The communication state changes to #PDCOMM_GEM_WAITING_ACK. The S1F14 reply, handled by pdcomm_gem_handle_event(), moves it to #PDCOMM_GEM_COMMUNICATING (COMMACK 0) or back to #PDCOMM_GEM_NOT_COMMUNICATING. A timeout, cancellation, or invalid reply also returns to #PDCOMM_GEM_NOT_COMMUNICATING; the library does not retry.
Parameters
| Name | Description |
|---|---|
endpoint | Live TCP endpoint with a GEM role. |
out_token | Receives the transaction token; all zero on failure. Must not be NULL. |
Returns
#PDCOMM_OK when S1F13 was queued; #PDCOMM_INVALID_ARGUMENT when endpoint or out_token is NULL; #PDCOMM_INVALID_STATE when the endpoint has no GEM role or the communication state is not #PDCOMM_GEM_NOT_COMMUNICATING; #PDCOMM_BACKPRESSURE when a staged TCP event exists, all 32 pending slots are used, or the TCP send queue is full; #PDCOMM_LIMIT_EXCEEDED, #PDCOMM_ALLOCATION_FAILED, or another TCP status when the message cannot be built or queued; #PDCOMM_POISONED when the endpoint is poisoned.