Skip to content

Can you help me parse the data i get #1

Description

@tauzm

Hi, i can get some data with bluepy on python. But i don't know how to make sense of the data. following values are turned into decimal with ord.
data1 this is the data i can get. And i use the following code.

`from bluepy.btle import Peripheral, AssignedNumbers, ADDR_TYPE_PUBLIC

import time

class HRM(Peripheral):
def init(self, addr):
Peripheral.init(self, addr, addrType=ADDR_TYPE_PUBLIC)

if name=="main":
cccid = AssignedNumbers.client_characteristic_configuration
hrmid = '2e4ed00a-d9f0-5490-ff4b-d17374c433ef' #this is the uuid of the relevant service

hrm = None
try:
    hrm = HRM('0C:EF:AF:81:0F:76')

    service, = [s for s in hrm.getServices() if s.uuid==hrmid]
    

    if 0: # This doesn't work
        ccc.write('\1\0')

    else:
        desc = hrm.getDescriptors(service.hndStart,
                                  service.hndEnd)
        d= [d for d in desc if d.uuid==cccid][1]



    hrm.writeCharacteristic(d.handle, '\1\0')

    
    t0=time.time()
    def print_hr(cHandle, data):
        
    datalist= []
    try:
        for i in range(0,20):
	    datalist.append(ord(data[i])) # data's are getting unhexed here
    except: 
        pass
    for i in datalist:
	print str(i) + '\t',
    print ''
       
    

    
    
    hrm.delegate.handleNotification = print_hr

    while True:
        hrm.waitForNotifications(3.)

finally:
    if hrm:
        hrm.disconnect()

`
Kindly asking if you know how i can get smO2 and hbt values out of these numbers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions