cbcentralmanager

How to send RGB signal to BLE device using iPhone application?

烂漫一生 提交于 2020-01-03 03:15:08
问题 We are working on iOS application and in which we need to pass the RGB signal to the BLE device and based on RGB code the device LED will glow. We are doing the connection using CBCentralManager for the CBPeripheral object of Bluetooth Framework in iOS app. We are setting the characteristic and descriptor UUID but still we are not able to send the signal on the BLE device. Here is the code we are using to pass RGB data in hex bytes format. - (void)centralManager:(CBCentralManager )central

CoreBluetooth Central --> Peripheral

倾然丶 夕夏残阳落幕 提交于 2020-01-01 16:49:53
问题 I'm quite new to bluetooth communication. My first project intends to transfer data from an iOS device to a BLEshield (small chip). To test my central code, I decided to setup an iPhone as peripheral (the role the chip will have, once I got it) and an iPad as Central. I can connect the devices and also send data from the peripheral to the central. It's quite easy though: - (void)startService { _readChar = [[CBMutableCharacteristic alloc] initWithType:[CBUUID ...] properties

iOS CoreBluetooth - Peripheral connect to Central within range

霸气de小男生 提交于 2019-12-25 01:34:02
问题 I have a basic BLE App that I am running with Objective-C. I am using PeripheralManager and running my iPhone8 as a peripheral with serivces, characteristics added. What I would like to do is connect to a central device that I know by Device ID or when it comes within range. I have written a BLE App for Android that does this now. All I have to do is trigger the device.connectGatt() when onConnectionStateChange() is connected. This is in the BluetoothGattServerCallback() eventHandler. What is

didDiscoverPeripheral not been called after advertising another iOS device

混江龙づ霸主 提交于 2019-12-23 02:25:12
问题 basically i have two apps, one for scanning for bluetooth devices and the other for advertising, and what i am trying to do is to get a list of all iOS devices, within my proximity on the app which scans for the iOS device . This is my code so far: Scanning.m: // Scan for all available CoreBluetooth LE devices NSDictionary *scanOptions = @{CBCentralManagerScanOptionAllowDuplicatesKey:@(YES)}; NSArray *services = @[[CBUUID UUIDWithString:@"1CC024D6-E413-4B56-993C-831CAF033366"]]; [self

Central writing characteristic to Peripheral (iOS Core Bluetooth)

萝らか妹 提交于 2019-12-21 03:02:26
问题 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

Bluetooth LE Device scan in background from iOS

老子叫甜甜 提交于 2019-12-18 22:31:50
问题 I am working on to scan BLE in Background mode. Issue is not working in Background scan. Its working very fine in Foreground mode. Below is few code lines. dispatch_queue_t centralQueue = dispatch_queue_create("com.XXXXX.BLEback", DISPATCH_QUEUE_SERIAL);// or however you want to create your dispatch_queue_t manager = [[CBCentralManager alloc] initWithDelegate:self queue:centralQueue options:nil]; - (void)centralManagerDidUpdateState:(CBCentralManager *)central { if (central.state ==

BLE background reconnect

≯℡__Kan透↙ 提交于 2019-12-18 13:32:14
问题 I want to reconnect to BLE device after device is moved out/terminated by user or system/reboted in background mode. I know that it's possible : - see this question with description Question - How can i setup centralManager for automatically reconnect to peripheral in background mode if app was terminated? Can someone describe step-by-step how it can be done? Few word about current implementation: I create centralManager with options like: self.centralManager = [[CBCentralManager alloc]

Not able to scan Through CBCentral Manager with service ID for iBecon Signal

独自空忆成欢 提交于 2019-12-18 09:09:10
问题 Working on iBecon signal using Core Bluetooth i am able to search with CBCentralManager scan optionn nil :- Shared.sharedInstance.centralManager?.scanForPeripherals(withServices: nil, options:[CBCentralManagerScanOptionAllowDuplicatesKey:true]) But when i provide my desirable service ID i.e :- Shared.sharedInstance.centralManager?.scanForPeripherals(withServices: [serviceID], options:[CBCentralManagerScanOptionAllowDuplicatesKey:true]) it never calls didDiscoverPeripheral Delegate method, I

Core Bluetooth State Preservation and Restoration Not Working, Can't relaunch app into background

和自甴很熟 提交于 2019-12-17 16:07:36
问题 I'm trying to make core bluetooth wake up the app even when it's not running. As Apple stated, "Because state preservation and restoration is built in to Core Bluetooth, your app can opt in to this feature to ask the system to preserve the state of your app’s central and peripheral managers and to continue performing certain Bluetooth-related tasks on their behalf, even when your app is no longer running. When one of these tasks completes, the system relaunches your app into the background

How to show an alert when turn off bluetooth in Swift app?

℡╲_俬逩灬. 提交于 2019-12-13 02:54:39
问题 The question could be duplicated, but I have tried a lot of code and it wasn't work. I have read about CBCentralManagerOptionShowPowerAlertKey option and the possibility to show an alert to go settings bluetooth option into iPhone for turn on on the application, but I haven't get works this. If I set the key to true the key not appear, and when I change the value to false the key not works... I'm using this code into my Swift application: var bCentralManger: CBCentralManager! self