diff --git a/src/filewriter.cpp b/src/filewriter.cpp index 01009d01be8de7a453518546a3110b63ff266229..8fba290bbe09b41dc95c2c6c7012d432ac47c81a 100644 --- a/src/filewriter.cpp +++ b/src/filewriter.cpp @@ -153,22 +153,27 @@ float IMUFileWriter::GetFloatSafe(const unsigned char *p, int index) { void IMUFileWriter::DecodeMessage(unsigned char c) { switch (rcvState) { case StateReception::Waiting: + std::cout << "Waiting : " << c; if (c == 0xFE) rcvState = StateReception::FunctionMSB; break; case StateReception::FunctionMSB: + std::cout << "CMD_MSB : " << c; msgDecodedFunction = static_cast<int16_t>(c << 8); rcvState = StateReception::FunctionLSB; break; case StateReception::FunctionLSB: + std::cout << "CMD_LSB : " << c; msgDecodedFunction += static_cast<int16_t>(c << 0); rcvState = StateReception::PayloadLengthMSB; break; case StateReception::PayloadLengthMSB: + std::cout << "PLD_MSB : " << c; msgDecodedPayloadLength = static_cast<uint16_t>(c << 8); rcvState = StateReception::PayloadLengthLSB; break; case StateReception::PayloadLengthLSB: + std::cout << "PLD_LSB : " << c; msgDecodedPayloadLength += static_cast<uint16_t>(c << 0); if (msgDecodedPayloadLength > 0) { if (msgDecodedPayloadLength < 1024) { @@ -185,6 +190,7 @@ void IMUFileWriter::DecodeMessage(unsigned char c) { rcvState = StateReception::Decode; break; case StateReception::Payload: + std::cout << "PLD : " << c; if (msgDecodedPayloadIndex > msgDecodedPayloadLength) { //Erreur @@ -200,6 +206,7 @@ void IMUFileWriter::DecodeMessage(unsigned char c) { break; case StateReception::Decode: { + std::cout << "DCD : " << c; //Lance l'event de fin de decodage ProcessDecodedMessage(msgDecodedFunction, msgDecodedPayloadLength, msgDecodedPayload); msgDecoded++; @@ -448,8 +455,6 @@ void IMUFileWriter::ProcessDecodedMessage(int msgFunction, int msgPayloadLength, } void IMUFileWriter::write(uint8_t *sample, size_t size, uint8_t *imu_data) { - uint8_t *imu_data_cur(imu_data); - if(this->qhb_version == 3) { for(int i=1; i<size-1; i++) {