Skip to main content
Home
for DLMS smart meters
Open source solutions for DLMS smart metering

Main navigation

  • Home
  • Products
  • About us
  • Open Source
  • Community
  • Forum
  • Downloads
User account menu
  • Log in

Breadcrumb

  1. Home
  2. Forums
  3. Xamarin Forms Bluetooth Communication

Xamarin Forms Bluetooth Communication

Forum Rules

Before commenting read Forum rules

Don't comment the topic if you have a new question.

You can create a new topic selecting correct category from Gurux Forum and then create a new topic selecting "New Topic" from the top left.

By itcoder , 3 December, 2020
Forums
General discussion

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!

Profile picture for user Kurumi

Kurumi

5 years 6 months ago

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

itcoder

5 years 6 months ago

In reply to Hi, by Kurumi

Thanks Mikko, I'll give that

Thanks Mikko, I'll give that a go and see how I get on :)

IanB

4 years 3 months ago

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.

Profile picture for user Kurumi

Kurumi

4 years 3 months ago

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

IanB

4 years 3 months ago

In reply to Hi Ian, by Kurumi

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.

Profile picture for user Kurumi

Kurumi

4 years 3 months ago

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

IanB

4 years 3 months ago

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.

Profile picture for user Kurumi

Kurumi

4 years 3 months ago

Hi,

Hi,

I believe that you are using .Net Standard 2.1 or 2.1 and not .NET MAUI?

BR,

Mikko

IanB

4 years 3 months ago

HI MIkko,

HI MIkko,

Yes, .NET Standard (2.1). Sorry, I should have mentioned that.

Ian.

Profile picture for user Kurumi

Kurumi

4 years 3 months ago

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

IanB

4 years 3 months ago

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.

Profile picture for user Kurumi

Kurumi

4 years 3 months ago

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

IanB

4 years 3 months ago

Ok, that's what I thought.

Ok, that's what I thought.
Thanks for your help anyway, Mikko!

Ian.

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Tue, 06/09/2026 - 11:16
    gurux.dlms.java 4.0.95
  • Tue, 06/09/2026 - 10:03
    Gurux.DLMS.Python 1.0.199
  • Mon, 06/08/2026 - 13:39
    gurux.dlms.cpp 9.0.2606.0801
  • Mon, 06/01/2026 - 10:15
    gurux.dlms.cpp 9.0.2606.0101
  • Thu, 05/28/2026 - 16:06
    gurux.dlms.java 4.0.94

New forum topics

  • Error reading L&G Meter
  • Pass a TCP Client to GXNet
  • Australian EDMI Mk10D (Essential Energy area)
  • Strange mix of data notificiation vs get response
  • DLMS Connection
More

Who's new

  • Tuanhgg
  • Adel
  • charnon
  • Paddles
  • Miguel Ángel
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin