cbperipheral

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

CoreBluetooth: How to design code for many characteristics (30 - 40)?

泪湿孤枕 提交于 2019-12-21 04:13:23
问题 I searched around a bit and just found this as a possible duplicate question: Multiple CBPeripheral's for same device My problem is: I have multiple services which all together have about 30-40 characteristics (Yes, I need all of them...). As starting point for dealing with CoreBluetooth I always used the Apple Sample Code (CoreBluetooth Temperature Sensor). Discovery and Service/Characteristic handling is divided into two classes and this works fine for just a few characteristics. But

CoreBluetooth: How to design code for many characteristics (30 - 40)?

倾然丶 夕夏残阳落幕 提交于 2019-12-21 04:13:12
问题 I searched around a bit and just found this as a possible duplicate question: Multiple CBPeripheral's for same device My problem is: I have multiple services which all together have about 30-40 characteristics (Yes, I need all of them...). As starting point for dealing with CoreBluetooth I always used the Apple Sample Code (CoreBluetooth Temperature Sensor). Discovery and Service/Characteristic handling is divided into two classes and this works fine for just a few characteristics. But

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

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

Windows 8.0 not discovering CBPeripheral

偶尔善良 提交于 2019-12-13 07:17:34
问题 I have a sample iPhone application taken from https://github.com/KhaosT/CBPeripheralManager-Demo/tree/master/PeripheralModeTest. I am advertising my peripheral service as follows. - (void)peripheralManager:(CBPeripheralManager *)peripheral didAddService:(CBService *)service error:(NSError *)error { NSLog(@"didAddService start"); NSLog(@"Added"); NSDictionary *advertisingData = @{CBAdvertisementDataLocalNameKey : @"BTService", CBAdvertisementDataServiceUUIDsKey : @[[CBUUID UUIDWithString:@

Bluetooth Peripheral ADVERTISE_FAILED_DATA_TOO_LARGE

旧时模样 提交于 2019-12-12 07:14:32
问题 I am trying to advertise in NEXUS 9 and getting the error of ADVERTISE_FAILED_DATA_TOO_LARGE. It was working perfectly fine when I was adding the service after successfully advertising but if I add the service through Advertise Data builder so that other devices can filter while scanning, I get error code 1 i.e ADVERTISE_FAILED_DATA_TOO_LARGE a) Working Code public void startAdvertisingService() { AdvertiseSettings settings = new AdvertiseSettings.Builder() .setTxPowerLevel(AdvertiseSettings

Objective-c bluetooth says it's connected but CBCentralManager does not discover it

走远了吗. 提交于 2019-12-11 04:33:12
问题 In my app, I search for previously connected devices with the delegate method retrieveConnectedPeripheralsWithServices first, then scan for nearby devices if nothing is found. Here is the code - (void)searchForPeripherals { NSLog(@"*** scanning for Bluetooth peripherals... ***"); //Check to see if any devices were connected already if(self.ourPeripheral != nil) { [self connectToDevice]; } else { //Search for previously paired devices... bool foundPairedDevices = [self

Bluetooth 4.0 Low Energy and iOS: How do I detect if device is bondable or not?

女生的网名这么多〃 提交于 2019-12-11 03:09:47
问题 Is it possible, using corebluetooth framework, to detect if peripheral is bondable? Should I implement the failed to connect to delegate? 回答1: There is nothing at this time. With later versions of BLE, bonding information (GAP modes) is in the GAP profile, but not one bit of that information is available to you via CoreBluetooth. With the exception of some advertising data and limited scan response data, It only provides GATT information and below. You could read any desired characteristic

CoreBluetooth - Writing data from Central to Peripheral

China☆狼群 提交于 2019-12-10 12:13:25
问题 I referred Sample app provided by Apple for CoreBluetooth and I succeeded in sending Data from Peripheral to Central, Now I need to write Data from Central to Peripheral. After Googling i found that It can be done using [_discoveredPeripheral writeValue:aData forCharacteristic:charc type:CBCharacteristicWriteWithResponse]; Following is my Implementation of Central, to send Message to peripheral: -(void)sendMessage:(NSString *)strMessage{ NSData *aData = [strMessage dataUsingEncoding