我正在嘗試從 BLE 設(shè)備讀取傳感器數(shù)據(jù),但對(duì) Unity / C# / HoloLens / UWP 來(lái)說(shuō)是全新的。我使用的 UWP 命名空間:#if NETFX_COREusing System;using Windows.Devices.Bluetooth.Advertisement;using Windows.Devices.Bluetooth;#endif這是 BluetoothLEAdvertisementWatcher.Received 的事件處理程序:#if NETFX_COREprivate async void Watcher_Received(BluetoothLEAdvertisementWatcher sender, BluetoothLEAdvertisementReceivedEventArgs args){ Debug.Log("=Received Advertisement="); ulong bluetoothAddress = args.BluetoothAddress; Debug.Log(" BT_ADDR: " + bluetoothAddress); Debug.Log(" Local name: " + args.Advertisement.LocalName); Debug.Log(" advertisement type: " + args.AdvertisementType.ToString()); // Throws 'System.IO.FileNotFoundException' in System.Private.CoreLib.ni.dll BluetoothLEDevice device = await BluetoothLEDevice.FromBluetoothAddressAsync(bluetoothAddress);}#endif我在堆棧跟蹤中看到的所有內(nèi)容都是:拋出異常:System.Private.CoreLib.ni.dll 中的“System.IO.FileNotFoundException”系統(tǒng)找不到指定的文件。(來(lái)自 HRESULT 的異常:0x80070002)我不知道如何進(jìn)一步調(diào)試這個(gè),或者一般有什么問(wèn)題。
帶有 Unity 的 Hololens 上的 BluetoothLEDevice
炎炎設(shè)計(jì)
2022-01-09 16:15:44