ios - CBCentralManager not detecting nearby devices -



ios - CBCentralManager not detecting nearby devices -

the cbcentralmanager not detecting nearby bluetooth devices.

- (void)viewdidload { [super viewdidload]; _centralmanager = [[cbcentralmanager alloc] initwithdelegate:self queue:nil]; _data = [[nsmutabledata alloc] init]; } - (void)centralmanagerdidupdatestate:(cbcentralmanager *)central { if (central.state == cbcentralmanagerstatepoweredon) { nsdictionary *options = @{cbcentralmanagerscanoptionallowduplicateskey: @no}; [_centralmanager scanforperipheralswithservices:nil options:options]; nslog(@"scanning started"); } if (central.state == cbcentralmanagerstateunknown) { nslog(@"cbcentralmanagerstateunknown"); } if (central.state == cbcentralmanagerstateresetting) { nslog(@"cbcentralmanagerstateresetting"); } if (central.state == cbcentralmanagerstateunsupported) { nslog(@"cbcentralmanagerstateunsupported"); } if(central.state == cbcentralmanagerstateunauthorized) { nslog(@"cbcentralmanagerstateunauthorized"); } if(central.state == cbcentralmanagerstatepoweredoff) { nslog(@"cbcentralmanagerstatepoweredoff"); } }

i have checked state cbcentralmanagerstatepoweredon

after doesn't calling delegate methods.

ios objective-c bluetooth cbcentralmanager

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -