英文:
GattServer conflcits with Microsoft Advertising Beacon on Hololens 2
问题
我在HL2上遇到了奇怪的问题。
我正在开发BLE Unity应用程序,因此我创建了一个GATT服务器,公开了一个GATT服务和一些特征。没有什么花哨的东西。
一切都运行得很好。我可以将HL2连接为中央,并写入特征。但后来它停止工作了。
通过nrfScanner进行了一些调查,结果发现HL2会同时广播我的GATT服务和“Microsoft广告信标”,但不会同时出现。总是这个或那个。
现在只有在1-2秒的短暂时间内才有可能写入特征。
我不知道这个信标是否是罪魁祸首,或者它是否一直存在,但问题似乎突然出现,我在过去的3个月开发中没有遇到这个问题 :/。
请参阅视频
Microsoft广告信标与UWP示例应用程序中的BluetoothLEAdvertisementPublishers争夺战,如nrcConnect中所示
- 我的第一个想法是我在我的代码中做了一些更改,所以我恢复到我知道可以工作的代码。没有运气。
- 除非我启动GattServer,否则信标不会显示出来。
- 然后我回滚到较旧版本的Hololens2(最近有一个更新)。没有运气。
- 即使在运行此示例时也会发生此问题:https://github.com/microsoft/Windows-universal-samples/tree/win10-2004/Samples/BluetoothAdvertisement(它不使用GattService提供程序,而是BluetoothLEAdvertisementPublisher),因此看起来与Unity无关。
所以我基本上已经没有了想法。
英文:
i'm experiencing weird issue with HL2.
I'm working on BLE unity app and as such i've created gattserver that exposes a gatt service and some characteristics. Nothing fancy.
It was working just fine. I could connect to HL2 as central and write to characteristics. But then it stopped working.
Did some digging with nrfScanner and it turned out that HL2 advertises both my gatt services and "microsoft advertising beacon". never both at the same time. it's always this or that.
Right now writing to characteristic is possible only if i hit short window opportunity of 1-2 seconds.
I have no idea if this Beacon is the culprit or if it's been there all the time but the issue seems to appear out of nowehere and I haven't experianced it in the last 3 months of development :/.
See video
- My first thought was i've changed something in my code so i reverted to the code i knew was working. No luck.
- Beacon does not show up unless i start GattServer.
- Then i've rolled back to older windows on hololens2 (there was an update recentyl). No luck.
- It also happens when running this sample: https://github.com/microsoft/Windows-universal-samples/tree/win10-2004/Samples/BluetoothAdvertisement (which doesn't use gattservice provider but BluetoothLEAdvertisementPublisher) so looks like it's not unity related.
So i've basically ran out of ideas here.
答案1
得分: 3
我们测试了https://github.com/microsoft/Windows-universal-samples/tree/win10-2004/Samples/BluetoothAdvertisement和https://github.com/microsoft/Windows-universal-samples/tree/win10-2004/Samples/BluetoothLE示例,并可以确认您在nrfScanner中注意到的行为(信标在不同的广告之间交替)是有意设计的。此外,读取或写入Gatt服务器特征没有任何问题。
英文:
We tested both https://github.com/microsoft/Windows-universal-samples/tree/win10-2004/Samples/BluetoothAdvertisement and https://github.com/microsoft/Windows-universal-samples/tree/win10-2004/Samples/BluetoothLE samples and can confirm that the behavior you noticed in nrfScanner (beacons alternating between different advertisements) is by design. Additionally, there were no issues with reading or writing to the Gatt Server characteristics.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论