From 4bbdbcf2c7a9c07d734eee34fffb6d7dd3a1ebcf Mon Sep 17 00:00:00 2001 From: Willy-JL <49810075+Willy-JL@users.noreply.github.com> Date: Mon, 23 Oct 2023 23:24:41 +0100 Subject: [PATCH] BLE Spam fix default 0 values and checks --nobuild --- applications/external/ble_spam/protocols/continuity.c | 2 +- applications/external/ble_spam/protocols/easysetup.c | 2 +- applications/external/ble_spam/protocols/easysetup.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/applications/external/ble_spam/protocols/continuity.c b/applications/external/ble_spam/protocols/continuity.c index 4b29683ab3..5027414e3f 100644 --- a/applications/external/ble_spam/protocols/continuity.c +++ b/applications/external/ble_spam/protocols/continuity.c @@ -91,7 +91,7 @@ static void continuity_make_packet(uint8_t* _size, uint8_t** _packet, const Prot const ContinuityCfg* cfg = _cfg ? &_cfg->continuity : NULL; ContinuityType type; - if(cfg) { + if(cfg && cfg->type != 0x00) { type = cfg->type; } else { const ContinuityType types[] = { diff --git a/applications/external/ble_spam/protocols/easysetup.c b/applications/external/ble_spam/protocols/easysetup.c index 98a9541de5..b95cab031b 100644 --- a/applications/external/ble_spam/protocols/easysetup.c +++ b/applications/external/ble_spam/protocols/easysetup.c @@ -81,7 +81,7 @@ void easysetup_make_packet(uint8_t* out_size, uint8_t** out_packet, const Protoc const EasysetupCfg* cfg = _cfg ? &_cfg->easysetup : NULL; EasysetupType type; - if(cfg) { + if(cfg && cfg->type != 0x00) { type = cfg->type; } else { type = rand() % EasysetupTypeCOUNT; diff --git a/applications/external/ble_spam/protocols/easysetup.h b/applications/external/ble_spam/protocols/easysetup.h index 4c94585380..010dc7ec2b 100644 --- a/applications/external/ble_spam/protocols/easysetup.h +++ b/applications/external/ble_spam/protocols/easysetup.h @@ -5,7 +5,7 @@ // Research by @Spooks4576 typedef enum { - EasysetupTypeBuds, + EasysetupTypeBuds = 0x01, // Skip 0 as it means unset EasysetupTypeWatch, EasysetupTypeCOUNT, } EasysetupType;