core-bluetooth

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

泪湿孤枕 提交于 2019-12-21 04:13:23
问题 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

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

倾然丶 夕夏残阳落幕 提交于 2019-12-21 04:13:12
问题 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

Maximum data size when sending data via BTLE on iOS

本秂侑毒 提交于 2019-12-21 04:04:10
问题 I am currently implementing an iOS application that uses CoreBluetooth to transfer data between 2 devices. For example, to send data from the central to the peripheral, I use this code: NSData *data = [NSJSONSerialization dataWithJSONObject:dictionary options:NSJSONWritingPrettyPrinted error:nil]; NSLog(@"Writing data of length %d", [data length]); [peripheral writeValue:data forCharacteristic:characteristic type:CBCharacteristicWriteWithResponse]; This works absolutely fine, but the thing is

CBPeripheral name is sometimes null

孤街醉人 提交于 2019-12-21 04:04:08
问题 I'm working on developing an app to communicate with a Bluetooth LE peripheral. The peripheral I am testing with at the moment is one of these. The interesting thing is, sometimes when I discover it I get its proper name, "SimpleBLEPeripheral", sometimes I just get (null) . There doesn't seem to be any command I can send to the CBPeripheral to force a read update on the name, so how can I ensure that I actually get the advertised name of the peripheral? 回答1: If you get the name from the

IOS Core Bluetooth : Writing NSData for Characteristic

﹥>﹥吖頭↗ 提交于 2019-12-21 02:54:26
问题 I am using the following code to write the 0xDE value for a Bluetooth Caracteristic (Reset Device) using the IOS Core Bluetooth : ... NSData *bytes = [@"0xDE" dataUsingEncoding:NSUTF8StringEncoding]; [peripheral writeValue:bytes forCharacteristic:characteristic type:CBCharacteristicWriteWithResponse]; ... is there any mistake in my code because the value is not written properly? 回答1: Try creating your data with an array of single byte values. const uint8_t bytes[] = {0xDE}; NSData *data =

ReadRSSI doesn't call the delegate method

南笙酒味 提交于 2019-12-21 01:21:12
问题 I got a problem since the iOS 8 update, right now my app is connected to a BLE device and periodically reads the RSSI thanks to a timer and the ReadRSSI method. The readRSSI method is called (checked with a breakpoint) so until this point everything is fine. According to the documentation calling the readRSSI should trigger the callback - (void)peripheral:(CBPeripheral *)peripheral didReadRSSI:(NSNumber *)RSSI error:(NSError *)error However, this delegate method is not called every time. But

Using CoreBluetooth with iBeacons

╄→尐↘猪︶ㄣ 提交于 2019-12-20 14:38:57
问题 I've been doing quite a bit of research on iBeacons and CoreBluetooth on iOS devices. Your posts and research have been great. I've learned quite a bit. Unfortunately, i'm running into a dead end as it pertains to what I actually want to do. I was reading this post: http://developer.radiusnetworks.com/2013/10/21/corebluetooth-doesnt-let-you-see-ibeacons.html.... ...and it points out that you can't really do much with CoreBluetooth without the proximityUUID. That said, what if I actually DO

How does iBeacon wake up our app? For how long? And how to extend that time?

*爱你&永不变心* 提交于 2019-12-20 10:12:00
问题 after some research of iBeacon I came up with the following questions that I couldn't find extended help: How does iBeacon wake up our app? Does it wake up our app by putting our app into background mode if the app was suspended? What background mode did iBeacon put our app into? What can we do in this background mode? How long can this background mode last before it is suspended again? When it is about to be suspended, what function was invoked? How can we extend this background time if we

ios CoreBluetooth[WARNING] Unknown error: 1309

ε祈祈猫儿з 提交于 2019-12-20 09:54:12
问题 I am sporadically getting the message "CoreBluetooth[WARNING] Unknown error: 1309” on the console when running a BlueTooth app I am developing. Even though the message states that it is a warning, it stops execution of the app. I have been able to work around this problem by turning the Bluetooth setting off and then back on. Can anyone tell me what is causing this and what I should do to avoid it? 回答1: That's a known issue, It's caused due to deadlock in CoreBluetooth (Apple's bug), 1309

iPhone corebluetooth central Manager send data to peripheral

落爺英雄遲暮 提交于 2019-12-20 09:40:01
问题 I want to send data from iPhone to a bluetooth device which get discovered and connects. I am referring this tutorial to connect. I am not able to send data to external bluetooth device which is connected as we do with External Accessory framework. I am using iPhone5 as it has Bluetooth 4.0 回答1: In Core Bluetooth you need to use the characteristics for communication. There is no standard stream based API like in the External Accessory Framework and I don't know of any open source libraries