| 146 | } |
| 147 | |
| 148 | EipStatus CipIdentityInit() { |
| 149 | |
| 150 | CipClass *class = CreateCipClass(kIdentityClassCode, |
| 151 | 0, /* # of non-default class attributes */ |
| 152 | 7, /* # highest class attribute number*/ |
| 153 | 2, /* # of class services*/ |
| 154 | 7, /* # of instance attributes*/ |
| 155 | 7, /* # highest instance attribute number*/ |
| 156 | 3, /* # of instance services*/ |
| 157 | 1, /* # of instances*/ |
| 158 | "identity", /* # class name (for debug)*/ |
| 159 | 1, /* # class revision*/ |
| 160 | &InitializeCipIdentiy); /* # function pointer for initialization*/ |
| 161 | |
| 162 | if (class == 0) { |
| 163 | return kEipStatusError; |
| 164 | } |
| 165 | |
| 166 | CipInstance *instance = GetCipInstance(class, 1); |
| 167 | InsertAttribute(instance, 1, kCipUint, &vendor_id_, kGetableSingleAndAll); |
| 168 | InsertAttribute(instance, 2, kCipUint, &device_type_, kGetableSingleAndAll); |
| 169 | InsertAttribute(instance, 3, kCipUint, &product_code_, kGetableSingleAndAll); |
| 170 | InsertAttribute(instance, 4, kCipUsintUsint, &revision_, |
| 171 | kGetableSingleAndAll); |
| 172 | InsertAttribute(instance, 5, kCipWord, &status_, kGetableSingleAndAll); |
| 173 | InsertAttribute(instance, 6, kCipUdint, &serial_number_, |
| 174 | kGetableSingleAndAll); |
| 175 | InsertAttribute(instance, 7, kCipShortString, &product_name_, |
| 176 | kGetableSingleAndAll); |
| 177 | InsertService(class, kGetAttributeSingle, &GetAttributeSingle, |
| 178 | "GetAttributeSingle"); |
| 179 | InsertService(class, kGetAttributeAll, &GetAttributeAll, "GetAttributeAll"); |
| 180 | InsertService(class, kReset, &Reset, "Reset"); |
| 181 | |
| 182 | return kEipStatusOk; |
| 183 | } |
| 184 | |
| 185 | void CipIdentitySetExtendedDeviceStatus(CipIdentityExtendedStatus extended_status) { |
| 186 | OPENER_TRACE_INFO("Setting extended status: %x", extended_status); |
no test coverage detected