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

javascript - THREE.js reposition vertices for RingGeometry -

javascript - I need to update the text of a paragraph by inline edit -

assembly - What is the addressing mode for ld, add, and rjmp instructions? -