iOS Eddystone Beacon问题 - 无法找到namespaceid

时间:2017-11-29 16:01:57

标签: ios ibeacon uuid eddystone

我正在尝试构建一个Eddystone信标扫描仪。我已经安装了Eddystone框架,这很好用。但我不知道我的灯塔有哪个命名空间。

我安装了名为" eBeacon"的应用程序从商店那里我成功扫描了我的灯塔。他们给了我一个id:051674047A2B7D9D0A6F96BAEE9DBC3B

    // filter by namespace
    let namespaceUID = ESTEddystoneUID(namespaceID: "051674047A2B7D9D0A6F")
    let namespaceFilter = ESTEddystoneFilterUID(namespaceID: "051674047A2B7D9D0A6F")
    self.eddystoneManager.startEddystoneDiscovery(with: namespaceFilter)

    // filter by namespace and instance
    let namespaceInstanceUID = ESTEddystoneUID(namespaceID: "051674047A2B7D9D0A6F",
                                               instanceID: "96BAEE9DBC3B")
    let namespaceInstanceFilter = ESTEddystoneFilterUID(namespaceID: "051674047A2B7D9D0A6F96BAEE9DBC3B")
    self.eddystoneManager.startEddystoneDiscovery(with: namespaceInstanceFilter)

    // filter by URL
    let urlFilter = ESTEddystoneFilterURL(url: "http://www.wellcoressd.com")
    self.eddystoneManager.startEddystoneDiscovery(with: urlFilter)

    // filter by domain name
    let domainNameFilter = ESTEddystoneFilterURLDomain(urlDomain: "my.restaurant.com")
    self.eddystoneManager.startEddystoneDiscovery(with: domainNameFilter)

    func eddystoneManager(manager: ESTEddystoneManager, didDiscover eddystones: [ESTEddystone], with eddystoneFilter: ESTEddystoneFilter?) {
        print("yes")
        // ...
    }

1 个答案:

答案 0 :(得分:0)

Eddystone-UID名称空间标识应为10个字节,实例标识为6个字节。

您在问题中显示的值051674047A2B7D9D0A6F96BAEE9DBC3B是16个字节,因此我怀疑这是两个标识符的组合。如果这是正确的:

namespace id: 051674047A2B7D9D0A6F
instance id: 96BAEE9DBC3B

您可以尝试使用我的免费定位应用程序,该应用程序将扫描Eddystone UID信标并分别显示命名空间和实例标识符。

https://itunes.apple.com/us/app/locate-beacon/id738709014?mt=8