Skip to content
Start free evaluation

pdcomm_secs1_create

Function

Creates a stopped SECS-I endpoint.

PdcommStatus pdcomm_secs1_create(const PdcommSecs1Io *io, const PdcommSecs1Options *options, PdcommSecs1Endpoint **out)

Declared in: #include <pdcomm_secs1.h>

Validates all inputs without calling either callback, copies the callback table and options, and binds the endpoint to the calling thread. The new endpoint has generation 1 and performs no I/O until it is started and polled.

Parameters

NameDescription
ioCallback table. struct_size must be at least sizeof(PdcommSecs1Io), and context, read, and write must not be NULL.
optionsLine settings and limits; see ::PdcommSecs1Options for the rules each field must satisfy.
outReceives the endpoint. Set to NULL first, so it is NULL after every failure.

Returns

#PDCOMM_OK on success; #PDCOMM_INVALID_ARGUMENT when a pointer is NULL, a struct_size is too small, version or a reserved field is wrong, priority is unknown, a timer is zero, or the limits are zero or inconsistent; #PDCOMM_ALLOCATION_FAILED when the event queue of max_events entries cannot be reserved; #PDCOMM_LIMIT_EXCEEDED when the process has run out of endpoint identifiers; #PDCOMM_LICENSE_REQUIRED (16, defined in pdcomm.h) when no license grants the secs-gem module (checked after the arguments); #PDCOMM_INTERNAL_ERROR when a panic was contained.

Notes

  • Ownership: release the endpoint with pdcomm_secs1_destroy() on the creating thread. The endpoint borrows io->context; no operating system handle is accepted or closed by this API.