Skip to content
Start free evaluation

pdcomm_gem_configure_equipment

Function

Attaches a GEM equipment role to a stopped TCP endpoint.

PdcommStatus pdcomm_gem_configure_equipment(PdcommTcpEndpoint *endpoint, const PdcommGemEquipmentOptions *options)

Declared in: #include <pdcomm_gem.h>

The model and software revision are copied and later sent in S1F2, S1F13, and S1F14. The equipment starts in the communication state #PDCOMM_GEM_DISCONNECTED and in the given initial control state.

Parameters

NameDescription
endpointLive TCP endpoint in #PDCOMM_TCP_STOPPED without a GEM role.
optionsEquipment options; read during the call only.

Returns

#PDCOMM_OK when the role was attached; #PDCOMM_INVALID_ARGUMENT when endpoint or options is NULL, a struct_size is too small, version or reserved is invalid, a text pointer is NULL with a nonzero length, the model or revision is not ASCII, initial_control or online_mode is invalid (including #PDCOMM_GEM_ATTEMPT_ONLINE), or max_variables, max_value_bytes, or an item limit is zero; #PDCOMM_LIMIT_EXCEEDED when the identity reply does not fit the item limits; #PDCOMM_ALLOCATION_FAILED when the registry or identity storage cannot be allocated; #PDCOMM_INVALID_STATE when the endpoint is not stopped or already has a GEM role; #PDCOMM_POISONED when the endpoint is poisoned.

Notes

  • Configure the role once, before pdcomm_tcp_start(). It stays attached until pdcomm_tcp_destroy().