Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Bluetooth/BLE API #242

Open
craylward opened this issue May 10, 2018 · 15 comments

Comments

@craylward
Copy link

commented May 10, 2018

//Maintainer Comments Below (James Montemagno)

API to be specified. We would like to use this thread to understand what features from Bluetooth developers would like to use.

VS bug #735670

@craylward craylward changed the title BLE Capable API Add BLE Capable API May 10, 2018

@mattleibow

This comment has been minimized.

Copy link
Contributor

commented May 11, 2018

This is something we should try and do, as it is a very popular plugin.
But... Wasn't there already a very good library that we support: https://github.com/xamarin/Monkey.BluetoothLE

This may be better served there.

@craylward craylward changed the title Add BLE Capable API Add BLE API May 11, 2018

@craylward

This comment has been minimized.

Copy link
Author

commented May 11, 2018

This issue is addressed in #77 . Changed issue title to generic BLE API to extend beyond capabilities. Can be closed if it is determined that BLE belongs in a separate plugin.

@erdmenchen

This comment has been minimized.

Copy link

commented Jun 20, 2018

I tried various cross plattform wrappers for BLE in Xamarin Forms.
All have their issues and they never work out of the box. You always have to "hack" workarounds.
Maintenance is poor or not available at all since there is no large adoption if the issues are related to core BLE functionality.

So it would be a very big improvement for such a core feature on mobile devices if Xamarin.Essentials could provide an easy to use and out of the box working wrapper for BLE.

So my proposal: Include permission / feature check but also the whole BLE stack...

@basdecort

This comment has been minimized.

Copy link

commented Jul 4, 2018

With the rising popularity of IoT this would be a great addition. Unfortunately it's pretty challenging to implement this in a cross-platform manner, especially on Android. We are using this plugin:
https://github.com/xabre/xamarin-bluetooth-le

As mentioned on the GitHub page, they are looking for maintainers.

@nicolgit

This comment has been minimized.

Copy link
Contributor

commented Jul 5, 2018

I am using this https://github.com/aritchie/bluetoothle , quite stable and maintained (at least on android implementation the one I am using)

@jamesmontemagno

This comment has been minimized.

Copy link
Collaborator

commented Jul 10, 2018

@erdmenchen @basdecort @nicolgit can you please add comments on to what features you would like to see this API have and what features you actually need.

@jamesmontemagno jamesmontemagno changed the title Add BLE API Add Bluetooth/BLE API Jul 10, 2018

@nicolgit

This comment has been minimized.

Copy link
Contributor

commented Jul 11, 2018

  • Scan for other Bluetooth devices
  • Query the local Bluetooth adapter for paired Bluetooth devices

BLE devices interaction

  • Find BLE devices
  • Connect to a GATT server
  • Read BLE attributes
  • Receive GATT notifications
@basdecort

This comment has been minimized.

Copy link

commented Jul 11, 2018

The features we would need for our current use are:

  • Indication whether the device can communicate using BLE.
  • Indication whether bluetooth is turned on (and an event when state changes).
  • Scan for Bluetooth devices: Can be used to find the bluetooth devices (with their UUID) that are in range.
  • Connect to a BLE device: In order communicate with the device, a connection has to be made. Connection can be made with the UUID that was detected during the scan.
  • ConnectionLost event: an event when a connection was interrupted.
  • Disconnect from a BLE device: Explicitly disconnect from the device.
  • Get Services of the device: Possibility to list the services a device has to offer, for example: Battery service.
  • Get characteristics (read, write & notify) of the device: A service (as mentioned previously) consists out of characteristics. Characteristics are channels for communication. A characteristic can be write only, read only, notify only, read & notify.

A more detailed description on services & characteristics can be found: https://www.bluetooth.com/specifications/gatt/generic-attributes-overview

I've been working on a app that uses BLE for more than a year, if I can be of any assistance please let me know.

@wjvii

This comment has been minimized.

Copy link

commented Sep 22, 2018

Add support for Bluetooth Beacons. There is some good work out there already with some recent commits although it has been a year since the last official release. Maybe there is some chance to incorporate that existing work into Xamarin Essentials?

https://github.com/andijakl/universal-beacon
https://github.com/SwiftArchitect/universal-beacon

@Redth Redth added this to Needs triage in Triage Nov 20, 2018

@Redth

This comment has been minimized.

Copy link
Member

commented Nov 26, 2018

I think what we need here is for someone with this domain specific knowledge to come up with an API for a minimum viable product. We often think of the 80/20 rule with Essentials (what is the most minimal functionality which covers 80% of users).

I'd like to see an API proposed here to address the 80% here.

@Redth Redth added the up for grabs label Nov 26, 2018

@Redth Redth moved this from Needs triage to Up for Grabs in Triage Nov 26, 2018

@Redth Redth added the azdo-sync label Nov 26, 2018

@brandwooddixon

This comment has been minimized.

Copy link

commented Dec 5, 2018

Whatever API is proposed should allow for un-adopted/custom service and characteristic UUIDs. This will allow for developers to implement support for BLE enabled devices that use non-standard services and characteristics whilst allowing for newly adopted services and characteristics to be supported without waiting for an update to Essentials.
Yes cross-platform BLE support is difficult, but isn't that what Essentials is for? With the explosion of low-powered IoT devices that can't use wireless I'm surprised that this wasn't included from the outset.

Further to some of the points posted.
Scan for device should allow for scan all devices and for devices implementing a specific service UUID or collection of service UUIDs (which would match a profile).

@Redth Redth moved this from Up for Grabs to Needs triage in Triage Dec 5, 2018

@Redth

This comment has been minimized.

Copy link
Member

commented Dec 7, 2018

The question is always, is this a big enough implementation / API to warrant a separate library (we've discussed the potential of introducing things like Xamarin.Bluetooth as a separate nuget package if necessary in the future).

Again, would love some suggested API specs from someone more familiar with bluetooth and BLE. Admittedly I'm not too knowledgeable in this area (should we only consider BLE for now?).

There's certainly a few folks in the thread who seem to have enough knowledge to work on a proposal :)

@Redth Redth moved this from Needs triage to Low priority in Triage Dec 7, 2018

@Ulf-Ason

This comment has been minimized.

Copy link

commented Feb 2, 2019

When we are creating apps for the industry, we need to get data from Classic Bluetooth (RFCOMM).
Find the device
Set up a connection
Read/write serial data async

@Redth Redth moved this from Low priority to Needs triage in Triage Feb 3, 2019

@VirtualNomad00

This comment has been minimized.

Copy link

commented Apr 15, 2019

IS there any update on if and when we might get this . Current bluetooth functionalities( both classic and BLE ) are a lot of hassle to implement with a lot of platform specific tweaks.
Example I have used BluetoothLE plugin . It's great but had to experiment a lot to figure out how things work and the there's always some issue with iOS like not able to get the adapter status in the first go or the notification subscriber stops working after getting the first notification etc .

@maexsp

This comment has been minimized.

Copy link

commented Apr 24, 2019

Same here. Waiting for Bluetooth! Creating industry apps with Xamarin essentially requires reliable Bluetooth support (LE and classic). Bluetooth is the only practical technology to wireless communicate with industry devices nowadays when implementing Multiplatform Apps.
Scanning nearby devices, connect, checking capabilities, communicate (even if hidden mode), disconnect, etc. for Android, iOS and UWP/Win10.
Thats a major functionality to implement Multiplatform Apps which can communicate with our industry devices. It seems that Cordova plugins and Flutter plugins already in place. Why Xamarin far behind with supporting Bluetooth?
Please support Bluetooth discovery and connections in Xamarin soon.
How is the official state about that regarding the Xamarin roadmap?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.