【问题标题】:What is meant by serviceUUIDs when scanning bluetooth?扫描蓝牙时 serviceUUID 是什么意思?
【发布时间】:2014-02-15 08:07:54
【问题描述】:

抱歉英语不好:-(

我从 CoreBluetooth 框架开始。我为 CoreBluetooth 使用如下编写代码

[centralManager scanForPeripheralsWithServices:nil options:nil];

我查看了apple reference,我不明白那是什么serviceUUIDs

- (void)scanForPeripheralsWithServices:(NSArray *)serviceUUIDs options:(NSDictionary *)options;

请解释一下。

【问题讨论】:

    标签: ios iphone bluetooth core-bluetooth


    【解决方案1】:

    NSUUID 类创建用于唯一标识类型、接口和其他项目的 UUID 字符串。

    UUID(通用唯一标识符),也称为 GUID(全局唯一标识符)或 IID(接口标识符),是 128 位值。 NSUUID 创建的 UUID 符合 RFC 4122 第 4 版,并使用随机字节创建。

    更多apple doc

    注意:

    它适用于 iOS 6

    更新:

    UUID

    服务的蓝牙特定 UUID。 (只读)

    @property(readonly, nonatomic) CBUUID *UUID
    

    讨论

    此属性是标识服务的 128 位 UUID。

    注意:

    适用于 iOS 5.0 及更高版本。

    【讨论】:

    • 这就是UUID,但什么是Service UUID?蓝牙 UUID不是简单的随机不透明标识符。
    • @iDev 第一次启动应用时如何找到UUDID?
    • 检查我的答案@Tajrajan
    • 我在 CBCentralManager 类中找不到 UUID。如何获取蓝牙设备列表?
    • retrievePeripheralsWithIdentifiers 和 retrieveConnectedPeripheralsWithServices @Tajrajan
    猜你喜欢
    • 2015-03-03
    • 1970-01-01
    • 1970-01-01
    • 2018-03-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-26
    相关资源
    最近更新 更多