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

Function InsertService

source/src/cip/cipcommon.c:346–371  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

344}
345
346void InsertService(const CipClass *const class,
347 const EipUint8 service_number,
348 const CipServiceFunction service_function,
349 char *const service_name) {
350
351 CipServiceStruct *service = class->services; /* get a pointer to the service array*/
352 OPENER_TRACE_INFO("%s, number of services:%d, service number:%d\n",
353 class->class_name, class->number_of_services,
354 service_number);
355 OPENER_ASSERT(service != NULL)
356 /* adding a service to a class that was not declared to have services is not allowed*/
357 for (int i = 0; i < class->number_of_services; i++) /* Iterate over all service slots attached to the class */
358 {
359 if (service->service_number == service_number||
360 service->service_function == NULL) /* found undefined service slot*/
361 {
362 service->service_number = service_number; /* fill in service number*/
363 service->service_function = service_function; /* fill in function address*/
364 service->name = service_name;
365 return;
366 }
367 ++service;
368 }
369 OPENER_ASSERT(0)
370 /* adding more services than were declared is a no-no*/
371}
372
373CipAttributeStruct *GetCipAttribute(const CipInstance *const instance,
374 const EipUint16 attribute_number) {

Callers 8

CreateAssemblyClassFunction · 0.85
CipMessageRouterInitFunction · 0.85
CipIdentityInitFunction · 0.85
CipQoSInitFunction · 0.85
CreateCipClassFunction · 0.85
CipTcpIpInterfaceInitFunction · 0.85
CipEthernetLinkInitFunction · 0.85
ConnectionManagerInitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected