I'm making a program for a microcontroller (mbed LPC1768) and having a few problems to decode serial input to uint8_t.
I get a char ackBuffer[20];
filled with input from an external device.
What we get is for example: F040A34B6785121\r
What I want to do is to get an uint8_t array where each number is symbolized by the hex value of 2 characters. The F is to show the message from the external device is started and the carriage return is the end of each message.
So what I want in the uint8_t array is:
0x04
0x0A
0x34
...
To make it even harder it can be the ackBuffer is a smaller size, so for example only F04004A\r
(if this can be easy fixed then it's very nice, but I can work around this problem myself.
Thank you!