1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-13 03:19:53 +03:00

Bluetooth CRC should have byte stuffing

This commit is contained in:
Bertrand Songis 2023-06-14 08:49:05 +02:00
parent be85486192
commit 662918ea8f
No known key found for this signature in database
GPG key ID: F189F79290FEC50F

View file

@ -279,7 +279,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);
@ -294,7 +294,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) {