| 133 | } |
| 134 | |
| 135 | CipInstance *GetCipInstance(const CipClass *RESTRICT const cip_class, |
| 136 | EipUint32 instance_number) { |
| 137 | |
| 138 | if (instance_number == 0) { |
| 139 | return (CipInstance *) cip_class; /* if the instance number is zero, return the class object itself*/ |
| 140 | |
| 141 | } |
| 142 | /* pointer to linked list of instances from the class object*/ |
| 143 | for (CipInstance *instance = cip_class->instances; instance; instance = |
| 144 | instance->next) /* follow the list*/ |
| 145 | { |
| 146 | if (instance->instance_number == instance_number) { |
| 147 | return instance; /* if the number matches, return the instance*/ |
| 148 | } |
| 149 | } |
| 150 | |
| 151 | return NULL; |
| 152 | } |
| 153 | |
| 154 | EipStatus RegisterCipClass(CipClass *cip_class) { |
| 155 | CipMessageRouterObject **message_router_object = &g_first_object; |
no outgoing calls
no test coverage detected