pdcomm_gem_host_request
Function
Sends a host request to the equipment.
PdcommStatus pdcomm_gem_host_request(PdcommTcpEndpoint *endpoint, uint32_t kind, const uint32_t *ids, size_t count, PdcommTcpToken *out_token)Supported kinds and messages:
- #PDCOMM_GEM_ARE_YOU_ONLINE: S1F1; the S1F2 reply gives #PDCOMM_GEM_EQUIPMENT_IDENTITY.
- #PDCOMM_GEM_STATUS_VALUES: S1F3 with the given SVIDs; the S1F4 reply gives #PDCOMM_GEM_VALUES_RECEIVED.
- #PDCOMM_GEM_STATUS_NAMES: S1F11 with the given SVIDs; the S1F12 reply gives #PDCOMM_GEM_NAMES_RECEIVED.
- #PDCOMM_GEM_OFFLINE: S1F15; the S1F16 reply gives #PDCOMM_GEM_OFFLINE_ACK.
- #PDCOMM_GEM_ONLINE: S1F17; the S1F18 reply gives #PDCOMM_GEM_ONLINE_ACK.
Only the status kinds accept identifiers; NULL and 0 request all status variables. Identifiers are sent as U4 items and copied before the message is sent, so they can be correlated with the reply. They count against max_pending_ids until the request completes.
Parameters
| Name | Description |
|---|---|
endpoint | Live TCP endpoint with a host role. |
kind | Request kind from the list above. |
ids | Status variable IDs (SVIDs), or NULL when count is 0. |
count | Number of IDs; must be 0 for non-status kinds. |
out_token | Receives the transaction token; all zero on failure. Must not be NULL. |
Returns
#PDCOMM_OK when the request was queued (not when it was answered); #PDCOMM_INVALID_ARGUMENT when endpoint or out_token is NULL, kind is not supported, a non-status kind has IDs, or ids is NULL with a nonzero count; #PDCOMM_INVALID_STATE when the endpoint has no host role or the communication state is not #PDCOMM_GEM_COMMUNICATING; #PDCOMM_LIMIT_EXCEEDED when the IDs exceed max_pending_ids or the message exceeds the item limits; #PDCOMM_BACKPRESSURE when a staged TCP event exists, all 32 pending slots are used, or the TCP send queue is full; #PDCOMM_ALLOCATION_FAILED or another TCP status when the message cannot be queued; #PDCOMM_POISONED when the endpoint is poisoned.