Hey everyone, this is not something I've had to deal with before, so I'm not even sure what to search for. If there's already a post, could you please point me towards it? If not, here's my situation.
I'm working with an ESP8266 powered remote that sends out a signal with ESP-Now, trying to decode it, and one of the things it sends out is 4 bytes as an incremental number.
As I'm decoding the signal I've found that the bytes are in this order
Example of first packet sent: 00100111 00000010 00000000 00000000
Example of second packet sent: 00101000 00000010 00000000 00000000
If when decoding this I read it as a long it would be:
First: 00100111000000100000000000000000 which is 27,020,000 Second: 00101000000000100000000000000000 which is 28,020,000
However, if you reverse the bytes (not each but) you get:
First: 00000000000000000000001000100111 which is 551 Second: 00000000000000000000001000101000 which is 552
So, my questions are:
Is there any different data type that would read this in reverse order? If not, is there any way to reverse the order?
Also, for re-creating the signal (to make my own version of the remote), I would need to take a regular long and reverse it. how would I do that?
I know it's not a lot to work with, but I don't want to give away too much of the program until I'm sure it works. If there is any other details needed to help me let me know.
Thanks in advance!