2

I would like to show Heart Rate value for the AmazFit Bip Watch in my own application.

UUID:

00002a37-0000-1000-8000-00805f9b34fb

Sample Byte Array:

byte[0] = 0
byte[1] = 70

Calculated value from the byte array:

if (value.length == 2 && value[0] == 0) {
    final int hrValue = (value[1] & 0xff);
}

Question: I am not getting correct value whatever I see in the watch. I want exact value in my application what I see in the watch. I have referred Gadgetbridge project.


Any help will be highly appreciated.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Dhruv
  • 1,801
  • 1
  • 15
  • 27

1 Answers1

0

Try any of the following code:

Byte b = byte[1];
final int hrValue = b.intValue();

or use Byte constructor as below:

Byte b = new Byte(byte[1]);
final int hrValue = b.intValue();

Thanks to byte to int

Kamal Joshi
  • 1,298
  • 3
  • 25
  • 45