fix: status packet

This commit is contained in:
玖叁 2024-12-27 14:56:41 +08:00
parent fc1ee568d8
commit 94eb8c2339
1 changed files with 2 additions and 2 deletions

View File

@ -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;