0
votes

I need help with Data parsing. I have device which send to my Android phone measured data in 7 byte format x801FFF191FFF19

first byte is head (0x80)

next 3 bytes is 24 bit data1

and the last 3 bytes is 24 bit data2

Because I am a newbie in Java programming, I want to modify Android app from github zh2x/SpO2-BLE-for-Android. Gatt service and gatt characteristics already works.

I have problem with reading data. There is reading byte after byte and converting to integer. And I want to get data1 bytes to one integer value and data2 bytes to another one integer value.

This is link for DataParse java file

1

1 Answers

0
votes

You could look at

byte[] data1 = Arrays.copyOfRange(serviceData, 2, 5);

together with Byte Array and Int conversion in Java