Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/110.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用iOS CoreBluetooth从DEX无线适配器检索DEX?_Ios_Swift_Bluetooth Lowenergy_Core Bluetooth_Gatt - Fatal编程技术网

如何使用iOS CoreBluetooth从DEX无线适配器检索DEX?

如何使用iOS CoreBluetooth从DEX无线适配器检索DEX?,ios,swift,bluetooth-lowenergy,core-bluetooth,gatt,Ios,Swift,Bluetooth Lowenergy,Core Bluetooth,Gatt,我目前有一个霍尼韦尔的DEX BLE-1适配器,用于从自动售货机检索DEX数据。我有一个swift 3 iOS应用程序,它使用CoreBooth进行扫描并与外围设备配对。适配器有三种服务:串行端口、电池和dex服务。dex服务有三个特征:固件版本、会话和设置。我假设会话特征用于检索dex;然而,我不知道如何做到这一点 我使用didUpdateValueFor peripheral方法获取与会话特征的uuid相关的值,但该值为零 func peripheral(_ peripheral: CBPe

我目前有一个霍尼韦尔的DEX BLE-1适配器,用于从自动售货机检索DEX数据。我有一个swift 3 iOS应用程序,它使用CoreBooth进行扫描并与外围设备配对。适配器有三种服务:串行端口、电池和dex服务。dex服务有三个特征:固件版本、会话和设置。我假设会话特征用于检索dex;然而,我不知道如何做到这一点

我使用didUpdateValueFor peripheral方法获取与会话特征的uuid相关的值,但该值为零

func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) {

        if characterstic.uuid.uuidString == uuidSession {
            if(characteristic.value != nil) {
                print(characterstic.value)
            }
        }
}

是否应该从会话特征值中检索索引?似乎只有几个字节,也许我必须连接这些字节?但无论如何,这个值是零。我是新手,但这应该通过串行端口完成吗?我在某个地方读到你可以通过它建立联系,或者这是完全关闭的

与自动售货机的DEX通信是串行端口连接


新的Blu-DEX是BLE 4.0,可与Android和Apple一起使用。

与自动售货机的DEX通信是串行端口连接


新的Blu-DEX是BLE 4.0,可与Android和Apple一起使用。

你只是在寻找个性还是价值

func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) {

    let readValue = characteristic.value
    if let str = String(data: readValue!, encoding: String.Encoding.utf8) {
        print("Line \(index): \(str)")
        index += 1
    } else {
        print("Received an invalid string!")
    }

}

你只是在寻找个性还是价值

func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) {

    let readValue = characteristic.value
    if let str = String(data: readValue!, encoding: String.Encoding.utf8) {
        print("Line \(index): \(str)")
        index += 1
    } else {
        print("Received an invalid string!")
    }

}

那么,DEX BLE-1适配器不支持串行端口连接?我确实看到了服务和特性数据和状态。我需要另一个吗?问题是我在iOS应用程序中使用核心蓝牙获得串行端口服务。我得到了服务的“数据”特征,它是空的。如何通过此服务检索dex?DEX可以存储在特征中吗?因此,DEX BLE-1适配器不支持串行端口连接?我确实看到了服务和特性数据和状态。我需要另一个吗?问题是我在iOS应用程序中使用核心蓝牙获得串行端口服务。我得到了服务的“数据”特征,它是空的。如何通过此服务检索dex?DEX可以存储在特征中吗?您是否回答了上述问题?我们是否需要使用SDK?您是否回答了上述问题?我们需要使用SDK吗?