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

Function NotifyAssemblyConnectedDataReceived

source/src/cip/cipassembly.c:118–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116}
117
118EipStatus NotifyAssemblyConnectedDataReceived(CipInstance *const instance,
119 const EipUint8 *const data,
120 const EipUint16 data_length) {
121 /* empty path (path size = 0) need to be checked and taken care of in future */
122 /* copy received data to Attribute 3 */
123 CipByteArray *assembly_byte_array =
124 (CipByteArray *) instance->attributes->data;
125 if(assembly_byte_array->length != data_length) {
126 OPENER_TRACE_ERR("wrong amount of data arrived for assembly object\n");
127 return kEipStatusError; /*TODO question should we notify the application that wrong data has been received???*/
128 }
129 else{
130 memcpy(assembly_byte_array->data, data, data_length);
131 /* call the application that new data arrived */
132 }
133
134 return AfterAssemblyDataReceived(instance);
135}
136
137EipStatus SetAssemblyAttributeSingle(CipInstance *const instance,
138 CipMessageRouterRequest *const message_router_request,

Callers 2

HandleConfigDataFunction · 0.85

Calls 1

Tested by

no test coverage detected