bluetooth - Connect to LightBlue peripheral mode -
i used lightblue app on ios devices (iphone 4s, ios 6.1.3) in peripheral mode , ios device (iphone 4s, ios 6.1.3) in central mode.
i'm using btle transfer example code apple, it's working on these 2 devices. however, not work on lightblue. want develop simple app read data blood pressure device, i've changed following service , characteristic uuid in transfer.h file
define transfer_service_uuid @"1810"
define transfer_characteristic_uuid @"2a49" // read value
my plan going clone real device structure on lightblue , develop central app connect lightblue peripheral (i think work real devices because donot have real device @ moment). set device peripheral , second 1 install modified app (from apple sample) central or client.
the following delegate method provided apple:
- (void)centralmanager:(cbcentralmanager *)central diddiscoverperipheral:(cbperipheral *)peripheral advertisementdata:(nsdictionary *)advertisementdata rssi:(nsnumber *)rssi { // reject value above reasonable range if (rssi.integervalue > -15) { return; } // reject if signal strength low close enough (close around -22db) if (rssi.integervalue < -35) { return; } nslog(@"discovered %@ @ %@", peripheral.name, rssi); // ok, it's in range - have seen it? if (self.discoveredperipheral != peripheral) { // save local copy of peripheral, corebluetooth doesn't rid of self.discoveredperipheral = peripheral; // , connect nslog(@"connecting peripheral %@", peripheral); [self.centralmanager connectperipheral:peripheral options:nil]; self.connectingperipheral=peripheral; // line of code have added recommended member } }
and problem is, delegate method have been fired , log panel display "discovered lightblue @ -32".it cannot connect lightblue peripheral cannot see output of line of code nslog(@"connecting peripheral %@", peripheral);
all suggestion welcome , highly appreciated.
Comments
Post a Comment