What is the best way to convert a variable length hex string e.g. \"01A1\" to a byte array containing that data.
\"01A1\"
i.e converting this:
st
If you can make your data to look like this e.g array of "0x01", "0xA1" Then you can iterate your array and use sscanf to create the array of values
unsigned int result; sscanf(data, "%x", &result);