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