I am using a Xamarin Forms application (Android/iOS) and I've managed to successfully connect to a Bluetooth probe on the Android application using SPP connections. I can now transmit Hex data within a byte array and the meter is returning the correct/expected response. How do you recommend using the Gurux libraries to communicate with this meter? I assume I will need to use some form of either the Serial or the C#/.NET libraries but I am unsure how to specify the address of the device, assuming I need to use the Bluetooth device address. I remember in one form you say I may need to create my own type of 'media', are you able to provide any more information about how I could establish this connection? Thanks!
The easiest way to go is if your select GXSerial as a template and modify it for your needs. We are planning to add support for Bluetooth, but it's happening in the next year. You can read instructions on how to create your own media from here: http://www.gurux.fi/GXDLMSDirector.Media
I was about to look at creating my own media class (implementing IGXMedia) to allow support for Bluetooth. However you've said above that you are/were planning to do this 'in the next year' (i.e. 2021). So I just wondered if this is or will be in development, before I started trying to do it myself?
It's implemented but has not been released as open-source yet because it's working only in Windows. So .Net Core is not supported. I need to think if this can be released without .Net Core support.
Like the OP, I am looking to use Bluetooth (BLE) on Android. I am not using .NET Core for that project, but if is currently Windows-only this will not work for me. Do you plan to add support for BLE on Android (just for .NET Framework initially)?
You can run .NET Core in Android. That was the reason I mentioned it. Are you using Android Studio and Java? That is quite easy to implement. I need to ask if our customers are interested in it. If they are we can implement it quite fast.
Mikko,
Thanks for your further reply. I am using Xamarin Forms in Visual Studio, i.e. C# rather than Java. So I would need support for BLE which would work in this environment.
Thanks,
Ian.
There is no support for Bluetooth in NET Standard, but it's possible to implement. The hardest part is implementing the Generic ATTribute Profile (GATT). I have asked our clients if they are interested in Bluetooth for mobile devices, but haven't received any reply yet.
In Android Studio there is native support for Bluetooth. It's sad that it's not in NET Standard.
I am actually using a 3rd-party Bluetooth API (Plugin.BLE) to handle the GATT and everything else related to BLE. So I think I just need to create a new BLE medium which implements IGXMedia (or maybe IGXMedia2). As far as I understand it, I just need to get my new medium's Send method to pass data to the BLE API and for the API to pass received data to the new medium so the Receive method can access it. I also need to implement Open and Close methods. I think that is all I need to do, would you agree?
In that case, it's the fastest if you just implement IGXMedia. Those are the steps that you need to do.
You also need to implement the search for the Bluetooth devices, but that should be all.
Hi,
Hi,
The easiest way to go is if your select GXSerial as a template and modify it for your needs. We are planning to add support for Bluetooth, but it's happening in the next year. You can read instructions on how to create your own media from here:
http://www.gurux.fi/GXDLMSDirector.Media
BR,
Mikko
Thanks Mikko, I'll give that
Thanks Mikko, I'll give that a go and see how I get on :)
Hi Mikko,
Hi Mikko,
I was about to look at creating my own media class (implementing IGXMedia) to allow support for Bluetooth. However you've said above that you are/were planning to do this 'in the next year' (i.e. 2021). So I just wondered if this is or will be in development, before I started trying to do it myself?
Many thanks,
Ian Brown.
Hi Ian,
Hi Ian,
It's implemented but has not been released as open-source yet because it's working only in Windows. So .Net Core is not supported. I need to think if this can be released without .Net Core support.
BR,
Mikko
Hi Mikko, thanks for your
Hi Mikko, thanks for your reply.
Like the OP, I am looking to use Bluetooth (BLE) on Android. I am not using .NET Core for that project, but if is currently Windows-only this will not work for me. Do you plan to add support for BLE on Android (just for .NET Framework initially)?
Thanks,
Ian.
Hi Ian,
Hi Ian,
You can run .NET Core in Android. That was the reason I mentioned it. Are you using Android Studio and Java? That is quite easy to implement. I need to ask if our customers are interested in it. If they are we can implement it quite fast.
BR,
Mikko
Mikko,
Mikko,
Thanks for your further reply. I am using Xamarin Forms in Visual Studio, i.e. C# rather than Java. So I would need support for BLE which would work in this environment.
Thanks,
Ian.
Hi,
Hi,
I believe that you are using .Net Standard 2.1 or 2.1 and not .NET MAUI?
BR,
Mikko
HI MIkko,
HI MIkko,
Yes, .NET Standard (2.1). Sorry, I should have mentioned that.
Ian.
Hi,
Hi,
There is no support for Bluetooth in NET Standard, but it's possible to implement. The hardest part is implementing the Generic ATTribute Profile (GATT). I have asked our clients if they are interested in Bluetooth for mobile devices, but haven't received any reply yet.
In Android Studio there is native support for Bluetooth. It's sad that it's not in NET Standard.
BR,
Mikko
Hi and thanks again for your
Hi and thanks again for your reply.
I am actually using a 3rd-party Bluetooth API (Plugin.BLE) to handle the GATT and everything else related to BLE. So I think I just need to create a new BLE medium which implements IGXMedia (or maybe IGXMedia2). As far as I understand it, I just need to get my new medium's Send method to pass data to the BLE API and for the API to pass received data to the new medium so the Receive method can access it. I also need to implement Open and Close methods. I think that is all I need to do, would you agree?
Thanks,
Ian.
Hi.
Hi.
In that case, it's the fastest if you just implement IGXMedia. Those are the steps that you need to do.
You also need to implement the search for the Bluetooth devices, but that should be all.
BR,
Mikko
Ok, that's what I thought.
Ok, that's what I thought.
Thanks for your help anyway, Mikko!
Ian.