core-bluetooth

CoreBluetooth on Mac Command line application

荒凉一梦 提交于 2019-12-12 18:28:33
问题 I'm trying to build a Command Line app that uses CoreBluetooth. Problem is, it doesn't work on command line apps. I've moved the my CoreBluetooth code (a class that implements the CBCentralManagerDelegate protocol - let's call this class myBLEManager ) from the Command Line app project to another Mac OS GUI App. I ran some tests in ViewDidLoad() -- supersample, I just init a myBLEManager that creates an instance of CBCentralManager on initialization, then calls scanForPeripherals . This is

iOS and CoreBluetooth Low Energy Required?

血红的双手。 提交于 2019-12-12 17:59:53
问题 We are making MFi hardware and an iOS app. We will want to have the BT device notify our app even if we are not running periodically when certain events happen. I know the CoreBluetooth API is the one to use, but can't tell for sure if that API only works with BT Low Energy devices or if it will also work with regular (MFi of course) BT 2.1 and higher devices. So my question is: Does the CoreBluetooth API only work with Bluetooth Low Energy devices or will it also work with 2.1 devices? 回答1:

iPhone: How to erase/wipe out bluetooth 4.0 data

ぃ、小莉子 提交于 2019-12-12 09:39:12
问题 I am having some major trouble with my Bluetooth Low Energy application sometimes dont manage to connect to my device (described in thread). I need to wipe out all stored data from previous connections before running my application, and as far as I know, this can only be done by rebooting the phone. Is there any other way, preferably programatically, to do this? Thank you 回答1: I am having the same issue and have found the steps to reproduce it. It is 100% reproducible when you transmit data

CoreBluetooth XPC Connection Invalid on dismiss viewcontroller

一笑奈何 提交于 2019-12-12 09:30:58
问题 After I have finished disconnecting from my bluetooth devices, seeing that they have disconnected in the didDisconnectPeripheral delegate, I attempt to dismiss my viewcontroller. When this happens I see the message: "[CoreBlueooth] XPC Connection Invalid" Is there something in specific that has to be cleaned up with Bluetooth before the viewcontroller is dismissed? 回答1: I placed CBCentralManager to a singleton and the error message is solved. ( CBCentralManager will not be deallocated) 回答2: I

Trouble converting NSData Objective-C code to Swift

亡梦爱人 提交于 2019-12-12 05:32:01
问题 I've been having issues converting an Objective-C snippet to Swift that uses NSData and CoreBluetooth . I have looked at this question and a couple others dealing with NSData in Swift but haven't had any success. Objective-C Snippet: - (CGFloat) minTemperature { CGFloat result = NAN; int16_t value = 0; // characteristic is a CBCharacteristic if (characteristic) { [[characteristic value] getBytes:&value length:sizeof (value)]; result = (CGFloat)value / 10.0f; } return result; } What I have so

Xamarian core bluetooth

喜你入骨 提交于 2019-12-12 04:29:38
问题 Through this documentation, I have managed to the get nearby bluetooth device to show in the console. But what I'm looking to do is to display Discovered devices on UIViewController(display a list on my app). using Foundation; using System; using UIKit; using CoreBluetooth; using CoreFoundation; namespace project { public partial class ScanBluetoothController : UIViewController { public ScanBluetoothController (IntPtr handle) : base (handle) { } MyCBCentralManagerDelegate myDel; public

Swift CoreBluetooth: Should CentralManager run in a separate thread?

前提是你 提交于 2019-12-12 03:56:16
问题 For now I run everything in main thread, so far I noticed only once out of many times that UI gets a bit laggy. I wonder what is the general practice of utilizint CoreBluetooth library regarding concurrency? Could you provide some examples what exactly should be run in other queue, if anything? My usage of bluetooth: I scan for two peripheral devices, control them by sending approapriate value as CBPeripheralManager in order to make them start sending data from IMU (50Hz/100Hz depending on

iOS:Communicate from different view controllers using corebluetooth library

浪尽此生 提交于 2019-12-12 03:25:14
问题 i am doing corebluetooth application. And developed the library using corebluetooth framework.i have 4 view controllers .In the first view controller i have scan button when i click scan button second screen appears with scanning devices and those devices are appeared in the tableview. when i click the table view peripheral connects and provides its info like services and charactestics.When i came back to the first view controller i had a button called battery status when i click that button

Can't seem to get core bluetooth to work

落爺英雄遲暮 提交于 2019-12-12 02:58:03
问题 I can't seem to get core bluetooth working on my iPad. ViewController.h @interface ViewController : UIViewController <CBCentralManagerDelegate, CBPeripheralDelegate> { CBCentralManager *manager; } @end ViewController.m #import "ViewController.h" @interface ViewController () @property (strong, nonatomic) IBOutlet UITextView *textField; @end @implementation ViewController @synthesize textField; - (void)viewDidLoad { [super viewDidLoad]; manager = [[CBCentralManager alloc] initWithDelegate:self

iOS Bluetooth LE cant get notification programatically but can in other apps

淺唱寂寞╮ 提交于 2019-12-11 18:37:01
问题 I'm trying to get my iOS program to communicate with a custom Bluetooth LE device. I can connect to it, read all the services, and read all the CBCharacteristic objects for each service. I am trying to get notified when one specific CBCharacteristic is updated. The CBCharacteristic.properties is set to 0x10 (Notify) but the CBCharacteristic.isNotifying is false. After calling the following line of code: myDevice.peripheral.setNotifyValue(true, forCharacteristic: myChar) I am expecting to