embedded-svc icon indicating copy to clipboard operation
embedded-svc copied to clipboard

Add support for passive scanning

Open umgefahren opened this issue 2 years ago • 7 comments
trafficstars

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?

umgefahren avatar Oct 23 '23 09:10 umgefahren

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 avatar Oct 23 '23 10:10 ivmarkov

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

ivmarkov avatar Oct 23 '23 10:10 ivmarkov

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

ivmarkov avatar Oct 23 '23 11:10 ivmarkov

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.

umgefahren avatar Oct 23 '23 13:10 umgefahren

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.

ivmarkov avatar Oct 23 '23 13:10 ivmarkov

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.

umgefahren avatar Oct 23 '23 13:10 umgefahren

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.

ivmarkov avatar Oct 23 '23 14:10 ivmarkov