From 94eb8c233907cc27ec44ea5b073c6dc075e997c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=96=E5=8F=81?= Date: Fri, 27 Dec 2024 14:56:41 +0800 Subject: [PATCH] fix: status packet --- src/transmit.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/transmit.cpp b/src/transmit.cpp index 088574a..66153f6 100644 --- a/src/transmit.cpp +++ b/src/transmit.cpp @@ -117,7 +117,7 @@ void sendStatus(BLECharacteristic &characteristic) uint8_t buffer[PACKET_MAX_LENGTH]; uint8_t bufferIndex = 0; buffer[bufferIndex++] = PACKET_T_HEAD; - buffer[bufferIndex++] = 0x0C; + buffer[bufferIndex++] = 0x0E; buffer[bufferIndex++] = CMD_STATUS_MOTOR; buffer[bufferIndex++] = (MotorController::getMotorStatus('A').in2 << 1) | MotorController::getMotorStatus('A').in1; buffer[bufferIndex++] = MotorController::getMotorStatus('A').pwm; @@ -131,7 +131,7 @@ void sendStatus(BLECharacteristic &characteristic) uint16_t irData = 0; for (uint8_t i = 0; i < IR::data.length; i++) { - irData |= (IR::data.data[i] << (i * 2)); + irData |= (IR::data.data[i] << i); } buffer[bufferIndex++] = irData; buffer[bufferIndex++] = PACKET_T_TAIL;