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
Post a Comment