core-bluetooth

CoreBluetooth: Attempt to write to device

倖福魔咒の 提交于 2019-12-24 14:26:09
问题 I have a connected & paired up Bluetooth LE bracelet (Service ID: FF20), which have 2 characteristics: 0xFF21 : Write without Response 0xFF22 : Notify Now I try to write data via CoreBluetooth Framework to 0xFF21 with the following code: I defined 2 constants at header file: #define TRANSFER_SERVICE_UUID @"FF20" #define TRANSFER_SERVICE_CHARACTERISTIC_UUID @"FF21" .m - (void)viewDidLoad { [super viewDidLoad]; _centralManager = [[CBCentralManager alloc] initWithDelegate:self queue:nil]; } -

Advertising Bluetooth Raspberry Pi Peripheral and iOS Central

吃可爱长大的小学妹 提交于 2019-12-24 07:36:03
问题 I'm trying to connect a Raspberry Pi to an iPhone. I've come a long way but have been hitting the same brick wall for the last couple of days. Perhaps someone here could help me figure out what I'm missing. So far, I have: Created an iOS app that broadcasts as a peripheral Created an iOS app that acts as a Central When testing on an iPhone 5 and iPhone 6, both devices can talk to each other. Created a Java App using the Bluecove library that broadcasts as a peripheral on a Raspberry Pi.

How do I remove paired Bluetooth devices on iOS?

别来无恙 提交于 2019-12-24 07:22:17
问题 I want my app could remove paired bluetooth devices. Becaues if device paried with iPhone, the device couldn't used for another device. I tried CBCentralManager cancelPeripheralConnection, but it doesn't work. they're still paired. Or there's some other app still connected this server? iPhone5,iOS7 回答1: You cannot unpair a device programmatically in iOS. The cancelPeripheralConnection is only to disconnect your apps connection to the device. Discussion This method is nonblocking, and any

How do I remove paired Bluetooth devices on iOS?

邮差的信 提交于 2019-12-24 07:21:17
问题 I want my app could remove paired bluetooth devices. Becaues if device paried with iPhone, the device couldn't used for another device. I tried CBCentralManager cancelPeripheralConnection, but it doesn't work. they're still paired. Or there's some other app still connected this server? iPhone5,iOS7 回答1: You cannot unpair a device programmatically in iOS. The cancelPeripheralConnection is only to disconnect your apps connection to the device. Discussion This method is nonblocking, and any

Getting list of available bluetooth devices in ios

对着背影说爱祢 提交于 2019-12-24 04:12:13
问题 Is there a way to get list of mac addresses of available bluetooth devices in ios? I'm working on a programm which finds people nearby using bluetooth mac addresses. 回答1: I'm sure you have: [centralManager scanForPeripheralsWithServices:nil options:nil]; That means your app is searching for BLE peripherals. Every time your app discovers a peripheral invokes: - (void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *

Bluetooth LE maximum transmission size

守給你的承諾、 提交于 2019-12-24 02:42:45
问题 We are currently working with Bluetooth LE and want to send a 128 character string to a gatt service. Now the Bluetooth Specs say that the maximum packet size of BLE is 22 bytes, my string will never fit in the packet. We are thinking about chunking it up and send it in iterations. Is this the usual way of doing things? 回答1: Yes, you need to chunk the data into 18 bytes pieces, then send a series of Prepare Write Request s to the Server. Each of this request has 3 parameters: Attribute handle

Dose CoreBluetooth work on IOS6.0,IOS6.1,IOS6.1.2?

允我心安 提交于 2019-12-24 02:25:26
问题 i am working on bluetooth4.0 , but i found that CoreblueTooth cannot run on iOS 6+,my iphone4s is IOS 6.1.2. it cannot find any device(i am sure the device is power on), the Log as below every time: CoreBluetooth[WARNING] is not powered on Dose anyone have encounter this issue? 回答1: The status CBCentralManagerStatePoweredOn means not only that Bluetooth is turned on, but also that your instance of CBCentralManager or CBPeripheralManager is ready to use. You must initialize your manager, then

iOS CoreBluetooth reconnecting device with UUID

青春壹個敷衍的年華 提交于 2019-12-24 01:47:27
问题 I have a Bluetooth 4.0 (BLE) device using the CC2541 chipset which I am interfacing with via the iOS Core Bluetooth Framework. I can successfully make a connection to the device using Core Bluetooth when the device is in a discoverable/advertising mode and transfer data to and from the device without any problem. I maintain a collection of device UUIDs that I have connected with and I am now attempting to connect to one of these devices again using: CBCentralManager - (void

what is the difference between bounded and unbounded device?

拈花ヽ惹草 提交于 2019-12-23 17:53:14
问题 I’m new to both iOS and BLE, so kindly bear with me if this question is very basic. What is the distinction between bounded and unbounded devices? I’m working with CBCentralManager for BLE in iOS, and I’m trying to figure out how to pair them through CBCentralManager . 回答1: You don't need to do anything different app, iOS will handle the binding if required. Bounded connections are in a way "paired" to the iOS device. Once bounded they will not communicate to any other device. Bounding is

How does one unit test code that interacts with the Core Bluetooth APIs?

时光毁灭记忆、已成空白 提交于 2019-12-23 12:36:30
问题 I would like to unit test a class that acts as a CBPeripheralManagerDelegate to the CBPeripheralManager class. Typically, in order to stub out an external class dependency, I would use either a form of dependency injection by passing in via the class initializer or via a property. When dealing with singleton-based API's, I have been able to use libraries like Kiwi to stub the class level method that returns the singleton (i.e. [ClassName stub:@selector(sharedInstance) andReturn