Skip to content

Commit 1d190ad

Browse files
committed
Clamp max_hops to 64 to cover full protocol hop range (0-63)
1 parent 2cb0877 commit 1d190ad

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

examples/companion_radio/MyMesh.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1790,7 +1790,7 @@ void MyMesh::handleCmdFrame(size_t len) {
17901790
} else if (cmd_frame[0] == CMD_SET_AUTOADD_CONFIG) {
17911791
_prefs.autoadd_config = cmd_frame[1];
17921792
if (len >= 3) {
1793-
_prefs.autoadd_max_hops = min(cmd_frame[2], (uint8_t)63);
1793+
_prefs.autoadd_max_hops = min(cmd_frame[2], (uint8_t)64);
17941794
}
17951795
savePrefs();
17961796
writeOKFrame();

examples/companion_radio/NodePrefs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ struct NodePrefs { // persisted to file
3030
uint8_t autoadd_config; // bitmask for auto-add contacts config
3131
uint8_t client_repeat;
3232
uint8_t path_hash_mode; // which path mode to use when sending
33-
uint8_t autoadd_max_hops; // 0 = no limit, 1 = direct (0 hops), N = up to N-1 hops (max 63)
33+
uint8_t autoadd_max_hops; // 0 = no limit, 1 = direct (0 hops), N = up to N-1 hops (max 64)
3434
};

0 commit comments

Comments
 (0)