From 14877fb63e6a06a6cab265895b6ab7871eddb677 Mon Sep 17 00:00:00 2001 From: Sathya Laufer Date: Sat, 1 Jul 2017 20:21:14 +0200 Subject: [PATCH] Increased reconnection limit for too long packets of CC1101 --- src/PhysicalInterfaces/TICC1100.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/PhysicalInterfaces/TICC1100.cpp b/src/PhysicalInterfaces/TICC1100.cpp index 8180ec0..75ec706 100644 --- a/src/PhysicalInterfaces/TICC1100.cpp +++ b/src/PhysicalInterfaces/TICC1100.cpp @@ -1125,6 +1125,7 @@ void TICC1100::mainThread() } _txMutex.unlock(); //Make sure _txMutex is unlocked + closeGPIO(1); initDevice(); _stopped = false; continue; @@ -1168,7 +1169,17 @@ void TICC1100::mainThread() uint8_t firstByte = readRegister(Registers::Enum::FIFO); std::vector encodedData = readRegisters(Registers::Enum::FIFO, firstByte + 1); //Read packet + RSSI std::vector decodedData(encodedData.size()); - if(encodedData.size() >= 9) + if(decodedData.size() > 200) + { + if(!_firstPacket) + { + _out.printWarning("Warning: Too large packet received: " + BaseLib::HelperFunctions::getHexString(encodedData)); + closeDevice(); + _txMutex.unlock(); + continue; + } + } + else if(encodedData.size() >= 9) { decodedData[0] = firstByte; decodedData[1] = (~encodedData[1]) ^ 0x89;