esp-rs / embedded-svc

Rust APIs and abstractions for various embedded services (WiFi, Network, Httpd, Logging, etc.)
Apache License 2.0
122 stars 34 forks source link

Add support for passive scanning #57

Open umgefahren opened 11 months ago

umgefahren commented 11 months ago

My application requires passive wifi scanning wich is not possible through the trait. My suggestion would be to add some config for the wifi scanning. I also consider it suboptimal that a Vec is returned from the scan method. Why not an iterator?

ivmarkov commented 11 months ago

My application requires passive wifi scanning wich is not possible through the trait. My suggestion would be to add some config for the wifi scanning.

This project is largely driven by community contributions, so the fastest way to get what you want is to work on a PR.

I also consider it suboptimal that a Vec is returned from the scan method. Why not an iterator?

Because the underlying ESP IDF driver does not allow that.

ivmarkov commented 11 months ago

By the way - you've opened this issue in the wrong project. Please move it to esp-idf-svc and close this one.

ivmarkov commented 11 months ago

In fact, passive scanning is already supported in esp-idf-svc. It is only not exposed in the Wifi trait, that's all.

umgefahren commented 11 months ago

But in order to be exposed in the WIFI trait there needs to be a trait method, right?

I will draft up a PR for that as soon as possible.

ivmarkov commented 11 months ago

Why do you want to go for this via the Wifi trait? Are you trying to somehow keep your code abstract, so that it works on something else besides Espressif chips?

If not, then this effort is not worth it.

umgefahren commented 11 months ago

Yes and I generally prefer the high level abstractions. I thought it might be a good idea since it's supported by a lot of wifi drivers. It would also enable to pass detailed options on how to perform the scanning.

ivmarkov commented 11 months ago

Well, fine then. Please work on a PR, and then we can discuss once we have your suggested changes.

In any case, getting your feet wet with the esp-idf-* echosystem and trying passive scan by directly calling the EspWifi structure is highly advisable before trying a PR.