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

Massive upgrade #35

Merged
merged 25 commits into from
Jun 19, 2019
Merged

Massive upgrade #35

merged 25 commits into from
Jun 19, 2019

Conversation

AgainPsychoX
Copy link
Collaborator

@AgainPsychoX AgainPsychoX commented May 30, 2019

I found this repository and it was not good enough good to be used in my current project, but it was at least something, so I decided to fork it and develop. I created this pull request to get feedback from all of you using @edufolly old version.

Overall features:

  • Adapter status monitoring,
  • Turning adapter on and off,
  • Opening settings,
  • Discovering devices,
  • Connecting to multiple devices in the same time,
  • Sending and recieving data (multiple connections),
  • Chat example (with simple Raspberry PI chat server).
  • Background task example (using Arduino with HC-05 module)

Ongoing features: Features To Do in next iterations:

  • Allow connection method/protocol/UUID specification,
  • Listening/server mode,
  • Recognizing and displaying BluetoothClass of device,
  • Maybe integration with flutter_blue one day ;)

I must to emphasize: I target Bluetooth serial connection generally, not only to HC-05 or Raspberry (however, this also includes these).

Patryk (PsychoX) Ludwikowski added 15 commits May 24, 2019 10:59
There is no reason to log these exception if they are passed to Dart exception handling system, so in case of occurring they could be presented to the user.

Add popular for Flutter developers editor Visual Studio to `.gitignore`.
Always true, there is even no scenario when someone could care about it xD
Just look at this gorgeous code base XD
+ Separated Dart library files into smaller ones.
+ Add toggling Bluetooth adapter (`requestEnable` and `requestDisable`).
+ Add `getState` as direct way to obtain Bluetooth adapter state.
+ Add discovering (`isDiscovering`, `startDiscovery`, `cancelDiscovery`).
+ Make sure all Flutter results objects from Android platform code are returning on `@UiThread` (there were issues related).
+ Add missing `AsyncTask` (it were still working, but possibly blocking).
+ Made event sinks & channels code cleaner.
+ Build new example application (status, toggling, discovery, connecting, chat); Add instruction about running (used in example) simple chat server.

Well, I learnt a lot. I few next days I want to continue developing it.
Almost copied from freshly generated Flutter app project in VS Code.

Add `pubspec.lock` to library local `.gitignore`, because it is recommended to do so.
Limited default `connect` to sending just the address to platform code.
And minor styling change
Connected and disconnected events could be detected in common Flutter code by `then` of `connect` and `onDone` of `StreamSubscription` of connection `onRead`.`onListen`.
Patryk (PsychoX) Ludwikowski added 2 commits June 3, 2019 12:22
+ Update `README.md`

Now starting work on example for it (HC-05 & Raspberry)
@FWeissenb
Copy link
Contributor

can you integration bonding with a PIN code? I made another PR so @edufolly can reject it if it's integrated here. #37

@FWeissenb
Copy link
Contributor

About iOS: is it possible to integrate it? I thought an apple certified bluetooth module is needed to use SPP on IOS. I don't have a mac to test it.

This is so cool that I am quire proud of myself. Unfortunately, this is quite WIP commit, since:
- There should be 2 data series for temperatures,
- One more graphs for water pH level,
- Better vertical lines labels generation (it is a issue of my unfinished `LineChart` widget, not really the Bluetooth library or example),
- Information about the example (and Arduino code) needs to be added.
- And lastly: I honestly don't quite feel confident am I testing it right as multiple device connections - there will be further tests.

Pushing because I was a bit belated with the work on this... Since it is WIP, it could be over-written by force push or another commit will fill out the lacks.
@AgainPsychoX
Copy link
Collaborator Author

Tomorrow I will perform few more tests (Multiple connection using Arduino HC-05 and Raspberry Pi at the same time) and there will be enclosing commit of first part of the whole pull request.

@edufolly please share your thoughts about the PR. Is there something more I should look yet before marking the PR as ready?

Patryk (PsychoX) Ludwikowski added 3 commits June 18, 2019 02:27
+ Rest of the charts on view page,
+ Alert message when cannot connect,
+ Minors.
@edufolly
Copy link
Owner

Hi @PsychoXIVI,

your work is great, but I'm not having enough time to review the PRs. Also at this moment, I don't have the environment to test. So I added you as a collaborator of the project. You don't need my approval to increment the project. If you are interested to collaborate more, send me an e-mail to add you as a plugin publisher. Thanks for your dedicated job.

@AgainPsychoX
Copy link
Collaborator Author

Test for multiple connections at the same time performed successfully. I also recorded it :3 There will be simple finalizing commit and I think the PR will be ready for now.

Patryk (PsychoX) Ludwikowski added 3 commits June 18, 2019 17:00
@AgainPsychoX AgainPsychoX marked this pull request as ready for review June 18, 2019 15:39
README.md Show resolved Hide resolved
@AgainPsychoX AgainPsychoX changed the title [WIP] Massive upgrade Massive upgrade Jun 18, 2019
@AgainPsychoX AgainPsychoX merged commit 9048d6d into edufolly:master Jun 19, 2019
@chrisgate
Copy link

Thanks for this Library and the massive upgrade @edufolly @PsychoXIVI ........I did modified this library while converting Mobile RFID reader library from android Library to Flutter and it manage to work(months ago) .....i was just checking the code to see what i can include again then i saw commit 25minutes ago.....to cut the long story the new upgrade work without me including their library that really surprised me.................I am still testing and Thank for great work!

@AgainPsychoX
Copy link
Collaborator Author

AgainPsychoX commented Jun 19, 2019

Thanks! I'm not going to stop here :) There will be more soon.

In case you would need any help while working with this library, go ahead and create some issue.

@chrisgate
Copy link

Thank you......... I am have issue on the bytes from input or onRead........i cant convert it right.

I will create issues for it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants