The manufacturer data from a peripheral seems to be getting an extra byte...
My peripheral is sending these bytes:
0x0c 0xff 0xe5 0x02 0x00 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00
- The 0c means there are 12 more bytes coming.
- The ff means it's a manufacturer message.
- The next 2 bytes are the manufacturer id.
- The next 9 bytes are the custom manufacturer data.
Here's what I'm getting from CBCentralManager.didDiscoverPeripheral:
advertisementData: {
kCBAdvDataIsConnectable = 1;
kCBAdvDataLocalName = "SQ-SPT-0021 432190009";
kCBAdvDataManufacturerData = {length = 12, bytes = 0xe50200000101000000000000};
kCBAdvDataRxPrimaryPHY = 0;
kCBAdvDataRxSecondaryPHY = 0;
kCBAdvDataServiceUUIDs = (
"00000100-34ED-12EF-63F4-317792041D17"
);
kCBAdvDataTimestamp = "681852653.472335";
}
... here's what I would expect in the 'kCBAdvDataManufacturerData' vs. what I'm getting:
0x00 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00
I lined these up to hopefully show that there's an extra 0x00 byte at the beginning (this is clearer with more non-zero bytes, but I didn't want to make up data, and I don't have the old data available).
Where is this extra byte coming from, and how can I get rid of it? Changing the peripheral data is a possibility here.