Skip to content

Commit

Permalink
Increased reconnection limit for too long packets of CC1101
Browse files Browse the repository at this point in the history
  • Loading branch information
hfedcba committed Jul 1, 2017
1 parent 37f9bfd commit 14877fb
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/PhysicalInterfaces/TICC1100.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1125,6 +1125,7 @@ void TICC1100::mainThread()
}
_txMutex.unlock(); //Make sure _txMutex is unlocked

closeGPIO(1);
initDevice();
_stopped = false;
continue;
Expand Down Expand Up @@ -1168,7 +1169,17 @@ void TICC1100::mainThread()
uint8_t firstByte = readRegister(Registers::Enum::FIFO);
std::vector<uint8_t> encodedData = readRegisters(Registers::Enum::FIFO, firstByte + 1); //Read packet + RSSI
std::vector<uint8_t> 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;
Expand Down

0 comments on commit 14877fb

Please sign in to comment.