我正在用Xamarin和MvvmCross構建一個iOS應用程序,並要求使用藍牙LE。我想使用這個插件:ACR無效BluetoothLE插件啓動服務器時無效狀態
https://github.com/aritchie/bluetoothle
這裏是我的代碼:
var server = CrossBleAdapter.Current.CreateGattServer();
await server.Start(new AdvertisementData()); // throws exception
它拋出試圖啓動服務器時異常:
{System.ArgumentException :無效狀態 - 未知於 Plugin.BluetoothLE.Server.GattServer.Start (Plugin.BluetoothLE.Server.AdvertisementData adData)[0x0005f] in < 4281c4bd57f24525b20baae1afdf610b>:0
顯然,這個插件是好用,所以我必須失去了一些東西明顯?
我想我是在錯誤的時間或線程訪問它,阻止重要的初始化,需要先完成。 – Darius