From 14ceba5bee1b44f5b6f148530739f4296f30a8a5 Mon Sep 17 00:00:00 2001 From: DigiH <17110652+DigiH@users.noreply.github.com> Date: Sat, 16 Aug 2025 15:03:19 +0200 Subject: [PATCH] [BT] Consistent checking for BLEDecryptor as a Boolean (#2230) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Consistent checking for BLEDecryptor as a Boolean, not just as a Define, so that … … also behaves correctly when set to false. --- main/User_config.h | 14 +++++++------- main/config_WebContent.h | 4 ++-- main/main.cpp | 8 ++++---- main/webUI.cpp | 4 ++-- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/main/User_config.h b/main/User_config.h index e11e3a2..51c8281 100644 --- a/main/User_config.h +++ b/main/User_config.h @@ -654,13 +654,13 @@ void storeSignalValue(uint64_t); #ifdef ZgatewayBT # ifndef BLEDecryptor -# define BLEDecryptor true //true if decrypt encrypted PVVX or BTHome v2 service data -# endif -# ifndef JSON_BLE_AES_CUSTOM_KEYS -# define JSON_BLE_AES_CUSTOM_KEYS 256 // 42 byte BLE Custom Key * 6 rounded up to 256. -# endif -# ifndef BLE_AES -# define BLE_AES "00112233445566778899001122334455" +# define BLEDecryptor true //true if decrypt encrypted PVVX, BTHome v2 or Victron Energy broadcast data +# ifndef JSON_BLE_AES_CUSTOM_KEYS +# define JSON_BLE_AES_CUSTOM_KEYS 256 // 42 byte BLE Custom Key * 6 rounded up to 256. +# endif +# ifndef BLE_AES +# define BLE_AES "00112233445566778899001122334455" +# endif # endif #endif diff --git a/main/config_WebContent.h b/main/config_WebContent.h index 5d1daf8..25fe830 100644 --- a/main/config_WebContent.h +++ b/main/config_WebContent.h @@ -62,7 +62,7 @@ #else # define configure_6 #endif -#ifdef BLEDecryptor +#if BLEDecryptor # define configure_7 "
" #else # define configure_7 @@ -223,7 +223,7 @@ const char config_lora_body[] = body_header "" "" body_footer_config_menu; -#ifdef BLEDecryptor +#if BLEDecryptor const char config_ble_body[] = body_header "" body_footer_config_menu; // Client side javascript validation of the Default AES Key is hex, and the custom keys are in the correct format. This pushes the theengs-bridge-v11 way of the file size, so reducing it now and leaving it commented out diff --git a/main/main.cpp b/main/main.cpp index 8f75b30..cbbeb4a 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -95,7 +95,7 @@ char mqtt_topic[parameters_size + 1] = Base_Topic; char gateway_name[parameters_size + 1] = Gateway_Name; unsigned long lastDiscovery = 0; -#ifdef BLEDecryptor +#if BLEDecryptor char ble_aes[parameters_size] = BLE_AES; StaticJsonDocument