Jump to content Jump to content
F1 2021 | Online Services Down For Maintenance | 26/07/2021 ×

codeslave

Members
  • Content Count

    4
  • Joined

  • Last visited

Community Reputation

1 New Car Smell
  1. Can you put all the code? How did you declare PacketCarStatusData? Why did you omit *(float *)& ... ?The variables has to be such an array .. I think you have missed something.
  2. Try with directive __attribute__((packed)): struct PacketHeader { uint16_t m_packetFormat; // 2020 .. .. } __attribute__((packed)); Clearly has to be done in all struct declaration. You can evaluate with sizeof(Variable) and put out with serial.print: ex Serial.println(sizeof(PacketHeader)); If the problem persist I suppose that also the position of variables (memory adrress) inside a struct can change (not an expert). So for sure the first proposed solution remain the best, with somes improvement (array in place of multiple declarations).
  3. It seems something related to data structure alignment (padding) here a link to try to understand https://stackoverflow.com/questions/119123/why-isnt-sizeof-for-a-struct-equal-to-the-sum-of-sizeof-of-each-member
  4. I think the problems is related to 32bit and 64bit (I have an esp32) fields but i don't know the reason. It seems that these variables in size are bigger than 4 or 8 bytes Try to decompone 32 64 bit variables in 2 or 4 16 bit variables. I don't know if it is a bug on Arduino related or Esp32 compiling process. struct PacketHeader { uint16_t m_packetFormat; // 2020 uint8_t m_gameMajorVersion; // Game major version - "X.00" uint8_t m_gameMinorVersion; // Game minor version - "1.XX" uint8_t m_packetVersion; // Version of th
×
×
  • Create New...