core-bluetooth

iOS 7 Core Bluetooth Peripheral running in background

烈酒焚心 提交于 2019-12-20 09:03:22
问题 What I want is for my iOS device to be advertising a Bluetooth LE service all the time, even when the app isn't running, so that I can have another iOS device scan for it and find it. I have followed Apple's backgrounding instructions here: https://developer.apple.com/library/ios/documentation/NetworkingInternetWeb/Conceptual/CoreBluetooth_concepts/PerformingCommonPeripheralRoleTasks/PerformingCommonPeripheralRoleTasks.html#//apple_ref/doc/uid/TP40013257-CH4-SW1. I can get it to advertise in

Core Bluetooth and backgrounding: Detection of a device and triggering an action, even after being days in background mode?

女生的网名这么多〃 提交于 2019-12-20 08:04:46
问题 I've written an app that needs to get informed when a certain Bluetooth Low Energy device comes within range. If the BLE device gets noticed my app just stores a timestamp. As stated in the WWDC 2012 Core Bluetooth videos, there are two possibilities for apps for acting in background mode when working with Core Bluetooth: Event Backgrounding Event backgrounding is probably what most Apps will use when interacting with Bluetooth Low Energy devices. This mode does not allow for direct

didDiscover peripheral not called

点点圈 提交于 2019-12-20 06:27:15
问题 I want to use the CBCentralManager in order to find the bluetooth low energy peripherals around me. The centralManager is getting initiated, it starts correctly and it is scanning. But the didDiscover function is never called. I read all the other posts to this and similar problem and am 99% sure that my problem has not the same cause. Still, I cannot find what I did wrong. import Foundation import CoreBluetooth @objc(SmallerBeaconServiceImpl) class SmallerBeaconServiceImpl : NSObject,

How to decode the BLE advertisement data

懵懂的女人 提交于 2019-12-20 04:48:26
问题 After scanning for the BLE device, I call the below method: - (void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI and receive the following advertisement data as such: { kCBAdvDataManufacturerData = <ffff0215 cf6d4a0f ..... adf2f491 ... ... > } How can I decode the data and access its information? 回答1: It seems that you are expecting this advertising packet to be decodable

Bluetooth Low Energy advertising to be discoverable in iOS Settings

给你一囗甜甜゛ 提交于 2019-12-20 04:24:38
问题 I have an iOS app which is using CBPeripheralManager to implement a peripheral. I start advertising with the command: [self.peripheralManager startAdvertising:@{CBAdvertisementDataLocalNameKey : @"MY_DEVICE_NAME"}]; According to the Apple docuentation, https://developer.apple.com/library/ios/documentation/CoreBluetooth/Reference/CBPeripheralManager_Class/index.html#//apple_ref/occ/instm/CBPeripheralManager/startAdvertising: only two of the keys are supported for peripheral manager objects:

how to list the paired bluetooth devices from iphone corebluetooth api

若如初见. 提交于 2019-12-20 03:54:15
问题 I am trying to list the paired bluetooth devices. I know that I can get the list of connected devices by using retrieveConnectedPeripherals. So my question is how I can get paired devices programatically from iphone SDK. Thanking you all in advance. Regards Bhaban 回答1: You can use this BluetoothSerial. it will serve you all what you want. Lists bonded devices bluetoothSerial.list(success, failure); 来源: https://stackoverflow.com/questions/20279886/how-to-list-the-paired-bluetooth-devices-from

How to List discoverable Bluetooth devices and already paired devices in iOS, which method to use in swift?

孤街浪徒 提交于 2019-12-19 06:59:52
问题 I would like to include Bluetooth feature on my app using swift. I want to list all nearby/discoverable peripheral devices including those devices are already paired Which method i should use for listing the paired devices. Im using CoreBlutooth framework for implementing Bluetooth availability check. If Bluetooth works fine i would like to list out paired devices. And if possible please provide the method for connecting the device directly from the listed paired devices func

Cannot find peripheral when scanning for specific service CBUUID

别说谁变了你拦得住时间么 提交于 2019-12-19 04:08:32
问题 When I use: CBUUID * uuid = [CBUUID UUIDWithString:@"1800"]; // GAP DEBUG_LOG(@"CBUUID: %@",uuid); // CBUUID: Generic Access Profile _centralMan = [[CBCentralManager alloc] initWithDelegate:self queue:nil]; [_centralMan scanForPeripheralsWithServices:[NSArray arrayWithObject:uuid] options:nil]; I cannot find my peripheral, but when I use: _centralMan = [[CBCentralManager alloc] initWithDelegate:self queue:nil]; [_centralMan scanForPeripheralsWithServices:nil options:nil]; …it shows up

iOS CoreBluetooth not scanning for services in iPad Air

坚强是说给别人听的谎言 提交于 2019-12-19 04:02:36
问题 I'm working on a app that connects to a BLE peripheral and receives data from it. It scans for peripherals, finds a peripheral, discovers services, and if the right service is found, it receives data. It works great on an iPhone 5, but when I run it on an iPad Air it connects , but doesn't discover any services, and receives no data. Both devices run iOS 7.0.4 This is some of the relevant parts of the code - (void)startScan { [manager scanForPeripheralsWithServices:nil options:nil]; } - (void

CoreBluetooth repeatedly disconnecting

那年仲夏 提交于 2019-12-19 02:47:07
问题 I've looked up and down for this problem, but no one seems to have it. I have two iPads. One is acting as a Bluetooth peripheral that is always in the foreground. Since I am more interested in the central side, I have made my central iPad background-capable for BLE-central. My workflow is as follows: Central app runs and starts scanning Peripheral advertises service (or comes within range) Central device connects to peripheral and stops scanning Peripheral stops advertisement (or leaves range