core-bluetooth

How to write data to multiple Bluetooth LE slaves simultaneously on CoreBluetooth?

試著忘記壹切 提交于 2019-12-10 12:15:26
问题 I am new to this. I am trying to work on an iOS application where i can to exchange data to multiple Bluetooth LE slaves. I am able to connect and read from the multiple slaves. But the problem is i can only write (sound buzzer) to only one of them (the latest slave to be connected). I am using the code provided in http://processors.wiki.ti.com/index.php/Category:IPhone4SBLEDemo How is it possible to sound buzzer for all connected devices? ViewController.m - (IBAction)TIBLEUISoundBuzzerButton

CoreBluetooth - Writing data from Central to Peripheral

China☆狼群 提交于 2019-12-10 12:13:25
问题 I referred Sample app provided by Apple for CoreBluetooth and I succeeded in sending Data from Peripheral to Central, Now I need to write Data from Central to Peripheral. After Googling i found that It can be done using [_discoveredPeripheral writeValue:aData forCharacteristic:charc type:CBCharacteristicWriteWithResponse]; Following is my Implementation of Central, to send Message to peripheral: -(void)sendMessage:(NSString *)strMessage{ NSData *aData = [strMessage dataUsingEncoding

Refreshing RSSI value of many bluetooth peripherals

你说的曾经没有我的故事 提交于 2019-12-10 11:49:02
问题 I'm trying to mesure RSSI indicator on iOS (6 with BLE) from several bluetooth peripheral. I can get RSSI with scanForPeripheral : NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], CBCentralManagerScanOptionAllowDuplicatesKey, nil]; [_manager scanForPeripheralsWithServices:nil options:options]; coupled with: - (void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *

How to convert value of Type 'CBManagerState' to expected type 'CBCentralManagerState' after conversion to Swift 3.0 syntax?

*爱你&永不变心* 提交于 2019-12-10 11:36:50
问题 I am working on an iOS App which uses the CoreBluetooth Central Manager. The app was working as expected, until I updated to xCode 8. This update somehow forced me to convert the code from Swift 2.3 to Swift 3.0 with the conversion manager. After this, I got the error message 'cannot convert value of Type 'CBManagerState' to expected argument type 'CBCentralManagerState' and I was searching for an answer, but due to the reason the update is new, there aren't any helpful issues or

Send Data from CentralManager to PeripheralManager using CoreBluetooth (BLE)

老子叫甜甜 提交于 2019-12-10 10:19:02
问题 I have my app running on two iOS device (both have 6.1.4) where one device acts as the Central and one acts as a Peripheral. I have been successful in getting notifications (characteristics set up to notify) from the Peripheral over to the Central just fine. However, I was wanting to write a value from the Central to the Peripheral to a specific writable characteristic but that always fails. The peripheral:didWriteValueForCharacteristic:error: delegate's method is immediately called where the

How to read a BLE Characteristic Float in Swift

∥☆過路亽.° 提交于 2019-12-10 09:03:42
问题 I am trying to connect to a Bluetooth LE / Bluetooth Smart / BLE health device's Health Thermometer Service (0x1809), as officially described here: https://developer.bluetooth.org/gatt/services/Pages/ServiceViewer.aspx?u=org.bluetooth.service.health_thermometer.xml. Specifically, I'm requesting notifications from the Health Thermometer Characteristic (0x2A1C), with description here: https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth

CoreBluetooth pairing feedback / callback

你。 提交于 2019-12-10 03:49:07
问题 It feels like I'm missing something here, but how can I get feedback on whether pairing a passcode protected peripheral failed or succeeded? When I to connect a peripheral which is password protected the password UIAlertView pops up and the peripheral connects (didConnectPeripheral is called) and disconnects (didDisconnectPeripheral) immediately. [bluetoothManager connectPeripheral:peripheral options:nil]; Now whether I enter the correct passcode, the wrong passcode or simply press cancel: on

CoreBluetooth in Background at Scheduled Time

左心房为你撑大大i 提交于 2019-12-09 16:07:56
问题 Problem: I need to remain disconnected from a BLE peripheral but send data it's data to a server for processing as often as possible, as it is potentially time-critical. In other words, I want to connect every so often and send the synced data to an API, while remaining disconnected at all other times to save battery life. Failed Attempt: Setting the UIBackgroundModes field of my app's Info.plist file to bluetooth-central only gives me background execution while I am connected. I want to

CoreBluetooth advertising in background on iOS 10

柔情痞子 提交于 2019-12-09 11:09:46
问题 First: I have an iPad Air 2, and an iPhone 7. For further reading we estimate that the app is active and open on iPad and in background mode on iPhone. The app is exactly the same, even with same Bluetooth Service UUIDs and same DataLocalNameKey. I want to write an app that can advertise a bluetooth service in background and is able to discover this service (optimal in background too). As I already read I can't use apples beacon technology cause there it's only possible to get scanning

Check Bluetooth status - Swift 4

孤街醉人 提交于 2019-12-09 08:21:55
问题 I have a problem with the Bluetooth in Xcode. I can’t find a great solution on how to check if Bluetooth is on or not. I want just that. I searched around the web some solution, but nothing works for me. Any idea on how to check Bluetooth? I imported the CoreBluetooth class and I made this line of code: if CBPeripheralManager.authorizationStatus() == .denied { code } if CBPeripheralManager.authorizationStatus() == .authorized { code } 回答1: Implement CBCentralManagerDelegate delegate for that.