jeelabs / jeelib

JeeLib for Arduino IDE: Ports, RF12, and RF69 drivers from JeeLabs
https://jeelabs.org/202x/sw/jeelib/
The Unlicense
490 stars 215 forks source link

qualify command 'i' value before setting node id #80

Open pb66 opened 9 years ago

pb66 commented 9 years ago

A stray "i" can attempt to set a node id of "0" and result in a "config save failed" although setting the node id to "0" will of succeeded and the result is no further packets will be processed until a valid node id is set.

JohnOH commented 9 years ago

Node == 0 is also used to disable interrupts from the radio. The config save failed error message isn't a desirable outcome but interesting point as to which facet ought to be fixed.

pb66 commented 9 years ago

I wasn't aware of the "interrupt disable" feature so will leave the decision to your better judgement.

I have however amended my code to allow > 0 <33 so that 32i could be used as a "interrupt disable" instead, with a significant reduction in potential accidental activation.

Perhaps the "current configuration" string could be appended to (or even replace) the "config save failed" message to help identify if node 0 is selected, it would be more consistent to provide the "current config"