From f5e10473372cbabe015d01fe96427ac4e3484c84 Mon Sep 17 00:00:00 2001 From: Colin Kuebler Date: Wed, 15 May 2024 16:02:47 -0400 Subject: [PATCH] feat(client): expose net and adr from remote, if available --- lib/client.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/client.js b/lib/client.js index ebf4c6bd..c9283daf 100644 --- a/lib/client.js +++ b/lib/client.js @@ -478,6 +478,12 @@ class Client extends EventEmitter { } header.apduType = baApdu.getDecodedType(buffer, offset); header.expectingReply = !!(result.funct & baEnum.NpduControlBit.EXPECTING_REPLY); + if (result.source && result.source.target) { + // SNET of the host. Integer. + header.sender.net = result.source.target.net; + // SADR of the host. Integer[]. + header.sender.adr = result.source.target.adr; + } this._handlePdu(buffer, offset, msgLength, header); }