From 056bcf83d9b486b7cffb4f4afa32cf2b680cb8b0 Mon Sep 17 00:00:00 2001 From: Scott Powell Date: Wed, 30 Apr 2025 18:43:48 +1000 Subject: [PATCH] * Repeater: neighbour table now only of other repeaters --- examples/simple_repeater/main.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/simple_repeater/main.cpp b/examples/simple_repeater/main.cpp index 332ba3a7..201d4fc9 100644 --- a/examples/simple_repeater/main.cpp +++ b/examples/simple_repeater/main.cpp @@ -403,7 +403,10 @@ protected: // if this a zero hop advert, add it to neighbours if (packet->path_len == 0) { - putNeighbour(id, timestamp, packet->getSNR()); + AdvertDataParser parser(app_data, app_data_len); + if (parser.isValid() && parser.getType() == ADV_TYPE_REPEATER) { // just keep neigbouring Repeaters + putNeighbour(id, timestamp, packet->getSNR()); + } } } @@ -481,7 +484,7 @@ protected: } else if (memcmp(command, "neighbors", 9) == 0) { char *dp = reply; - for (int i = 0; i < MAX_NEIGHBOURS && dp - reply < 130; i++) { + for (int i = 0; i < MAX_NEIGHBOURS && dp - reply < 136; i++) { NeighbourInfo* neighbour = &neighbours[i]; if (neighbour->heard_timestamp == 0) continue; // skip empty slots