Added support for version 3.
All the existing issues with v1 and v2c are also with v3 e.g.
https://github.com/node-red/node-red-nodes/issues/679
snmp walker will not return more than 1000 objects, all following objects cannot be accessed
Incorrect encryption (privacy) passphrase gives a timeout and not an error (protocol limitation?)
Incorrect community string gives a timeout and not an error (protocol limitation?)
Changes to the node are made with following details:
Node-red v1.2.2
Node.js v12.6.0
Windows_NT 10.0.19841 x64 LE
* Fix alignment of baud rate setting.
* Add flow control flags DTR and RTS.
* Add flags for flow control RTS and DTR.
* Add pin states for flow control flags
* Change pinstates to linestates
* Remove help text about DTR/RTS defaulting to low.
* Collect flow control setting into one single command.
* Add curly braces.
* Add more curly braces.
* Add CTS and DSR settings. Add default none option. Change settings layout for flow control.
* serial: simplify serialPool.get
serialPool.get() has a lot of arguments.
Just pass the whole serialConfig object instead.
Also introduce early termination to remove one level of indentation.
(Just set your diff tool to ignore all whitespace changes to see
how very little this patch changes)
* serial: move splitting logic onto serialPool
All SerialIn and SerialOut nodes for a given port
share the same splitting logic as it is indeed
set by the common configuration node.
Move the code from SerialIn into serialPool so that
it can be reused by the serial request node.
Notice how the 'data' event will no longer carry
single bytes, but the whole payload instead.
Also move the output encoding logic into serialPool.
* serial: add serial request node
Add a "serial request" node to handle simple request/response
protocols. This node allows for multiple instances, all
sharing the same underlying device.
Responses coming from the serial line will only be propagated
to the output of the node where the request was originally received
(contrary to the "serial in" nodes which all emit the data
received from the serial line).
Every request received as an input to the node, is transmitted
to the serial line, and a matching response must be received
before the next one can be transmitted.
Any input message received in the meantime is internally enqueued.
The node is essentially a merge of serial in and serial out.
It shares the same configuration with serial in and serial out
for any given port and will not affect the behavior of the
existing nodes.
This means you can use, alongside with the request node:
- as many serial in nodes as you want -- e.g. to "sniff"
- serial out to inject mailicious/tampering data onto the serial
line, skipping the queueing mechanism
* serial request: provide some visual feedback on the node
add status indication:
- yellow "waiting" when a message is enqueued for sending
- green "OK" after an answer is received
- red "timeout" after a timeout occurs
More sofisticated output would include an indication of the number of messages
enqueued and the actual timeout remaining after sending.
* serial request: make default response timeout configurable
Notice it's a global setting (i.e. stored in the configuration node)
as opposed to per-node, but it can be overridden by setting msg.timeout.
* serial request: cosmetic changes
- added documentation about msg.port
- timeout field made wider so to accommodate default value of 10000ms
- replaced harcoded text with localizable strings for
"waiting" and "timeout" messages
* serial: cleanup: remove node.tout
this was probably some leftover code from previous implementations.
Now all timeouts are handled within the connection objects.
* serial: cleanup: set obj.tout to null after clearing it
clearing a Timeout without setting it back to null *might* have
adverse effects on later code which would check its null-ity.
Let's just do it.
* serial: cosmetic: add some comments
* serial request: fix "split on timeout" case
In the case of "split on timeout" case, we're reusing the same
.tout for two different purposes:
1) to send a timeout message, in case no answer is received at all [request]
2) to split messages, after receiving the first character [in+request]
So in the case of serial request, checking whether .tout is already
set is no longer a valid condition for 2).
Let's just check whether i === 1, and clear the timeout set up by 1)
if it's already there.
* serial: add "split on silence" behavior
add a fourth logic to split incoming data into messages.
The existing "split on timeout" logic starts the timeout upon
reception of the first character.
This might lead to unwanted behavior if for instance Node-RED is
restarted, as data might accumulate into OS buffers (see #410).
A different logic might be to only emit a message when enough time
has passed, without any new data being received (line silent), a.k.a.
interbyte timeout.
* Updates to match API changes
Update to the node to match the server API changes. An attempt has been made to leave a legacy path for existing installations that may have not updated the server side.
* Updated following comments.
Update following comments.
Output removed and node.warn or error used.
oneeditprepare added.
Name moved to last item.
In addition, a check added to ensure nodegroup has valid value.
Question: I have added a 'return' as I do not want data posted if there is not a valid nodegroup. Is this the best way to exit the function? Always taught that multiple exits was a bad idea. I wondered about raising an error / exception and then catching it but not sure how to do that.
* Update documentation for revised node
1- Ensure we stop advertising before creating a new advertiser if the object exists
2- Allow bool false to stop advertising
3- Documentation correction (state is in msg.payload, not in msg)
* snmp set node
* updated readme
* readme
* added missing {}
* corrected naming in variables, removed unused ones
* Use snmpObjectType to map types in SnmpSNode
* added varbinds as node property
* edit priority between node and message
* edit help
* updated doc
* try catch JSON.parse§
* corrected typo in html
* Error message in case of JSON parsing error
* removing try/catch on JSON.parse for varbinds, as a wrong varbinds will be
catched/handled in Session.set() method
* edit doc for better presentation
* I've modified the snmp libraries so that the server and the community can be defined by the msg.
Error will be thrown if you try to override what was defined in the node.
Verified that the contents of msg is no longer clobbered.
Signed-off-by: Bryan Malyn <bimalyn@us.ibm.com>
* Replaced tabs with 4 spaces.
Signed-off-by: Bryan Malyn <bimalyn@us.ibm.com>
* fix extra spacing
Signed-off-by: Bryan Malyn <bimalyn@us.ibm.com>
* Standardise node.error to include msg so that errors can caught
Signed-off-by: Bryan Malyn <bimalyn@us.ibm.com>
* Update documentation for snmp nodes
fixed documentation as noted, removed conflict and iff from documention
remove node.warns if host or community are set in both the node config and msg
Signed-off-by: Bryan Malyn <bimalyn@us.ibm.com>
* FIX: Close net-snmp sessions
Signed-off-by: Bryan Malyn <bimalyn@us.ibm.com>
* Fix 2: The previous push did not cleanly address the problem.
This commit uses a singleton aproach to create socket.
It still needs to be tested to see if there is any issue to the never-close,
but reuse socket model. My only concern is if a socket dies, do we need to do something to reestablish it?
Signed-off-by: Bryan Malyn <bimalyn@us.ibm.com>
* I've modified the snmp libraries so that the server and the community can be defined by the msg.
Error will be thrown if you try to override what was defined in the node.
Verified that the contents of msg is no longer clobbered.
Signed-off-by: Bryan Malyn <bimalyn@us.ibm.com>
* Replaced tabs with 4 spaces.
Signed-off-by: Bryan Malyn <bimalyn@us.ibm.com>
* fix extra spacing
Signed-off-by: Bryan Malyn <bimalyn@us.ibm.com>
* Standardise node.error to include msg so that errors can caught
Signed-off-by: Bryan Malyn <bimalyn@us.ibm.com>
* Update documentation for snmp nodes
fixed documentation as noted, removed conflict and iff from documention
remove node.warns if host or community are set in both the node config and msg
Signed-off-by: Bryan Malyn <bimalyn@us.ibm.com>
* I've modified the snmp libraries so that the server and the community can be defined by the msg.
Error will be thrown if you try to override what was defined in the node.
Verified that the contents of msg is no longer clobbered.
Signed-off-by: Bryan Malyn <bimalyn@us.ibm.com>
* Replaced tabs with 4 spaces.
Signed-off-by: Bryan Malyn <bimalyn@us.ibm.com>