Skip to content
Start free evaluation

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)

Declared in: #include <pdcomm_gem.h>

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

NameDescription
endpointLive TCP endpoint with a host role.
kindRequest kind from the list above.
idsStatus variable IDs (SVIDs), or NULL when count is 0.
countNumber of IDs; must be 0 for non-status kinds.
out_tokenReceives 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.