Repository navigation
Send has_connection's key and set_autoadd_config's hop limit - #129
Merged
fdlamotte merged 1 commit intoNov 22, 2026
Merged
Conversation
- has_connection sent only the command code, which the firmware refuses (ERR_CODE_UNSUPPORTED_CMD): CMD_HAS_CONNECTION wants the server's 32-byte key after it. It now takes the destination and sends its key. - set_autoadd_config takes an optional max_hops, sent as the byte after the flags (the firmware caps it at 64). get_autoadd_config already reads it back. Part of meshcore-dev#119 (B1, B2).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was wrong (#119, B1 and B2)
has_connection()sent only0x1c. The firmware handles CMD_HAS_CONNECTION only with the server's 32-byte public key after it (MyMesh.cpp:1741,len >= 1 + PUB_KEY_SIZE), so the call was always refused.set_autoadd_configsent one byte, so it couldn't set the hop limit. The firmware reads an optionalautoadd_max_hopsafter the flags, capped at 64 (MyMesh.cpp:2023-2028).What changed
has_connection(dst)takes the server as a contact, key or hex, and sends0x1c + key. It returns OK when the device holds a connection to it, and ERROR (ERR_CODE_NOT_FOUND) when not. This changes the signature, but the old form could only ever be refused.set_autoadd_config(flag, max_hops=None)sends the hop limit when given.get_autoadd_configalready reads it back (max_hops, since fix: decode trailing wire-format fields the reader drops (AUTOADD_CONFIG, LOGIN_SUCCESS, ACK, DEFAULT_FLOOD_SCOPE) #87), so that only gets a docstring.Verified
test_has_connection_wrappernow expects the key. They fail on currentmain.main:On this branch:
The read-back shows hop limit 0 rather than 5. The host build's own
min()(meshcore-nativevariants/host/HostArduino.h) returns a reference to its by-value argument, and that reference dangles, so the simulator stores 0. It's a simulator fault, not the firmware's: on a radio, the third byte is stored as sent (capped at 64).Part of #119.