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

Function GetCipAttribute

source/src/cip/cipcommon.c:373–388  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

371}
372
373CipAttributeStruct *GetCipAttribute(const CipInstance *const instance,
374 const EipUint16 attribute_number) {
375
376 CipAttributeStruct *attribute = instance->attributes; /* init pointer to array of attributes*/
377 for (int i = 0; i < instance->cip_class->number_of_attributes; i++) {
378 if (attribute_number == attribute->attribute_number) {
379 return attribute;
380 } else {
381 ++attribute;
382 }
383 }
384
385 OPENER_TRACE_WARN("attribute %d not defined\n", attribute_number);
386
387 return NULL;
388}
389
390/* TODO this needs to check for buffer overflow*/
391EipStatus GetAttributeSingle(CipInstance *RESTRICT const instance,

Calls

no outgoing calls

Tested by

no test coverage detected