ios - Reload Bluetooth Signal strength -



ios - Reload Bluetooth Signal strength -

so, i'm scanning bluetooth peripherals , logging strength of signals.

class="lang-cs prettyprint-override">- (void)viewdidload { cbcentralmanager *centralmanager = [[cbcentralmanager alloc] initwithdelegate:self queue:nil]; [centralmanager scanforperipheralswithservices:nil options:nil]; } - (void)centralmanager:(cbcentralmanager *)central diddiscoverperipheral:(cbperipheral *)peripheral advertisementdata:(nsdictionary *)advertisementdata rssi:(nsnumber *)rssi { nslog(@"peripheral discovered"); nslog(@"%ld", (long)rssi.integervalue); }

at method centralmanager:diddiscoverperipheral:advertisementdata:rssi: have access rssi number (signal strength).

what best way closest realtime update of value?!

should set timer , phone call scanforperipheralswithservices every x seconds? should implement sort of recursive callback?

is there improve way peripheral signal strength?

you can periodically phone call readrssi method on cbperipheral object.

discussion

when phone call method retrieve rssi of peripheral while connected central manager, peripheral calls peripheraldidupdaterssi:error: method of delegate object. if rssi value of peripheral retrieved, can access through peripheral’s rssi property.

ios objective-c cocoa-touch bluetooth core-bluetooth

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -