Browse Source

Support direct repeater outpath

pull/2586/head
mikecarper 1 week ago
parent
commit
fe88e0e4c3
  1. 2
      docs/cli_commands.md
  2. 8
      examples/simple_repeater/MyMesh.cpp

2
docs/cli_commands.md

@ -749,6 +749,7 @@ This document provides an overview of CLI commands that can be sent to MeshCore
**Usage:**
- `get outpath`
- `set outpath <hop1_hex,hop2_hex,...>`
- `set outpath direct`
- `set outpath clear`
- `set outpath flood`
@ -759,6 +760,7 @@ This document provides an overview of CLI commands that can be sent to MeshCore
- These commands require remote client context (they target the caller's ACL entry).
- The path hash size is inferred from the hop hash width.
- `outpath` overrides the primary direct route used for replies to the caller.
- `direct` sets a zero-hop direct route for a caller reachable without repeaters.
- `clear` forgets the current direct path and allows normal path discovery to repopulate it.
- `flood` forces replies to use flood packets until the client logs in again.

8
examples/simple_repeater/MyMesh.cpp

@ -1194,6 +1194,10 @@ static bool parsePathCommand(char* raw, uint8_t* out_path, uint8_t& out_path_len
out_path_len = OUT_PATH_FORCE_FLOOD;
return true;
}
if (strcmp(spec, "direct") == 0) {
out_path_len = 0;
return true;
}
uint8_t hash_size = 0;
uint8_t hop_count = 0;
@ -1251,6 +1255,10 @@ static void formatPathReply(const uint8_t* path, uint8_t path_len, char* out, si
snprintf(out, out_len, "> invalid");
return;
}
if ((path_len & 63) == 0) {
snprintf(out, out_len, "> direct");
return;
}
uint8_t hash_size = (path_len >> 6) + 1;
uint8_t hop_count = path_len & 63;

Loading…
Cancel
Save