ios - Getting burn calories from open BLE devices -
i developing app in have burn calories ble devices mio-fuse.
i able fetch data health kit of apple watch when comes ble wearable out api, not able track down service id or characteristics id.so kindly me out.
thanks in advance
you need post code help. first device - code obj c should able change accordingly swift
if (central.state == cbcentralmanagerstatepoweredon) { [_centralmanager scanforperipheralswithservices:@[[cbuuid uuidwithstring:@"0x180a"]] options:@{cbcentralmanagerscanoptionallowduplicateskey : @yes}]; nslog(@"start scanning"); } if succeed, characteristics this
- (void)centralmanager:(cbcentralmanager *)central diddiscoverperipheral:(cbperipheral *)peripheral advertisementdata:(nsdictionary *)advertisementdata rssi:(nsnumber *)rssi { (cbservice *service in peripheral.services) { nslog(@"discovered service1: %@", service.uuid); [peripheral discovercharacteristics:nil forservice:service]; } if (_discoveredperipheral != peripheral) { // save local copy of peripheral, corebluetooth doesn't rid of _discoveredperipheral = peripheral; // , connect nslog(@"connecting peripheral %@", peripheral); [_centralmanager connectperipheral:peripheral options:nil]; } } once connect characteristics
Comments
Post a Comment