Every time you encounter a $ in the incoming string, initialize a byte variable (val) to 0. For each character after that that is not a space, multiply val by 16 and add the new value (subtracting '0' if the character is in the range '0' to '9' or subtracting 'A' and adding 10 if the character is in the range 'A' to 'F'). The value is complete when you encounter a space or the end of the record.
Alternatively, you could replace the '$' with '0x' in the string of received characters, and then use sscanf with the %x format specifier to convert the strings to numbers.