That's probably a terrible subject title, but I can't think how else describe it. Sorry.
I'm receiving data from a WT32i Bluetooth module, and I'm struggling to figure out how to parse a particular piece of data.
Given the following as an example:
char features[] = "0000000000b7011c0200000000000000";
I need to get it into the following format:
byte features[16] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0xB7, 0x01, 0x1C, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
When viewed in binary, each bit of each byte represents the available features of a media player, so it's important to retain all the zeros. I've been staring at it for ages now, but can't think how to tackle this one. I'm not looking for people to write code for me, but even a nudge in the right direction would be appreciated.
If you're curious, the breakdown of features/bits is listed on page 75 of this document:
https://www.bluetooth.org/docman/handlers/DownloadDoc.ashx?doc_id=119996
Ian.