Don't use a String: use a c-string! Try something like this (tested on PC; needs some porting to the arduino):
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
const char input_string[] = "11b701e0";
uint8_t output_buffer[4];
size_t stringInterpreter (const char* in, uint8_t* out);
int main (void)
{
printf ("We are parsing: %s\n", input_string);
stringInterpreter (input_string, output_buffer);
for (int i = 0; i < 4; ++i)
printf ("Value #%i : %i\n", i, output_buffer[i]);
return 0;
}
size_t stringInterpreter (const char* in, uint8_t* out)
{
int i = 0;
int j = 0;
char hex_digits[3];
for (i; in[i]; i += 2)
{
hex_digits[0] = in[i];
hex_digits[1] = in[1+i];
hex_digits[2] = '\0';
out[j++] = (uint8_t) strtol (hex_digits, NULL, 16);
}
return j;
}
Output:
We are parsing: 11b701e0
Value #0 : 17
Value #1 : 183
Value #2 : 1
Value #3 : 224
EDIT: Will probably need some refining to get rid of magic numbers, etc.