From 22026c1d89a18d7957b01805f969348719afe935 Mon Sep 17 00:00:00 2001 From: Felix Erdmann Date: Fri, 7 Jun 2024 11:11:01 +0200 Subject: [PATCH] fix: clear BLE buffer before reading new data --- src/SenseBoxBLE.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/SenseBoxBLE.cpp b/src/SenseBoxBLE.cpp index cc19d09..9068862 100755 --- a/src/SenseBoxBLE.cpp +++ b/src/SenseBoxBLE.cpp @@ -145,6 +145,7 @@ void SenseBoxBLE::poll(int timeout) * */ void SenseBoxBLE::poll(){ + memset(configCharValue, 0, sizeof(configCharValue)); if(port.poll()){ if(parseMyValue(configCharValue,port.checkCharWritten(h_configCharacteristic))){ configCharacteristicWritten(); @@ -243,4 +244,4 @@ bool SenseBoxBLE::write(int characteristic, float& f1, float& f2, float& f3 , fl return port.writeValue(characteristic,data,20); } -//#endif \ No newline at end of file +//#endif