core-bluetooth

iOS 8.0 bluetooth peripheral manager giving no callback for addService

耗尽温柔 提交于 2020-01-11 09:51:14
问题 I have created a bluetooth peripheral manager. I am adding some services to this peripheral manager using [self.peripheralManager addService:myService]. For iOS7.0 I am getting a callback for this method - (void)peripheralManager:(CBPeripheralManager *)peripheral didAddService:(CBService *)service error:(NSError *)error But for iOS8.0 I am not getting any callback for the same method and I am not able to establish a connection. Here are the steps that I followed: Create a peripheral manager

iOS 8.0 bluetooth peripheral manager giving no callback for addService

倾然丶 夕夏残阳落幕 提交于 2020-01-11 09:51:11
问题 I have created a bluetooth peripheral manager. I am adding some services to this peripheral manager using [self.peripheralManager addService:myService]. For iOS7.0 I am getting a callback for this method - (void)peripheralManager:(CBPeripheralManager *)peripheral didAddService:(CBService *)service error:(NSError *)error But for iOS8.0 I am not getting any callback for the same method and I am not able to establish a connection. Here are the steps that I followed: Create a peripheral manager

terminate a connection CBPeripheralManager side

只愿长相守 提交于 2020-01-11 06:34:06
问题 Is there a recommended way for CBPeripheralManager to terminate a connection. The best way I have found so far is simply not to respond to dynamic value, then the BLE stack seems to close the connection, but that seems rather crude. There must be a better way? 回答1: No, you can't forcefully close a connection in a clear way from the peripheral side. There is no API for it. You can break the connection abruptly by not responding to a request, which results in disconnection at most after 30

didDisconnectPeripheral function is not being called

假装没事ソ 提交于 2020-01-07 02:29:40
问题 I'm going to break down what the flow for connection is for the first time a user wants to connect to a BLE Peripheral Device. I think I may be doing something that upsets the natural flow of the CoreBluetooth Module. My app currently works with regards to connecting and sending commands to a BLE device. To connect, I first land on a page with a tableview which displays the devices available to connect to. override func viewDidLoad() { super.viewDidLoad() //self.centralManager =

Bluetooth low energy (BLE 112 ) Difference between BGAPI and BGScript

夙愿已清 提交于 2020-01-06 07:15:52
问题 What is the Difference between BGAPI and BGScript ? And if we write any code for BG profile than how can we burn it in BLE 112? 回答1: The BGAPI interface defines the protocol used to talk to the module over USB or serial link. BGScript is something which runs on the module processor itself, when the USB or serial link is not used. I have the dongle, BLED112, which is the same thing as BLE112 with a USB connector on it, and the code is "burned" to it using standard USB DFU interface. The

How do you scan for the same BLE device twice?

最后都变了- 提交于 2020-01-06 03:07:20
问题 I have an iOS app that scans for BLE peripherals, of which there may be many, and allows the user to decide whether or not to connect to the device. Once connected, the user can also decide to break the connection. All of this works fine. I would also like to add an option to allow the user to change their mind and rescan for a device, but this seems to be problematic. The most obvious way to do this seems to be to stop scanning and restart it, as in: [centralManager stopScan]; CBUUID

How to get the characteristic from UUID in objective-C?

ε祈祈猫儿з 提交于 2020-01-06 02:32:49
问题 I am developing for BLE in objective-C. I define the UUID like the following code: static NSString *const LEDStateCharacteristicUUID = @"ffffffff-7777-7uj7-a111-d631d00173f4"; I want to write characteristic to BLE device by following code , it need to pass 3 parameter:1.Data 2.Characteristic 3.type CBCharacteristic *chara = ??? // how to set the characteristic via above UUID let it can pass to following function? [peripheral writeValue:data forCharacteristic:chara type

iOs CoreBluetooth Central Server and Peripheral Client

天涯浪子 提交于 2020-01-05 19:29:30
问题 Currently, iOS does not support the combination GAP Central role and ATT Server role as well as the combination GAP Peripheral role and ATT Client role. Is Apple working on this? Does someone know when it will be possible to do so ? 回答1: If you develop a non iOS peripheral, then you should be able to start acting as ATT client once the iOS central connected to you. The ATT database is shared accross applications and should be accessible this way. You can initialize it in a separate app or in

iOS corebluetooth data send issue

被刻印的时光 ゝ 提交于 2020-01-05 07:28:35
问题 I am using corebluetooh api to send data to Bluetooth device . on android its working fine but on ios its not working. I am sending data as follows public override void DiscoveredCharacteristic(CBPeripheral peripheral, CBService service, NSError error) { System.Console.WriteLine("Discovered characteristics of " + peripheral); foreach (var characteristic in service.Characteristics) { Console.WriteLine("Write Value of characteristic " + characteristic.ToString() + " is " + characteristic.Value)

CoreBlueTooth delegate didWriteValueForCharacteristic called with a value null

爱⌒轻易说出口 提交于 2020-01-04 12:17:21
问题 I set notify to a characteristic, and then write some data(It's the address to be read and read data length) to another characteristic. Delegate didUpdateValueForCharacteristic will be called, but the characteristic.value is zero (should have some value) with the correct length. I also check the delegate didWriteValueForCharacteristic. This will be called after I write the data, but in the delegate, characteristic.value is null while the characteristic.UUID is the same as I wrote. So when