android - Corebluetooth method scanForPeripheralsWithServices not working for me in any device.all github example not working with my devices ipod touch -


i working on bluetooth related app.but didn't success.

in app want connect idevice other bluetooth device scanning.

but cbcentralmanager method scanforperipheralswithservices , didn't response in diddiscoverperipheral method.

cbcentralmanager alloc method here :-

(void)viewdidload     {         [super viewdidload];          // start cbcentralmanager         _centralmanager = [[cbcentralmanager alloc] initwithdelegate:self queue:nil];          _textview.userinteractionenabled = no; // not used in test app     } 

scanning method cbcentralmanager :-

(void)scanforperipherals {     if (self.centralmanager.state != cbcentralmanagerstatepoweredon) {         nslog(@"cbcentralmanager must powered scan peripherals. %d", self.centralmanager.state);         return;     }      if (self.scanning) {         return;     }      self.scanning = yes;      [self.centralmanager scanforperipheralswithservices:nil options:@{ cbcentralmanagerscanoptionallowduplicateskey: @yes }];     nslog(@"scanning started"); } 

but never receive response in diddiscoverperipheral method.can 1 me code.?


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -