question

GTC-6176 avatar image
0 Votes"
GTC-6176 asked SethIsaacks-4659 edited

Plugin.BLE (You should reference the NuGet package from your main application project in order to reference the platform-specific implementation)

Hi all,

I'm hardly able to find a documented BLE library that function with Xamarin so I'll have to try to debug one that sort-of-work, at least it does with Android and IOS (Xaber's BLE.Plugin) but doe not with UWP. Problem is, the following error keep coming up regardless of how and where I ref the nugget packages. Whether I install them into the main application, or the platform-specific one, or both (as per recommendation from MS I've read earlier), it just keeps on throwing the same error no matter what.

Can someone confirm this is valid error? Or am I simply wasting my time trying to make this work? ps. I did scavenged the entire internet for answers however there are no concise enough guidance (for me anyway) that helped me sorting this out. Grateful for any advice.

Exception:
An exception of type 'System.NotImplementedException' occurred in Plugin.BLE.dll but was not handled in user code
This functionality is not implemented in the portable version of this assembly. You should reference the NuGet package from your main application project in order to reference the platform-specific implementation.


Main application project simple test code

 namespace BLEtest
 {
     public partial class MainPage : ContentPage
     {
    
         IBluetoothLE ble;
         IAdapter adapter;
    
         public MainPage()
         {
             InitializeComponent();
             ble = CrossBluetoothLE.Current; <!-- <<<<< It fails here. MvvCrossxxxx package throws the same error, tried that -->
             adapter = CrossBluetoothLE.Current.Adapter;
         }
     }
 }



not-supported
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Currently, Microsoft Q&A supports the products listed over here: supported topics (more to be added later on).


Your question about third part lib is not supported currently. You could report this Plugin.BLE issue box.



0 Votes 0 ·
jcmanke avatar image
0 Votes"
jcmanke answered GTC-6176 commented

What version of the package are you using? It looks to me like UWP support is only in the 2.2.0 pre-releases (which were released in 2019 so I wouldn't count on getting a stable version).

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I see. I was giving the latest stable release a go (2.1.1) and only realized a few hours ago the UWP is not included in the samples. That would explain why.
Let me see if I can give that pre-release a shot as per your recommendation. Thanks for shedding some light on what was going on...

Much appreciated, @jcmanke

0 Votes 0 ·
SethIsaacks-4659 avatar image
0 Votes"
SethIsaacks-4659 answered SethIsaacks-4659 edited

Has anyone else done this and used the Pre 2.2? I have having an issue with _adapter.DisconnectDeviceAsync()....it never seems to return......it just seems to do nothing if I run it async. If I dont run it async it says the device connected but then if I do a discovery and try to connect, the device says its still connected. Please help....

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.