T_runProc::bl_isUp(): fix check for "02:65:30:df:83:03".

This commit is contained in:
Gerhard Hoffmann 2024-02-09 12:25:13 +01:00
parent 04055e9607
commit b7449ff4a2

View File

@ -684,6 +684,7 @@ bool T_runProc::bl_isUp(void)
for (nn=0; nn<160; nn++) receivedData[nn]=0;
LL=epi_getRawRecLength();
if (LL>0)
{
epi_getRawReceivedData(receivedData);
@ -696,15 +697,26 @@ bool T_runProc::bl_isUp(void)
//epi_clrRawReceivedString();
return true;
}
// response to "start BL"
if (receivedData[0]==2 && receivedData[1]==101 && receivedData[2]==48 &&
receivedData[3]==223 && receivedData[4] ==131 )
{
qDebug() << "hwapi_bl_isUp: got BL response to start";
//epi_clrRawReceivedString();
// response to "start BL" { 2, 101, 48, 223, 131, 3}
static uint8_t const cmp[6] = {0x02, 0x65, 0x30, 0xdf, 0x83, 0x03};
if (LL >= 6 && LL <= 13) {
// (1) "02:63:34:35:62:33:03:02:65:30:df:83:03"
// (2) "02:65:30:df:83:03"
// qCritical() << "(" << __func__ << ":" << __LINE__
// << ") CHECK" << QByteArray((char const*)receivedData, LL).toHex(':');
for (int i=0; i <= LL-6; ++i) {
if (memcmp(cmp, &receivedData[i], 6) == 0) {
qCritical() << "(" << __func__ << ":" << __LINE__
<< ") BL RESPONSE to bl_start(): BOOTLOADER IS UP";
return true;
}
}
}
}
return false;
}