pdcomm_gem_formatted_program_query_seed
Function
Adds or replaces a program in the Equipment store (compatibility alias).
PdcommStatus pdcomm_gem_formatted_program_query_seed(PdcommTcpEndpoint *endpoint, const PdcommSecsItem *id, const char *model, size_t model_length, const char *software_revision, size_t software_revision_length, const PdcommGemFormattedProgramQueryCommand *commands, size_t command_count)Equipment only. Equivalent to pdcomm_gem_formatted_program_store_put() with #PDCOMM_GEM_FORMATTED_PROGRAM_UPSERT, with these differences: every CCODE must be ASCII, and a program that cannot be encoded as an S7F26 reply reports #PDCOMM_INVALID_DATA. New code should prefer the store function.
Parameters
| Name | Description |
|---|---|
endpoint | Equipment endpoint with this service configured. |
id | PPID: a nonempty ASCII or Binary item of at most 120 bytes. |
model | MDLN: at most 20 ASCII bytes. May be NULL when model_length is 0. |
model_length | Length of model in bytes. |
software_revision | SOFTREV: at most 20 ASCII bytes. May be NULL when software_revision_length is 0. |
software_revision_length | Length of software_revision in bytes. |
commands | Array of command_count process commands. May be NULL when command_count is 0. |
command_count | Number of commands. |
Returns
#PDCOMM_OK when the store holds the program; #PDCOMM_INVALID_ARGUMENT when endpoint or id is NULL, a required array or item pointer is NULL, or the PPID, MDLN, SOFTREV, or a CCODE is invalid; #PDCOMM_INVALID_STATE when the endpoint is not an Equipment, the service is not configured, or a transfer response is updating the store; #PDCOMM_LIMIT_EXCEEDED when a command or parameter limit is exceeded, an item exceeds the endpoint's SECS-II limits, or a store limit would be exceeded; #PDCOMM_INVALID_DATA when the program cannot be encoded as an S7F26 reply within the endpoint's SECS-II limits; #PDCOMM_BACKPRESSURE when a staged TCP event must be drained first; #PDCOMM_ALLOCATION_FAILED; #PDCOMM_POISONED when the endpoint is poisoned.
Notes
- Ownership: all inputs stay owned by the caller.
- Thread safety: serialize with every other call on
endpoint.