core-bluetooth

Advantages of only advertising data vs connecting BLE devices

☆樱花仙子☆ 提交于 2019-12-11 07:43:12
问题 Let Say I have a peripheral that is advertising data that is encoded into its UUID . The central scanning sees this UUID and and knows to turn the hexadecimal UUID to decimal and from there take out certain numbers by groups such as the first 4, then the next 6, then the next 4. It has certain functions to put these numbers into. Is there any advantages of this instead of connecting to the central device and then just trading information. Would it be faster? What about when you take into

Core Bluetooth LE and Classical in iOS

六月ゝ 毕业季﹏ 提交于 2019-12-11 05:58:32
问题 I'm research about Core Bluetooth. And I have any questions, could you please help me explain more about this: What's difference between Core Bluetooth LE and Classical ? I can implement Core bluetooth LE to connect other iOS devices ? Is UUID used to? How can get UUID of devices? Now, i need to implement application allow connect to count step device and get data from it. How can i do that? That device using Bluetooth LE. If can, you can show me tutorial or example code? Thanks so much. 回答1:

Can you access a bluetooth device via the ExternalAccessory framework after pairing with CoreBluetooth?

别说谁变了你拦得住时间么 提交于 2019-12-11 05:35:14
问题 I have a Bluetooth device enrolled in the MFi program. I am able to pair the device via Bluetooth in the iPhone settings, and then use Apple's EADemo example code to access the device via the ExternalAccessory framework. However, I'm wondering if it's possible to first silently pair in the background via CoreBluetooth , and then use the ExternalAcessory framework to communicate with the device? I've run some experiements and after pairing with CoreBluetooth , the ExternalAcessory framework

iOS core bluetooth CBCentralManager scanForPeripheralsWithServices no results

≡放荡痞女 提交于 2019-12-11 05:34:28
问题 I want to scan all the bluetooth devices in a ViewController, on a iOS 7 application, like this : In ViewController.h #import <UIKit/UIKit.h> #import <CoreBluetooth/CoreBluetooth.h> @interface ViewController : UIViewController <CBCentralManagerDelegate> @property (strong, nonatomic) CBCentralManager *centralManager; @end In ViewController.m #import "ViewController.h" @interface ViewController () @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; self.centralManager

BLE: image transfer between 2 ios devices using CoreBluetooth

可紊 提交于 2019-12-11 04:57:52
问题 So i have 2 iOS devices : one is Peripheral and the other Central. I want that the data would be image. I have tried with a string value and it is working fine but with image i get this error:"read_user_chunkIDOT:1221: invalid PNG file: no valid iEnd chunk", also i can see that the bytes are different( Optional(526 bytes)), they are more larger when i get them. This is the peripheral: if let img = UIImage(named: "maiden") { let data = UIImagePNGRepresentation(img) let base64 = data?

CoreBluetooth connection setup time varies quite a bit

泄露秘密 提交于 2019-12-11 04:21:26
问题 The time taken to connect my app to a Bluetooth 4.0 device seems to vary quite a bit. Same app, same device. Sometimes it connects immediately - like less than a second. Sometimes it takes about 10-12 seconds. And once in while it doesn't connect at all - I need to restart the scan, etc. I was wondering if anyone else has seen this issue. What could be causing this? 回答1: There can be a number of reasons for this. Here are a few off of the top of my head. The device is not advertising very

ios- cbcentralManager state unknown and CoreBluetooth[WARNING] <CBConcreteCentralManager> is not powered on

穿精又带淫゛_ 提交于 2019-12-11 04:21:16
问题 I am working on CoreBluetooth framework. I ran the famous temperatureSensor application but when i run it on simulator I get the following warning: CoreBluetooth[WARNING] <CBConcreteCentralManager: 0x713b550> is not powered on and I checked the state of CBCentralManager it is Unknown . Following is the code: (void) startScanningForUUIDString:(NSString *)uuidString { centralManager = [[CBCentralManager alloc] initWithDelegate:self queue:nil]; if ([centralManager state] ==

didDiscoverPeripheral “fail to build” error

这一生的挚爱 提交于 2019-12-11 03:58:58
问题 I'm not sure why this code is failing to build and the error message seems quite cryptic. Code: var centralManager: CBCentralManager!; var nrf8001Peripheral: CBPeripheral!; override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. // initialize centralManager self.centralManager = CBCentralManager(delegate: self, queue: nil); // start scanning for device self.centralManager.scanForPeripheralsWithServices([UART_SERVICE_UUID],

iOS13 - Detect if bluetooth is enabled without prompting bluetooth usage request

谁说我不能喝 提交于 2019-12-11 03:18:13
问题 In previous iOS versions you could detect if the user had bluetooth enabled or not without actually prompting the user's permission to access bluetooth. In iOS13, CBCentralManager now prompts bluetooth permission just to check if they have bluetooth turned on or not, regardless of if the app is actually going to use bluetooth directly. Our app uses Apple's multipeer connectivity framework to communicate between devices (peer to peer) which uses a combination of wifi and bluetooth, or just

Not working call to centralManager: didDiscoverPeripheral: advertisementData: RSSI: function

对着背影说爱祢 提交于 2019-12-11 03:14:25
问题 After app open, and Press ON BLE Device. centralManagerDidUpdateState function is working. CBUUID *uuid = [CBUUID UUIDWithString:@"8A1FEA41-3A2F-7860-568D-2325D6C31C91"]; NSArray *services = [NSArray arrayWithObjects:uuid, nil]; NSDictionary *options = [NSDictionary dictionaryWithObject:[NSNumber numberWithBool:NO] forKey:CBCentralManagerScanOptionAllowDuplicatesKey]; [central scanForPeripheralsWithServices:services options:options]; Would not call to didDiscoverPeripheral: function. -(void