core-bluetooth

How to initialize a CBMutableCharacteristic with multiple CBCharacteristicProperties and Permissions

大城市里の小女人 提交于 2019-12-23 07:37:49
问题 I'm creating a new CBMutableCharacteristic for use in a Bluetooth app I'm making. I got some code from a tutorial, which looks like this: _customCharacteristic = [[CBMutableCharacteristic alloc] initWithType:characteristicUUID properties:CBCharacteristicPropertyNotify value:nil permissions:CBAttributePermissionsReadable]; where _customCharacteristic is my CBMutableCharacteristic. However, I want to initialize my _customCharacteristic with other properties, such as CBCharacteristicPropertyRead

Core bluetooth ios 8

[亡魂溺海] 提交于 2019-12-23 05:13:55
问题 I use Core Bluetooth to connect two ios devices. Everything is working perfect for ios 7, but for ios 8 no. Device with ios 8 is not visible as peripheral device. Some code: _peripheralManager = [[CBPeripheralManager alloc] initWithDelegate:self queue:nil]; [_peripheralManager startAdvertising:@{CBAdvertisementDataServiceUUIDsKey: @[[CBUUID UUIDWithString:TRANSFER_SERVICE_UUID]]}]; - (void) peripheral:(CBPeripheral *)peripheral didDiscoverServices:(NSError *)error{ if (error) { [self cleanup]

IOS:Convert hex values from the characterstic.value result

扶醉桌前 提交于 2019-12-23 04:47:12
问题 i am able to retrieve value from the peripheral as hex value and i need to convert as per my requirement.[24/12/14 11:37:00 am] sonali_phatak: I can see that i have received proper response.from 01117100352e36302e313100000000e55a 01 - 01-start byte 11 - 17(Dec) - length of responce packet 71 - response ID 00 - Ignore this byte So now out of total length 17, first 4 bytes are header, last 2 bytes are CRC. We need to read remaining 11 bytes and convert them to ASCII. 35 - 5 2e - . 36 - 6 30 - 0

iOS Bluetooth peripheralManagerDidUpdateState never called

旧巷老猫 提交于 2019-12-23 03:32:24
问题 I'm trying to set up my iPhone to act as a heart rate monitor and send information using the standard heart rate service so that the app I have running on my PC can retrieve the data. I'm a newbie to iOS but I have got bluetooth stuff running on Android and Windows before. I'm following the information here and I'm falling at the first hurdle... As specified in the doc, I first call CBPeripheralManager *myPeripheralManager = [[CBPeripheralManager alloc] initWithDelegate:(id

IOBluetooth is returning no characteristics for some services

会有一股神秘感。 提交于 2019-12-23 03:07:12
问题 I’m trying to read characteristics from a service on a Bluetooth LE device. For some reason, for some characteristics, after calling -[CBPeripheralManager discoverCharacteristics:forService] , the peripheral:didDiscoverServices: callback is getting 0 characteristics. Are there any workarounds to allow me to read the characteristics of this service? When installing Hardware IO Tools for Xcode and running PacketLogger, it is apparent that the discoverServices call is causing a 0x08 Read By Type

locationManager:didEnterRegion and didExitRegion are never getting called :iBeacon

那年仲夏 提交于 2019-12-23 02:56:27
问题 While testing with beacons (ios devices) i found the listener beacon giving some unexpected behavior. locationManager:didEnterRegion method is not getting called even if a beacon enters a region. But the locationManager:didRangeBeacons:inRegion: is getting called correctly, and detected beacons are shown there. - (void)startListening{ self.locationManager = [[CLLocationManager alloc] init]; [self.locationManager setDelegate:self]; NSUUID *myProximityUUID = [[NSUUID alloc] initWithUUIDString

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

爷,独闯天下 提交于 2019-12-23 02:48:35
问题 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

UUIDs of iBeacons are different on different devices

蹲街弑〆低调 提交于 2019-12-23 00:25:13
问题 I'm developing an application that will use iBeacons for indoor navigation, and I found that the rate the function locationManager:rangingBeaconsDidFailForRegion:withError: is being called is not high enough, so I'm going to add the RSSI data from CoreBluetooth's centralManager:didDiscoverPeripheral:advertisementData:RSSI: . And I found a curious fact: when I listen to the iBeacon with CoreLocation and log the peripheral id: - (void)centralManager:(CBCentralManager *)central

Core Bluetooth - Performing Long-Term Actions in the Background

故事扮演 提交于 2019-12-22 18:57:09
问题 This is from the Core Bluetooth Background Processing for iOS Apps section found in official docs: Performing Long-Term Actions in the Background Some apps may need to use the Core Bluetooth framework to perform long-term actions in the background. As an example, imagine you are developing a home security app for an iOS device that communicates with a door lock (equipped with Bluetooth low energy technology). The app and the lock interact to automatically lock the door when the user leaves

Detect nearby mobile devices from an iOS app

ぃ、小莉子 提交于 2019-12-22 18:01:46
问题 Is it possible to create an iOS app which will scan for nearby mobile devices (eg. iPhone, Android, iPad etc), without needing to run any custom app on those nearby mobile devices? I have tried using CoreBluetooth like so, running on my iPhone 6+: [self.centralManager scanForPeripheralsWithServices:nil options:nil]; But the only nearby device it detects is my iMac, it will not detect my iPad Air 2, or my bluetooth earpiece. Am I doing something wrong? 回答1: Core Bluetooth works only with