-
Notifications
You must be signed in to change notification settings - Fork 47
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
[flutter_blue] Add support for bluetooth communication #106
Comments
Yeah, the bluetooth support is indeed important for Tizen devices and we need to implement as soon as possible. @flutter-tizen/maintainers @rookiejava Do we have any plans or on-going work for these items?
|
Thank you for reaching us! I think we can proceed within next month if there are no other issues. 😉 |
Is there any progress? |
@bbrto21 Nope :/ |
Currently I am implementing geolocator, I think it is almost done. |
@bbrto21 Is there any progress. Would you mind if I started development on this plugin? |
@JRazek Ok |
I'm sorry to bother you@JRazek , but I want to know if the Bluetooth plugin has made any progress. |
@NowLoadY
Yes, I'm currently preparing a PR.
|
I'm looking forward to it very much😍, because I'm planning to make a program that uses a watch to control the RC car. And I know nothing about how to write a flutter-tizen library.🥲 |
Please use https://github.com/boskokg/flutter_blue_plus as a base for support because the old flutter_blue plugin seems to be not maintained any more |
@MrCsabaToth I'm working on other issues at the moment, I'll look into this once that's done. |
I also have to add that there's no guarantee that at some point in future the boskosg fork won't be abandoned. But in case that would happen hopefully some other fork would become maintained and mainstream then. Also note that all (or most) of the Flutter Bluetooth plugins I saw were BLE only, so Bluetooth Low Energy / a.k.a. Bluetooth Smart only. If you need to support non BLE Bluetooth devices then you'll need to look for a different plugin. I'm constantly surveying the Flutter Bluetooth plugin space (TrackMyIndoorWorkout/TrackMyIndoorWorkout#210). There's a BLE plugin maintained by Phillips Hue: https://pub.dev/packages/flutter_reactive_ble I haven't ever tested it though. The question is if its main use-case is smart bulbs and smart home then how much it can handle higher data rates. It seems to be relatively popular, and maybe Phillips presence is a slight guarantee that it won't be abandoned. It is mobile only (Android + iOS) just like the boskosg flutter_blue_plus. There's also a third one I never tested: https://pub.dev/packages/flutter_ble_lib, that's also mobile only. If you compare those three by popularity then don't look at the flutter_blue_plus's likes, but instead look at the https://github.com/boskokg/flutter_blue, because that has 700+ likes and the fork became official not too long ago, so people haven't migrated that much yet from the flutter_blue over to https://github.com/boskokg/flutter_blue_plus. If desktop support is important to you (maybe desktop Linux support is closer to a Tizen support, or you just want to look at how it's done for Linux), then https://github.com/woodemi/quick_blue has desktop support. The Linux support essentially revolves around BlueZ. |
Thanks for sharing your detailed survey! It's unfortunate that there's not yet a "go to" bluetooth plugin for Flutter comapred to audio plugins like just_audio or audioplayers.
Recent devices more or less support BLE along with classic Bluetooth, this is especially true for embedded devices where battery is important (except TV but it does support BLE to communicate with other battery operated embedded devices). Tizen devices support BLE protocol hence the current bluetooth plugin interfaces in the Flutter ecosystem is sufficient for our case.
I've recently discovered
I haven't heard of
Directly using the Linux plugin for Tizen devices is an option if every API used internally doesn't rely on hardware modules. Tizen have its own version of bluetooth API and I can't guarantee that those APIs are all built on top of Linux's basic bluetooth stack, it would be safe to implement a Tizen plugin that uses its own bluetooth API. With the current information, I would consider supporting either |
I've tried implementing bluetooth with
According to here, dart does not support function calls when C runs that function outside of the main thread. |
From what I read what that issue says is that the thread which calls back should be the same thread. In case of that issue the original thread was the main thread, that's why the calling back thread has to be also main. But if the 1st thread is not main the calling back thread could be also that different thread. I don't have time to inspect this in more detail now. Other bluetooth ffi plugins exist, such as https://github.com/woodemi/quick_blue Linux support, so I'd peek into how they implement. |
@HakkyuKim It's a well known issue. flutter-tizen/tizen_interop#10
Note: The original thread is a UI thread. https://github.com/flutter/flutter/wiki/The-Engine-architecture#ui-task-runner |
@MrCsabaToth It could be that Linux's bluetooth functions and registered callbacks runs on a single thread. Some Tizen's API run callbacks on a second thread and that seems to be the issue here. |
I'm going to implement flutter_reactive_ble instead of flutter_blue_plus, because flutter_blue_plus lacks a stable platform interface and can only be implemented implicitly via message channel + protobuf, which is subject to change at any time without guarantee of backward compatibility. I'll open a PR in this repo as soon as PhilipsHue/flutter_reactive_ble#688 is published. |
Maybe I'm wrong but don't Flutter Reactive BLE use ProtoBufs as well? https://github.com/PhilipsHue/flutter_reactive_ble/tree/master/packages/reactive_ble_mobile/protos Regardless: thanks for the work |
@MrCsabaToth Its mobile implementation ( |
I see! Cool! |
Unfortunately the flutter_reactive_ble project is dead. There's no maintainer for the repo. No code review for 4 months. Nobody cares about open issues. |
Sorry to hear. I was hopeful that since Phillips is behind it due to Phillips Hue, it won't get to that point. Let's hope a maintainer will pop up and it'll be active again. Because the only other viable project is |
@MrCsabaToth Thank you for showing your interest! I hope flutter_blue_plus will migrate to the federated architecture soon so that we can implement its platform interface for Tizen. |
https://github.com/search?q=repo%3Aboskokg%2Fflutter_blue_plus+protobuf&type=commits Looks like |
@swift-kim is there any news? When we can expect a release? |
The author of flutter_blue_plus has explicitly mentioned that he will not migrate the plugin to federated. It will be quite a maintenance burden for us to track the method channel API changes if we implement the plugin without a stable platform interface. I don't think I'll have time to implement this for a while, but maybe someone else will. Please feel free to contribute if anyone is interested (you can either reuse some code from #542 or write it from scratch). |
Hi, maintainer of Correct, I don't want the extra complexity of federated. But the method channel interface will be very stable going forward. The library has stabilized a lot. I think it would be viable to fork with all the work i've put into it, I've pretty much ran out of ways to improve it. |
There is an existing 3rd party plugin called flutter_blue that lets you communicate through bluetooth on Android and iOS. I think adding Tizen support to this plugin would make Tizen wearable apps significantly more valuable.
On a related note, is there any way to communicate between a wearable device and a mobile phone using Flutter for Tizen? I'd like to be able to communicate in real time across the devices (for example, tapping a button on the watch to play or pause a video on the phone.
Thanks for the Flutter support!
The text was updated successfully, but these errors were encountered: