Issue
Im trying to decode data from pulse oximeter device using the nrf Connect App.
From the Pulse Oximeter(0X1822). PLX Spot-Check Measurement service I got the below response:
SPOT MEASUREMENT:
(0x) 17-61-00-60-00-E1-07-01-01-01-22-13-20-00-20-00-00
CONTINOUS MEASUREMENT: (0x) 0c-62-00-4E-00-20-00-00-00-00
PROFILE SAYS its SFLOAT value, But I'm stuck to converting this to readable value.
Expected value: Spo2 and heart rate from the above response
I also looked in the pulse oximeter profile in the Bluetooth page but it seems confusing
NRF CONNECT APP SCREENSHOT:
pulse oximeter details:http://www.choicemmed.eu/product_center/253
Please help me to get readable data
Solution
This page helps me lot: https://thejeshgn.com/2020/08/05/reverse-engineering-a-bluetooth-low-energy-oximeter/
From this Spot check value :17-61-00-60-00-E1-07-01-01-01-22-13-20-00-20-00-00
Byte[1] refers to spo2 rate
Byte[3] refers to pulse rate
int spo2 = packet[1];
int pulseRate = packet[3] | ((packet[2] & 64) << 1);
System.out.println(spo2);
System.out.println(pulseRate);
Spo2:97 pulse rate:98
This scenarios is same for continuous check value:(0x) 0c-62-00-4E-00-20-00-00-00-00
To convert hex code value into int in dart
int val=0X62;
print(val);
Answered By - tesrt
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.