From e877b135e8c5a6723a1567b2da82ae9c7b949fba Mon Sep 17 00:00:00 2001 From: Scott Powell Date: Sat, 1 Feb 2025 19:06:39 +1100 Subject: [PATCH] * Repeater: timing changes for self-advert --- examples/simple_repeater/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/simple_repeater/main.cpp b/examples/simple_repeater/main.cpp index 230b15f8..c41bbee5 100644 --- a/examples/simple_repeater/main.cpp +++ b/examples/simple_repeater/main.cpp @@ -405,7 +405,7 @@ public: } } - void sendSelfAdvertisement() { + void sendSelfAdvertisement(int delay_millis) { uint8_t app_data[MAX_ADVERT_DATA_SIZE]; uint8_t app_data_len; { @@ -415,7 +415,7 @@ public: mesh::Packet* pkt = createAdvert(self_id, app_data, app_data_len); if (pkt) { - sendFlood(pkt, 800); // add slight delay + sendFlood(pkt, delay_millis); } else { MESH_DEBUG_PRINTLN("ERROR: unable to create advertisement packet!"); } @@ -427,7 +427,7 @@ public: if (memcmp(command, "reboot", 6) == 0) { board.reboot(); // doesn't return } else if (memcmp(command, "advert", 6) == 0) { - sendSelfAdvertisement(); + sendSelfAdvertisement(400); strcpy(reply, "OK - Advert sent"); } else if (memcmp(command, "clock sync", 10) == 0) { uint32_t curr = getRTCClock()->getCurrentTime(); @@ -583,7 +583,7 @@ void setup() { } // send out initial Advertisement to the mesh - the_mesh.sendSelfAdvertisement(); + the_mesh.sendSelfAdvertisement(2000); } void loop() {