来自字节的蓝牙低能量特征值

时间:2015-10-30 17:40:10

标签: bluetooth-lowenergy core-bluetooth uuid ios-bluetooth

背景:

我关注this tutorial from raywenderlich关于将蓝牙低能量防护罩连接到我的项目。我正在使用Adafruit BLE朋友。

问题:

我无法弄清楚如何为BLE朋友指定UUID。以下是关于特征的Adafruits信息图片:

Adafruit's documentation on the characteristics

这是the link to the page on Adafruits page

如何格式化特征UUID,使其符合此样式:F38A2C23-BC54-40FC-BED0-60EDDA139F47

感谢您的帮助,

乔尔

1 个答案:

答案 0 :(得分:2)

我相信可以为服务和特性创建CBUUID常量,如下所示。

let kServiceUART = CBUUID(string: "6E400001-B5A3-F393-­E0A9-­E50E24DCCA9E") // UART Service
let kCharTX      = CBUUID(string: "6E400002-B5A3-F393-­E0A9-­E50E24DCCA9E") // TX Characteristic (Property = Notify)
let kCharRX      = CBUUID(string: "6E400003-B5A3-F393-­E0A9-­E50E24DCCA9E") // RX Characteristic (Property = Write without response)

我没有BLE朋友可以通过验证。