fix: status packet
This commit is contained in:
parent
fc1ee568d8
commit
94eb8c2339
|
@ -117,7 +117,7 @@ void sendStatus(BLECharacteristic &characteristic)
|
||||||
uint8_t buffer[PACKET_MAX_LENGTH];
|
uint8_t buffer[PACKET_MAX_LENGTH];
|
||||||
uint8_t bufferIndex = 0;
|
uint8_t bufferIndex = 0;
|
||||||
buffer[bufferIndex++] = PACKET_T_HEAD;
|
buffer[bufferIndex++] = PACKET_T_HEAD;
|
||||||
buffer[bufferIndex++] = 0x0C;
|
buffer[bufferIndex++] = 0x0E;
|
||||||
buffer[bufferIndex++] = CMD_STATUS_MOTOR;
|
buffer[bufferIndex++] = CMD_STATUS_MOTOR;
|
||||||
buffer[bufferIndex++] = (MotorController::getMotorStatus('A').in2 << 1) | MotorController::getMotorStatus('A').in1;
|
buffer[bufferIndex++] = (MotorController::getMotorStatus('A').in2 << 1) | MotorController::getMotorStatus('A').in1;
|
||||||
buffer[bufferIndex++] = MotorController::getMotorStatus('A').pwm;
|
buffer[bufferIndex++] = MotorController::getMotorStatus('A').pwm;
|
||||||
|
@ -131,7 +131,7 @@ void sendStatus(BLECharacteristic &characteristic)
|
||||||
uint16_t irData = 0;
|
uint16_t irData = 0;
|
||||||
for (uint8_t i = 0; i < IR::data.length; i++)
|
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++] = irData;
|
||||||
buffer[bufferIndex++] = PACKET_T_TAIL;
|
buffer[bufferIndex++] = PACKET_T_TAIL;
|
||||||
|
|
Loading…
Reference in New Issue