IOBluetooth或CoreBooth |如何将iOS与非MFi医疗蓝牙设备连接

IOBluetooth或CoreBooth |如何将iOS与非MFi医疗蓝牙设备连接,ios,swift,bluetooth-lowenergy,core-bluetooth,iobluetooth,Ios,Swift,Bluetooth Lowenergy,Core Bluetooth,Iobluetooth,我想在iPhone和提供心脏信息的医疗设备之间建立连接。我将很快获得有关蓝牙协议的信息。目前,我在使用苹果的蓝牙库时遇到了麻烦。CoreBluetooth或IOBluetooth更适合连接非MFI设备吗 下面是我发现的一些代码,它应该可以找到周围的所有设备,但它不起作用。我尝试了不同的方法来安排事情 import IOBluetooth import XCPlayground class BlueDelegate : IOBluetoothDeviceInquiryDelegate{

我想在iPhone和提供心脏信息的医疗设备之间建立连接。我将很快获得有关蓝牙协议的信息。目前,我在使用苹果的蓝牙库时遇到了麻烦。CoreBluetooth或IOBluetooth更适合连接非MFI设备吗

下面是我发现的一些代码,它应该可以找到周围的所有设备,但它不起作用。我尝试了不同的方法来安排事情

import IOBluetooth
import XCPlayground

class BlueDelegate : IOBluetoothDeviceInquiryDelegate{
    func deviceInquiryComplete(sender: IOBluetoothDeviceInquiry, error: IOReturn, aborted: Bool) {
        aborted
        println("called")
        var devices = sender.foundDevices()
        for device : AnyObject in devices {
            if let thingy = device as? IOBluetoothDevice {
                thingy.getAddress()
            }
        }
    }
}

var delegate = BlueDelegate()
var inquiry = IOBluetoothDeviceInquiry(delegate: delegate)
inquiry.start()
XCPSetExecutionShouldContinueIndefinitely()

我也尝试使用CoreBooth,但它也没有调用代理方法。

IOBluetooth和CoreBooth做不同的事情。非MFi不足以回答您的问题,除非这只是一个术语问题。您需要知道这是BTLE设备BT 4.0/蓝牙LE/蓝牙智能还是经典蓝牙。你知道答案了吗?这应该在设备的技术信息中。如果由于某种原因你找不到该信息,请查看应用程序LightBlue no affiliation,看看该应用程序是否能看到该设备。如果是这样的话,这是一个LE设备,CoreBooth将是答案。对不起,我忘了提到该设备能够使用蓝牙LE。但我认为MFi对蓝牙连接有影响。谢谢你的回答。如果你知道它是BTLE,那么CoreBlutooth是你的选择,LightBlue是一个非常棒的外部工具,可以验证你的iPhone是否可以看到医疗设备。设备制造商必须遵守传统蓝牙设备的MFi,您或mfg SDK也必须获得批准才能使用AppStore应用程序的ExternalAccessory框架。您对。。。对于传统蓝牙设备…?我正在呼叫任何不是BTLE经典蓝牙的蓝牙设备。他们有一个共同的名字,但有很大的不同。这里是许多高级比较之一。。。