Skip to content

Desktop and Web support#6

Open
Barabas5532 wants to merge 1 commit into
omert08:mainfrom
ShrapnelDSP:feature/web-support
Open

Desktop and Web support#6
Barabas5532 wants to merge 1 commit into
omert08:mainfrom
ShrapnelDSP:feature/web-support

Conversation

@Barabas5532
Copy link
Copy Markdown
Contributor

Added support for web and linux.

The example/web and example/linux folders are automatically generated by flutter create example.

I've added some files to the gitignore. These were automatically created and do not exist in the repo yet, so I assume they were meant to be ignored.

I've tested both new platforms with esp-idf v4.3.1 using the provisioning/wifi_prov_mgr example. It looks good as far as I can see. I was able to complete provisioning on both.

Fixes #5

Comment thread lib/src/cryptor.dart
Future<Uint8List> crypt(Uint8List data) async {
final secretBox = await algorithm.encrypt(
data,
secretKey: await algorithm.newSecretKeyFromBytes(_key),
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly we could call algorithm.newSecretKeyFromBytes(_key) just once in the init function.

@Barabas5532 Barabas5532 changed the title Feature/web support Desktop and Web support Jan 6, 2022
Copy link
Copy Markdown
Owner

@omert08 omert08 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't disable scanning for sake of desktop and web support.

Comment thread example/lib/wifi_screen/wifi_bloc.dart Outdated


var listWifi = null;/* await prov.startScanWiFi() */;
/* TODO remove dummy scan result. Scanning is probably impossible on web.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scanning is a matter of sending request to ESP AP and receiving response. Since communication is bidirectional. It should be possible regardless of what platform is using this library.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've already restored this code in the later commits (e945759). Scanning works fine on Desktop and Web in the last commit here.

I recommend you only review the overall changes, there were a bunch of automatic formatting changes that I cleaned up later.

Comment thread example/lib/wifi_screen/wifi_bloc.dart Outdated


var listWifi = await prov.startScanWiFi();
var listWifi = null;/* await prov.startScanWiFi() */;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disabling startScanWiFi is a big move. It's one of the major features of the library.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already fixed in e945759

@Barabas5532 Barabas5532 requested a review from omert08 January 27, 2022 19:17
@Barabas5532 Barabas5532 force-pushed the feature/web-support branch from 36de7e4 to bc05cdb Compare April 22, 2022 20:00
@Barabas5532
Copy link
Copy Markdown
Contributor Author

Squashed and force pushed to avoid confusion. Also tested again using esp-idf v4.4, and flutter:

Flutter 2.10.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 7e9793dee1 (7 weeks ago) • 2022-03-02 11:23:12 -0600
Engine • revision bd539267b4
Tools • Dart 2.16.1 • DevTools 2.9.2

I'm now just getting a white screen and no logs when running the example with flutter run -d chrome. Other apps are working fine.

Linux desktop is working fine as before.

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.

Desktop and Web support

2 participants