MCPcopy Create free account
hub / github.com/EIPStackGroup/OpENer / GetFreeExplicitConnection

Function GetFreeExplicitConnection

source/src/cip/cipclass3connection.c:61–69  ·  view source on GitHub ↗

@brief Searches and returns a free explicit connection slot * * @return Free explicit connection slot, or NULL if no slot is free */

Source from the content-addressed store, hash-verified

59 * @return Free explicit connection slot, or NULL if no slot is free
60 */
61CipConnectionObject *GetFreeExplicitConnection(void) {
62 for (size_t i = 0; i < OPENER_CIP_NUM_EXPLICIT_CONNS; ++i) {
63 if (ConnectionObjectGetState(&(explicit_connection_object_pool[i]) ) ==
64 kConnectionObjectStateNonExistent) {
65 return &(explicit_connection_object_pool[i]);
66 }
67 }
68 return NULL;
69}
70
71void InitializeClass3ConnectionData(void) {
72 memset( explicit_connection_object_pool, 0,

Callers 1

Calls 1

ConnectionObjectGetStateFunction · 0.85

Tested by

no test coverage detected