Accept node.id in decimal and hex
To specify a node, we currently use an exclamation mark, which has other effects in bash. It would be ideal to also allow nodes to be specified by their numeric value, as well as by 0xdeadbeef as well as !deadbeef.
Would this need to be changed in the firmware or just in the pattern matching from the command line?
this should only need updating within the CLI/library -- everything is converted to an integer to send to the radio
Made a PR to potentially address this issue. https://github.com/meshtastic/python/pull/731
I'm open to comments on improving this though.
PR just merged to main. You can now use ! or 0x prefixes when setting node destinations. ie: --dest "0x12345678" or --dest "!12345678"
I'll keep this open for the time being, because I think we'd still like to add some handling for passing node IDs in pure decimal at the command line. I think we can add some handling that treats a value as decimal if it has no prefix at all and all digits could be decimal. I'm not sure entirely what we should do with an unprefixed 8-digit all-decimal-digits value, though.
[...] I'm not sure entirely what we should do with an unprefixed 8-digit all-decimal-digits value, though.
There will be no choice: the prefix will initiate the interpretation of the following string as defined by the prefix. No prefix then is just a shortcut to interpret as a decimal number, otherwise there is an ambiguity which cannot be resolved. Having a clear rule will also keep the code clean and understandable.