pdcomm_gem_formatted_program_select
Function
Selects a stored program by PPID and returns its selection token.
PdcommStatus pdcomm_gem_formatted_program_select(PdcommTcpEndpoint *endpoint, const PdcommSecsItem *id, PdcommGemFormattedProgramSelectionToken *output)The program is copied from the store. Selecting the same unchanged entry again in the same session returns the existing token without creating a new selection; any other selection replaces the previous one.
Parameters
| Name | Description |
|---|---|
endpoint | Equipment endpoint with the formatted program query service configured. |
id | PPID item (ASCII or Binary) of a stored program. |
output | Token storage. Set struct_size, version, and reserved first. Once the header is accepted the token is zeroed, so it stays zeroed after any later failure. |
Returns
#PDCOMM_OK on success; #PDCOMM_INVALID_ARGUMENT when endpoint, id, or output is NULL, the token header is invalid, or id is not an ASCII or Binary item; #PDCOMM_INVALID_STATE when the endpoint is not an Equipment, the query service is not configured, or the store has no program with this PPID; #PDCOMM_LIMIT_EXCEEDED when the program's encoded size exceeds the endpoint's SECS-II message_bytes limit or the selection revision is exhausted; #PDCOMM_BACKPRESSURE when a staged TCP event must be drained first; #PDCOMM_ALLOCATION_FAILED; #PDCOMM_POISONED when the endpoint is poisoned.
Notes
- Thread safety: serialize with every other call on
endpoint.