cbperipheral

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

How to find the specific BLE 4.0 peripheral from two devices with same service UUID

瘦欲@ 提交于 2019-12-08 07:35:57
问题 For BLE 4.0, it provides API to discover peripherals with array of service UUID. I just want to find the specific one. How to achieve this ? If need assign the identifier to the specific device, how to do it ? (I think my question need some context of core bluetooth of iOS. ) 回答1: The process for reconnecting to known peripherals is described in the Core Bluetooth Programming Guide. Essentially if you know the UUID of the device you want to reconnect to (which is the identifier property of

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

一个人想着一个人 提交于 2019-12-07 12:38:28
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 didConnectPeripheral:(CBPeripheral )peripheral { NSLog(@"connect peripheral"); unsigned char bytes[] = {

How long is a CBPeripheral's stored UUID valid for reconnection? [duplicate]

拥有回忆 提交于 2019-12-06 16:27:53
This question already has an answer here : CoreBluetooth: What is the lifetime of unique UUIDs (1 answer) Closed 5 years ago . I've been playing with Corebluetooth and I've learnt that besides going through the tedious process of scanning for a peripheral every time I want to connect, I can also store the peripheral's UUID and use it with retrievePeripheralsWithIdentifiers and connectPeripheral for further reconnections. Turns out that it only works for a certain amount of time, apparently the peripheral has its UUID updated, therefore the stored one can be considered expired. I haven't been

Peripheral transmit queue issue

£可爱£侵袭症+ 提交于 2019-12-06 08:38:22
问题 I’m working on a simple wrapper around CoreBluetooth to send any data to any device. During developing I encountered a lot of bugs in framework, they were very annoying and to make my wrapper stable I had to shorten some of functionality for reliability. For now I’m working on sending data from peripheral. Ok, so I have following case: Client asks for value of dynamic characteristic I get a callback on server-side - peripheral:didReceiveReadRequest:. Note : I need to respond to this

How To Store a CBPeripheral For Use in Other Views

孤街浪徒 提交于 2019-12-05 20:28:28
问题 I setup a few BLE connections in my view controller, SViewController, and I need to store the peripherals for use in other view controllers. I've tried creating an NSUserDefault object and storing the peripherals in there, but I got the error "Attempt to insert non-property value" , and it never inserted. I then tried wrapping it up in an NSData object and storing it in NSUserDefaults, but got the error "-[CBConcretePeripheral encodeWithCoder:]: unrecognized selector sent" and the app crashed

CoreBluetooth: Refreshing local name of an already discovered Peripheral

∥☆過路亽.° 提交于 2019-12-05 17:10:09
问题 I successfully discover a Peripheral and retrieve its local name: [advertisementData objectForKey:CBAdvertisementDataLocalNameKey] But if the Peripheral stops and restarts advertising with a different local name, the Client doesn't recognise the change. I guess - (void)peripheralDidUpdateName:(CBPeripheral *)peripheral only works if the two devices are paired. Is there a way to get an update without pairing? 回答1: Apple's bug. Still present in iOS 6.1. Here is the trick how to reset CB cache:

Peripheral transmit queue issue

和自甴很熟 提交于 2019-12-04 14:28:13
I’m working on a simple wrapper around CoreBluetooth to send any data to any device. During developing I encountered a lot of bugs in framework, they were very annoying and to make my wrapper stable I had to shorten some of functionality for reliability. For now I’m working on sending data from peripheral. Ok, so I have following case: Client asks for value of dynamic characteristic I get a callback on server-side - peripheral:didReceiveReadRequest:. Note : I need to respond to this CBATTRequest in this method - I can’t store it elsewhere and respond to it asynchronously. (Im just putting some

CoreBluetooth Central --> Peripheral

痴心易碎 提交于 2019-12-04 13:24:37
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:CBCharacteristicPropertyNotify value:nil permissions:CBAttributePermissionsReadable]; _writeChar = [

Reconnect a CBPeripheral faster

眉间皱痕 提交于 2019-12-04 10:03:13
问题 I'm developing an app which connects and disconnects several times to different bluetooth low energy peripherals. After a lot of research on the internet, I didn't have found a way to store already discovered services and characteristics, so that I can reconnect faster. At the moment I'm discovering the required services and characteristics after each reconnection, which costs me between 1.5 and 2 seconds. Does someone have experience or a solution to store/cache a CBService or a