fix(bt): BT CRC allowing reserved bytes to be sent (#3685)

* Fix BT sending crc non "byte stuffed"

* Fix
This commit is contained in:
3djc
2023-06-15 10:39:14 +10:00
committed by GitHub
parent 27b6f7cc6d
commit ba56166ff5
+2 -2
View File
@@ -268,7 +268,7 @@ void Bluetooth::sendTrainer()
pushByte(((channelValue1 & 0x0f00) >> 4) + ((channelValue2 & 0x00f0) >> 4));
pushByte(((channelValue2 & 0x000f) << 4) + ((channelValue2 & 0x0f00) >> 8));
}
buffer[bufferIndex++] = crc;
pushByte(crc);
buffer[bufferIndex++] = START_STOP; // end byte
write(buffer, bufferIndex);
@@ -293,7 +293,7 @@ void Bluetooth::forwardTelemetry(const uint8_t * packet)
for (uint8_t i=0; i<sizeof(SportTelemetryPacket); i++) {
pushByte(packet[i]);
}
buffer[bufferIndex++] = crc;
pushByte(crc);
buffer[bufferIndex++] = START_STOP; // end byte
if (bufferIndex >= 2*FRSKY_SPORT_PACKET_SIZE) {