cbperipheral

In iOS 10+, is there ANY way to RELIABLY wake up an app

半世苍凉 提交于 2019-12-04 04:56:17
问题 I have been at this over 3 months and pulling my hair out. So please don't respond with beginner answers. I am wondering if, in 2017 with iOS 10+, there is ANY way possible to wake up the app from terminated state... preferably by bluetooth peripheral... but i'll take what I can get! I consider terminated to be when user swiped the app in task manager or when the peripheral is turned on/off and the app was already dead I need important health related BT peripheral data (recorded by BT device)

How To Store a CBPeripheral For Use in Other Views

谁说我不能喝 提交于 2019-12-04 03:07:36
I setup a few BLE connections in my view controller, SViewController, and I need to store the peripherals for use in other view controllers. I've tried creating an NSUserDefault object and storing the peripherals in there, but I got the error "Attempt to insert non-property value" , and it never inserted. I then tried wrapping it up in an NSData object and storing it in NSUserDefaults, but got the error "-[CBConcretePeripheral encodeWithCoder:]: unrecognized selector sent" and the app crashed. So that definitely did not work. I've also tried making the three CBPeripheral variables global, but

CoreBluetooth: Refreshing local name of an already discovered Peripheral

我是研究僧i 提交于 2019-12-04 02:03:46
I successfully discover a Peripheral and retrieve its local name: [advertisementData objectForKey:CBAdvertisementDataLocalNameKey] But if the Peripheral stops and restarts advertising with a different local name, the Client doesn't recognise the change. I guess - (void)peripheralDidUpdateName:(CBPeripheral *)peripheral only works if the two devices are paired. Is there a way to get an update without pairing? Apple's bug. Still present in iOS 6.1. Here is the trick how to reset CB cache: BackUP device to iCloud. Reset network settings. Delete your app and install it back via Xode At this point,

CBCharacteristic value in swift3

雨燕双飞 提交于 2019-12-03 15:14:26
问题 I am beginner in swift development. I was working on BLE based application. Today I updated Xcode 8, iOS 10 and convert my code to swift3. Then some of my syntax are need to convert. After fixing this , I found one issue on CBCharacteristic. Issue Inside didUpdateValueforCharacteristic , I can get updated CBCharacteristic object. If I print out whole object, it show correctly. -> value = <3a02> When I retrieved value from CBCharacteristic , characteristic.value -> 2bytes (size of this value)

CoreBluetooth: How to design code for many characteristics (30 - 40)?

徘徊边缘 提交于 2019-12-03 12:08:25
I searched around a bit and just found this as a possible duplicate question: Multiple CBPeripheral's for same device My problem is: I have multiple services which all together have about 30-40 characteristics (Yes, I need all of them...). As starting point for dealing with CoreBluetooth I always used the Apple Sample Code ( CoreBluetooth Temperature Sensor ). Discovery and Service/Characteristic handling is divided into two classes and this works fine for just a few characteristics. But handling this huge amount of characteristics in one class is not what I understand under "good software

Central writing characteristic to Peripheral (iOS Core Bluetooth)

不想你离开。 提交于 2019-12-03 09:10:09
Okay, so I've looked through a thousand tutorials and other Stack Overflow threads (so please don't list as duplicate without answering the question) and I cannot work out how to use this functionality. I have followed this tutorial: http://code.tutsplus.com/tutorials/ios-7-sdk-core-bluetooth-practical-lesson--mobile-20741 I have a system where a central can connect to a peripheral and read a characteristic from it. I am now trying to get my central to rewrite the data within the characteristic but am finding the write line that I have called just being ignored. I have declared my

CBCharacteristic value in swift3

梦想与她 提交于 2019-12-03 03:58:36
I am beginner in swift development. I was working on BLE based application. Today I updated Xcode 8, iOS 10 and convert my code to swift3. Then some of my syntax are need to convert. After fixing this , I found one issue on CBCharacteristic. Issue Inside didUpdateValueforCharacteristic , I can get updated CBCharacteristic object. If I print out whole object, it show correctly. -> value = <3a02> When I retrieved value from CBCharacteristic , characteristic.value -> 2bytes (size of this value) func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error:

Reconnect a CBPeripheral faster

[亡魂溺海] 提交于 2019-12-03 03:56:54
I'm developing an app which connects and disconnects several times to different bluetooth low energy peripherals. After a lot of research on the internet, I didn't have found a way to store already discovered services and characteristics, so that I can reconnect faster. At the moment I'm discovering the required services and characteristics after each reconnection, which costs me between 1.5 and 2 seconds. Does someone have experience or a solution to store/cache a CBService or a CBCharacteristic or does someone know a way to reconnect faster? Thanks for any help I've tried caching peripheral,

In iOS 10+, is there ANY way to RELIABLY wake up an app

守給你的承諾、 提交于 2019-12-01 23:00:15
I have been at this over 3 months and pulling my hair out. So please don't respond with beginner answers. I am wondering if, in 2017 with iOS 10+, there is ANY way possible to wake up the app from terminated state... preferably by bluetooth peripheral... but i'll take what I can get! I consider terminated to be when user swiped the app in task manager or when the peripheral is turned on/off and the app was already dead I need important health related BT peripheral data (recorded by BT device) maintained in the app so I need a consistent connection or the ability to wake the app back up and

I want to trigger iOS7 to ask users permission to use Bluetooth and Twitter account

别来无恙 提交于 2019-12-01 09:08:25
This is somewhat backward to what most people ask. I want to purposely trigger the dialog asking for the users permission to: Connect to bluetooth devices, even when offline. Access there iOS-based Twitter account. I already have a similar dialog for location working fine. I'm doing this because I want to make the process of asking permission a bit more gentle, like Heyday, by showing a welcome screen explaining why the app needs this service then when the user taps OK, initiating the request and triggering the dialog. I have tried some things already. For Twitter I have tried the following: -