2017-09-25 110 views
0

美好的一天。對不起,我的英語不好。是否提示有機會定義不在UUID上的雙向通信區域,並且是雙向通信的一部分。例如,我們有2個區域:IBeacon。定製過濾區域

1 - UUID = 57547265-7261-772e-636f-6c0054000000

2-只有完整部分(最有可能的,這是第四最後一組) - 6c001137e000

我可以在我的方法中只爲最後一組UUID指定一個過濾器嗎?

例如:

List<string> listUuids =new List<string>() 
      { "57547265-7261-772e-636f-6c0054000000" , "6c001137e000" }; 

    for (int i = 0; i <listUuids.Count; i ++) 
     { 
     var uuid = Identifier.Parse (listUuids [i]); 
     var region = new Region ("R" + i, uuid, null, null); 
     beaconManager.StartRangingBeaconsInRegion (region); 
     } 

我真的很感激任何答案! 最好的問候!

回答

0

您可以使用自定義的信標解析器來做到這一點。像這樣:

BeaconManager.GetBeaconParsers().clear(); BeaconMannager.GetBeaconParsers().add(new Beacon parser().setBeaconLayout("m:2-3=0215,i:14-19,i:4-13,i:20-21,i:22-23,p:24-24"); var region = new Region("partial UUID region", Identifier.parse("0x6c001137e000"), null, null)

上述定製解析器定義標識符一個iBeacon顯示包。第一個標識符是UUID的最後6個字節。第二個標識符是UUID的前10個字節。第三和第四個標識符分別是主要和次要。

使用上面定義的區域將匹配與UUID指定的最後6個字節匹配的任何信標。

+0

謝謝!我會嘗試 – OlegS