diff --git a/examples/simple_repeater/main.cpp b/examples/simple_repeater/main.cpp index 6bc1f1db..95c52ea6 100644 --- a/examples/simple_repeater/main.cpp +++ b/examples/simple_repeater/main.cpp @@ -28,9 +28,13 @@ #defne LORA_TX_POWER 20 #endif -#define ANNOUNCE_NAME "repeater1" +#ifndef REPEATER_NAME + #define REPEATER_NAME "repeater" +#endif -#define ADMIN_PASSWORD "h^(kl@#)" +#ifndef ADMIN_PASSWORD + #define ADMIN_PASSWORD "h^(kl@#)" +#endif #if defined(HELTEC_LORA_V3) #include @@ -300,8 +304,8 @@ public: void sendSelfAdvertisement() { uint8_t app_data[32]; app_data[0] = ADV_TYPE_REPEATER | ADV_NAME_MASK; - strcpy((char *)&app_data[1], ANNOUNCE_NAME); - int app_data_len = 1 + strlen(ANNOUNCE_NAME); + strcpy((char *)&app_data[1], REPEATER_NAME); + int app_data_len = 1 + strlen(REPEATER_NAME); mesh::Packet* pkt = createAdvert(self_id, app_data, app_data_len); if (pkt) { diff --git a/platformio.ini b/platformio.ini index 0f52e436..cf53e5a7 100644 --- a/platformio.ini +++ b/platformio.ini @@ -130,8 +130,9 @@ build_flags = -D LORA_FREQ=915.0 -D LORA_BW=250 -D LORA_SF=10 - ; -D MESH_PACKET_LOGGING=1 - ; -D MESH_DEBUG=1 + -D REPEATER_NAME="\"Xiao Repeater1\"" + -D MESH_PACKET_LOGGING=1 + -D MESH_DEBUG=1 [env:Xiao_C3_Repeater_sx1268] extends = Xiao_esp32_C3 @@ -144,6 +145,7 @@ build_flags = -D LORA_FREQ=433.0 -D LORA_BW=250 -D LORA_SF=10 + -D REPEATER_NAME="\"Xiao Repeater1\"" ; -D MESH_PACKET_LOGGING=1 ; -D MESH_DEBUG=1