2021-09-24 12:49 AM
following packet i am sending from host to controller-
02 01 00 02 01 02 03 04 00 01 00(first two bytes are packet type)-controller is expecting that value as 0x0102 but due to endianness mismatch when sent as 0x0102 its interpreted as 0x0201.so every time i need to send that value as 0x0201 to be interpreted as 0x0102 at controller. as controller is using little endian and dock light using big endian format(as per my understanding). how can i send the data from host as 0x0102 and it is interpreted as 0x0102 only and not 0x0201 at controller? Can we do such endianness changes from IDE?Please help me. Working on STM controller for the very first time.
2021-09-24 02:43 AM
Endianness should not impact the order bytes in an array are sent.
If the ordering of the bytes is wrong, change it.