major change to snmp node to not stringify octet string type.

This commit is contained in:
Dave Conway-Jones 2023-03-15 10:22:34 +00:00
parent bd15c5d6dd
commit a55be34bc0
No known key found for this signature in database
GPG Key ID: 88BA2B8A411BE9FF
3 changed files with 8 additions and 5 deletions

View File

@ -9,6 +9,9 @@ fetch values from SNMP enabled hosts. Supports v1, v2c and v3.
* SNMP table - Simple SNMP oid table fetcher
* SNMP walker - Simple SNMP oid walker fetcher
## v2 Breaking Change
v2 has a breaking change in that the single snmp node no longer tries to stringify an octet string type (04). This makes it consistent with the other nodes in this bundle. this means the user now has to convert to a string if required but has better control of how they wish to do that.
Install
-------

View File

@ -1,9 +1,9 @@
{
"name" : "node-red-node-snmp",
"version" : "1.0.6",
"version" : "2.0.0",
"description" : "A Node-RED node that gets and sets SNMP oid values. Supports v1, v2c and v3",
"dependencies" : {
"net-snmp" : "^3.8.2"
"net-snmp" : "^3.9.0"
},
"repository" : {
"type":"git",

View File

@ -253,9 +253,9 @@ module.exports = function (RED) {
node.error(SNMP.varbindError(vb), msg);
vb._error = SNMP.varbindError(vb); //add _error to msg so users can determine the varbind is not valid
}
else {
if (vb.type == 4) { vb.value = vb.value.toString(); }
}
// else {
// if (vb.type == 4) { vb.value = vb.value.toString(); }
// }
vb.tstr = SNMP.ObjectType[vb.type];
}
msg.payload = varbinds;