Tag: 蓝牙

在IOS 9.1 / Xcode 7.1.1中断了蓝牙

在10.11.1下使用Xcode 7.1.1运行IOS 9.1。 Cut'n'Pasted这个代码从这个教程; 并再次检查与其他几个来源/网站。 http://hatemfaheem.blogspot.ch/2014/12/how-would-you-scan-for-nearby-ble.html 这是我的代码… import Foundation import CoreBluetooth class BLEManager { var centralManager : CBCentralManager! var bleHandler : BLEHandler // delegate init() { self.bleHandler = BLEHandler() self.centralManager = CBCentralManager(delegate: self.bleHandler, queue: nil) } } class BLEHandler : NSObject, CBCentralManagerDelegate { override init() { super.init() } func centralManagerDidUpdateState(central: CBCentralManager) { switch (central.state) { […]

蓝牙Multipeer连接?

我开始做广告,开始浏览。 当在同一个WiFi,它的工作 。 但是,当我closuresWiFi, 只留下蓝牙 ,甚至-(void)browser:(MCNearbyServiceBrowser*) browser foundPeer:(MCPeerID*) peerID withDiscoveryInfo:(NSDictionary*) info被调用。 我是否必须表明以某种方式明确地在蓝牙上做广告 ? 还是应该这样无缝地工作? 与GameKit有一个这样的设置。 我在MC找不到任何类似的东西。

locationManager:didRangeBeacons方法未检测到BLE设备

我正在使用Nordic BLE nRF8001开发套件来testingCoreBluetooth。 使用CBCentralManager的方法(例如didDiscoverPeripheral(),didConnectPeripheral()等), 我的iPhone 5能够检测到北欧设备的广告,并连接到它就好了 。 但是,我没有收到来自新的locationManager范围或regionMonitoring方法的任何响应。 下面我会解释我的设置: 1.)首先,我使用传入的外围设备(我的北欧设备),在didDiscoverPeripheral()委托方法中从我的Nordic设备中检索到我的NSUUID。 我为我的北欧设备创build了一个自定义服务,所以假设这个外设是北欧设备。 检索我使用的NSUUID: NSUUID *uuid = [peripheral identifier]; NSString *uuidString = [uuid UUIDString]; //uuidString = 9A8D4C73-152D-BBDA-E4C2-9CE952654645 )接下来,我为北欧设备创build一个信标区域,并创build一个CLLocationManager: self.locationManagerBeacon = [[CLLocationManager alloc] init]; [self.locationManagerBeacon setDelegate:self]; NSUUID *myUUID = [[NSUUID alloc] initWithUUIDString:@"9A8D4C73-152D-BBDA-E4C2-9CE952654645"]; self.beaconRegion = [[CLBeaconRegion alloc] initWithProximityUUID:myUUID identifier:@"nordicRegion"]; self.beaconRegion.notifyEntryStateOnDisplay = YES; 3.)现在我开始监测信标区域 [self.locationManagerBeacon startRangingBeaconsInRegion:self.beaconRegion]; 4.) 问题 :locationManager:didRangeBeacons:inRegion被调用,但信标区域总是空的。 问题:Nordic […]

找不到IBeacon

有困难连接到IBeacon,我已经下载了定位应用程序,但它无法find我的IBeacon。 我也手动configurationibeacon但没有成功。 另一种方法是我已经下载了eBeacon应用程序,而我的IBeacon只能在中央外设中看到,而不在信标列表中。 我认为问题出在设备上。 这里是我的灯塔 。 任何想法将不胜感激。 谢谢! PS我在这里问了关于IBeacon连接问题的问题。

(iOS)如何检查iPhone的配对蓝牙设备?

我想使用CoreBluetooth(因为我的应用必须符合App Store的条件)来检查所有当前配对和连接的蓝牙设备。 这不应该需要任何蓝牙扫描,对不对? 我只想看看系统配对了什么。 如果我不能这样做,扫描是第二个select。 我正在尝试不工作。 它说,蓝牙没有开机和崩溃,但CBCentralManager的状态是开启的! 任何想法如何解决这个问题,还是我完全脱轨? 所有这些在ViewController中现在: – (void)viewDidLoad{ [super viewDidLoad]; self.centralManager = [[CBCentralManager alloc] initWithDelegate:self queue:dispatch_get_main_queue()]; [self.centralManager retrieveConnectedPeripherals]; //makes the system call didRetrieveConnectedPeripherals } – (void)centralManager:(CBCentralManager *)central didRetrieveConnectedPeripherals:(NSArray *)peripherals{ NSLog(@"didRetrieveConnectedPeripherals called"); for (CBPeripheral *a in peripherals){ NSLog(a.name); //just log the name for now to see if it recognized it } //but it […]

通过Multipeer连接发送和接收邀请

我知道这个问题之前已经被问过了,但是我只是想知道为什么这个问题不适合我的情况。 我试图从一个视图控制器发送multipeer连接的邀请,并在另一个视图控制器上接收。 我的代码发送它是: [self invitePeer:selectedPeerID toSession:self.mySession withContext:nil timeout:timeInterval ]; 和方法只是空白: – (void)invitePeer:(MCPeerID *)peerID toSession:(MCSession *)session withContext:(NSData *)context timeout:(NSTimeInterval)timeout { } 我的代码接收和邀请是: – (void)advertiser:(MCNearbyServiceAdvertiser *)advertiser didReceiveInvitationFromPeer:(MCPeerID *)peerID withContext:(NSData *)context invitationHandler:(void(^)(BOOL accept, MCSession *session))invitationHandler { // http://down.vcnc.co.kr/WWDC_2013/Video/708.pdf — wwdc tutorial, this part is towards the end (p119) self.arrayInvitationHandler = [NSArray arrayWithObject:[invitationHandler copy]]; // ask the user UIAlertView […]

iPad的蓝牙键盘返回任何键onKeyUp的0代码

有些客户在使用iPad蓝牙键盘将文本input到我们的某个内部网站时,一直在报告问题。 当使用桌面或屏幕键盘上的iPad时,主要按某个input上的input可以正常工作,而使用连接到iPad的蓝牙键盘时则不会。 经过调查发现,当连接到iPad上的蓝牙键盘时, onKeyUp任何input都返回0作为键码。 演示工作正常,但是当使用屏幕键盘时,因为keycode返回0,所以不工作。 我创build了这个jsFiddle来演示。 它在Chrome和Safari上都经过了testing,其结果与onKeyPress相同,但在onKeyUp只返回0。 $('#inputKeyUp').keyup(function (event){ $("#outputKeyUp").text("Key Up Key: " + event.which); }); $('#inputKeyPress').keypress(function (event){ $("#outputKeyPress").text("Key Press Key: " + event.which); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <textarea id="inputKeyUp">keyup</textarea> <div id="outputKeyUp">Key Up Key:</div> <b/> <textarea id="inputKeyPress">keypress</textarea> <div id="outputKeyPress">Key Press Key:</div> 编辑:刚刚向苹果报告的错误。 我们会看看有没有什么结果。

现有的蓝牙设备和苹果MFI

我正在开发一个需要连接到蓝牙设备的应用程序。 我不想在app store部署这个应用程序。 我只需要这个用于个人使用。 有没有办法连接到这个蓝牙设备(这是老的地狱,绝对不是MFIauthentication)。 在MFI程序( http://mfi.apple.com/faqs )的常见问题解答中,它说第三方解决scheme是可能的。 有没有人知道这件事? 我还没有find任何产品在iPhone和蓝牙设备之间build立桥梁。 此外,常见问题解答说: “仅依靠标准技术(例如,蓝牙低功耗或标准蓝牙configuration文件)的应用程序开发人员和配件开发人员无需joinMFi计划。” 我的蓝牙设备使用标准的蓝牙configuration文件,但我无法连接到它。

蓝牙键盘连接时显示虚拟键盘?

我正在为使用蓝牙RFID阅读器的公司build立系统。 问题是,除非我们closures阅读器,否则我们无法在阅读器连接时显示键盘。 但是我看到这个videohttp://www.youtube.com/watch?v=0uRlIw5H0wE&feature=related 而且我知道我们可以修改阅读器来温和地显示键盘。 (就像苹果iOS键盘上的button) 我们可以要求提供者给读者做报告。 所以我们想添加一个物理button。 有谁知道该button的键码? 可以做只是添加一个button来发送键码事件?

使用BluetoothManager私有框架获取蓝牙的MAC地址

我试图在IOS 5.0.1 iPhone 4S中使用蓝牙实现设备发现。 我正在使用私人框架BluetoothManager。 我的代码是: – (IBAction)searchForDevices:(id)sender { [self.indicator setHidden:NO]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(bluetoothAvailabilityChanged:) name:@"BluetoothAvailabilityChangedNotification" object:nil]; btCont = [BluetoothManager sharedInstance]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(deviceDiscovered:) name:@"BluetoothDeviceDiscoveredNotification" object:nil]; } – (void)bluetoothAvailabilityChanged:(NSNotification *)notification { self.label.text = @"Availability changed!"; [btCont setDeviceScanningEnabled:YES]; } – (void)deviceDiscovered:(BluetoothDevice *)device { [self.indicator setHidden:YES]; self.label.text = device.address; 我的蓝牙耳机被发现。 deviceDiscoveredcallback函数被调用,但device.address不包含蓝牙设备的MAC地址。 该应用程序崩溃。 此外,device.name返回通知的名称(BluetoothDeviceDiscoveredNotification),而不是发现的设备的名称。 任何build议如何检索我的蓝牙耳机的MAC地址这种方式? 谢谢!