Skip to content

Commit 087a063

Browse files
committed
fix when using Controller and ENIP Layers simultaneously
1 parent 1d674b4 commit 087a063

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/enip/index.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class ENIP extends Socket {
2828
error: { code: null, msg: null }
2929
};
3030

31-
this.properties = {
31+
this.plcProperties = {
3232
vendorID: null,
3333
deviceType: null,
3434
productCode: null,
@@ -237,25 +237,25 @@ class ENIP extends Socket {
237237
);
238238

239239
let ptr = 24; // Other data is not relevant.
240-
this.properties.vendorID = listData.readUInt16LE(ptr);
240+
this.plcProperties.vendorID = listData.readUInt16LE(ptr);
241241
ptr+=2;
242-
this.properties.deviceType = listData.readUInt16LE(ptr);
242+
this.plcProperties.deviceType = listData.readUInt16LE(ptr);
243243
ptr+=2;
244-
this.properties.productCode = listData.readUInt16LE(ptr);
244+
this.plcProperties.productCode = listData.readUInt16LE(ptr);
245245
ptr+=2;
246-
this.properties.majorRevision = listData.readUInt8(ptr);
246+
this.plcProperties.majorRevision = listData.readUInt8(ptr);
247247
ptr+=1;
248-
this.properties.minorRevision = listData.readUInt8(ptr);
248+
this.plcProperties.minorRevision = listData.readUInt8(ptr);
249249
ptr+=1;
250-
this.properties.status = listData.readUInt16LE(ptr);
250+
this.plcProperties.status = listData.readUInt16LE(ptr);
251251
ptr+=2;
252-
this.properties.serialNumber = listData.readUInt32LE(ptr);
252+
this.plcProperties.serialNumber = listData.readUInt32LE(ptr);
253253
ptr+=4;
254-
this.properties.productNameLength = listData.readUInt8(ptr);
254+
this.plcProperties.productNameLength = listData.readUInt8(ptr);
255255
ptr+=1;
256-
this.properties.productName = listData.toString("ascii",ptr,listData.length-1);
257-
ptr+=this.properties.productNameLength;
258-
this.properties.state = listData.readUInt8(ptr);
256+
this.plcProperties.productName = listData.toString("ascii",ptr,listData.length-1);
257+
ptr+=this.plcProperties.productNameLength;
258+
this.plcProperties.state = listData.readUInt8(ptr);
259259

260260
// Clean Up Local Listeners
261261
this.removeAllListeners("ListIdentity Received");
@@ -266,7 +266,7 @@ class ENIP extends Socket {
266266
this.state.TCP.establishing = false;
267267
this.state.TCP.established = false;
268268

269-
return this.properties;
269+
return this.plcProperties;
270270
}
271271

272272
/**

0 commit comments

Comments
 (0)