From ce58a23f9baab06e5084fe81e32242f9d2e3d1f0 Mon Sep 17 00:00:00 2001 From: geeksville Date: Fri, 28 Jun 2024 04:51:04 -0700 Subject: [PATCH] Force a compile time failur if FromRadio or ToRadio get larger than (#4190) a BLE packet size. We are actually very close to this threshold so important to make sure we don't accidentally pass it. --- src/mesh/PhoneAPI.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/mesh/PhoneAPI.h b/src/mesh/PhoneAPI.h index 3d7bfbade..1a2a065d3 100644 --- a/src/mesh/PhoneAPI.h +++ b/src/mesh/PhoneAPI.h @@ -8,6 +8,14 @@ // Make sure that we never let our packets grow too large for one BLE packet #define MAX_TO_FROM_RADIO_SIZE 512 + +#if meshtastic_FromRadio_size > MAX_TO_FROM_RADIO_SIZE +#error "meshtastic_FromRadio_size is too large for our BLE packets" +#endif +#if meshtastic_ToRadio_size > MAX_TO_FROM_RADIO_SIZE +#error "meshtastic_ToRadio_size is too large for our BLE packets" +#endif + #define SPECIAL_NONCE 69420 /**