core-bluetooth

iOS 7 CoreBluetooth retrievePeripheralsWithIdentifiers not Retrieving

前提是你 提交于 2019-12-09 04:47:03
问题 I am having an issue updating my CoreBluetooth code from iOS 6 to iOS 7. I can scan for Peripherals and make connections, however, I am not able to reconnect a Peripheral using the new CoreBluetooth methods offered within iOS 7. Here is a look at how I am trying to accomplish the reconnection: - (void)retrievePeripheral:(NSString *)uuidString { NSUUID *nsUUID = [[NSUUID UUID] initWithUUIDString:uuidString]; if(nsUUID) { NSArray *peripheralArray = [centralManager

When would CBCentralManager's state ever be powered on but still give me a “not powered on” warning?

ぐ巨炮叔叔 提交于 2019-12-09 02:27:46
问题 I keep getting this error when I run my app that uses CoreBluetooth on an iPhone 5: <CBConcreteCentralManager: 0x2007d590> is not powered on But when I call state on my program's one and only CBCentralManager object, it returns 5, which is CBCentralManagerStatePoweredOn. So it's powered on, yet I get this error. The iPhone's Bluetooth is also enabled. Just in general, when would this ever happen? I don't even know what is going on when the program runs because I'm getting what looks like

Trying to retrieve previously paired bluetooth device in IOS app will not respond with failure if device is off

99封情书 提交于 2019-12-08 19:42:01
问题 Sorry for the long title, but we are having a pretty interesting issue with using corebluetooth for ios. We are issuing a call to retrievePeripherals in CBCentralManager and are able to find the previously paired device. This happens though regardless if the device is on or off though. I can't find anything in apple's documentation as to why it's able to find the device when it is off though and it isn't showing up in Settings -> Bluetooth -> Devices. I'm suspecting that Apple is caching this

CoreData errors/exceptions when app work in background mode

无人久伴 提交于 2019-12-08 19:20:32
I'm doing a multithreaded CoreBluetooth app where the iPhone is working as a central, scanning (based on UI-interaction) for peripherals which then are connected and processed, resulting in various changes to the app's CoreData model used to store persistent info on the state of the different peripherals that the user has access to (without having to connected to them every time the user starts the app). The user basically request connection to a peripheral via the UI, which then kick an async worker thread that will try to accomplish the request within a certain time-frame (e.g., a few

MY IOS App is not getting any region updates when ever I restart my device any ideas?

主宰稳场 提交于 2019-12-08 14:24:12
问题 My app is working fine for beacon monitoring when running in foreground and background even when I quit app it's launching the app in background .. But when I restart the phone it's not waking up.. // I am using background modes for location also func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { //do i have to do anything here return true } //when ever app hit background bellow method will trigger and

iPhone - Polar H7_heart_rate_sensor connectivity using bluetooth

余生长醉 提交于 2019-12-08 13:54:05
问题 Please suggest me, whether an iPhone application can connect with external bluetooth devices like polar h7/h6 heart rate sensor fitness belt (http://www.polar.com/en/products/accessories/H7_heart_rate_sensor)? I am following these links: http://www.tekritisoftware.com/scan-ble-devices-using-ios-core-bluetooth-framework https://github.com/sergiomtzlosa/CoreBluetooth-Demo/ But i am not sure, whether iPhone app will connect to this external fitness belt. Please guide. Thanks. 回答1: So: Bluetooth

swift: pair with bluetooth device with button click

喜夏-厌秋 提交于 2019-12-08 09:14:30
问题 Until now the iPhone has paired to a bluetooth device when the app is opened, but I want to pair with a button click instead. I tried to put all the scanning and connection functions in a IBAction, but nothing happens when I push the button. In the first function after the IBAction I have a print output to check if it even enters the function, but I don't get the print. I also tried to put a delay after the manager.scanForPeripherals but didn't work either. What am I missing here? anyone know

Using CoreBluetooth CBL2CAPChannel to move data

橙三吉。 提交于 2019-12-08 08:52:38
问题 I have set up some data transfer function, using CoreBluetooth CBL2CAPChannel , in a Swift iOS app. Here is the function for sending data: func sendData(_ outStream: OutputStream) -> Bool { let data = tranferBlock! // tranferBlock holds some .utf8 data. let bytesWritten = data.withUnsafeBytes {outStream.write($0, maxLength: data.count)} if bytesWritten > 0 { tranferBlock = nil return true } return false } And here is the function for receiving data: func receiveData(_ inStream: InputStream) {

CoreData errors/exceptions when app work in background mode

牧云@^-^@ 提交于 2019-12-08 08:32:56
问题 I'm doing a multithreaded CoreBluetooth app where the iPhone is working as a central, scanning (based on UI-interaction) for peripherals which then are connected and processed, resulting in various changes to the app's CoreData model used to store persistent info on the state of the different peripherals that the user has access to (without having to connected to them every time the user starts the app). The user basically request connection to a peripheral via the UI, which then kick an

How to find the specific BLE 4.0 peripheral from two devices with same service UUID

瘦欲@ 提交于 2019-12-08 07:35:57
问题 For BLE 4.0, it provides API to discover peripherals with array of service UUID. I just want to find the specific one. How to achieve this ? If need assign the identifier to the specific device, how to do it ? (I think my question need some context of core bluetooth of iOS. ) 回答1: The process for reconnecting to known peripherals is described in the Core Bluetooth Programming Guide. Essentially if you know the UUID of the device you want to reconnect to (which is the identifier property of