Saturday, 15 March 2014

objective c - How to detect Iphone/Ipad devices with bluetooth ON? -



objective c - How to detect Iphone/Ipad devices with bluetooth ON? -

i using bluetoothmanager.framework

i have sample illustration detecting bluetooth device of iphone/ipad. sample app not detecting devices.

below link sample code , url:

http://www.pocketmagic.net/2012/07/bluetooth-and-ios-use-bluetooth-in-your-iphone-apps/#.urnzy-hhndq

bluetoothmanager *btmanager; - (ibaction)scanbuttonaction { if ([btmanager enabled]) { // start scan [btmanager setdevicescanningenabled:yes]; } else { showmessage(@"error", @"turn bluetooth on first!"); } } - (ibaction)bluetoothon { nslog(@"bluetoothon called."); [btmanager setpowered:yes]; [btmanager setenabled:yes]; } - (ibaction)bluetoothoff { nslog(@"bluetoothoff called."); [btmanager setenabled:no]; [btmanager setpowered:no]; }

any suggestions or samples observe bluetooth devices appreciated.

what kind of bluetooth utilize bluetooth device? bluetooth 4.0? if yes improve when utilize corebluetooth framework not private. using bluetooth have create cbcentralmanager instance. have implement cbcentralmanagerdelegate protocol cbperipheraldelegate protocol. can test if hardware back upwards bluetooth 4.0 asking cbcentralmanager state. example: cbcentralmangerstateunsupported mean hardware doesn't back upwards bt 4.0.

iphone objective-c ios5 bluetooth

No comments:

Post a Comment