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

Added channel, ssid scan #4636

Merged
merged 4 commits into from
Apr 13, 2018
Merged

Added channel, ssid scan #4636

merged 4 commits into from
Apr 13, 2018

Conversation

dtworth
Copy link
Contributor

@dtworth dtworth commented Apr 11, 2018

Overloaded scanNetworks so scan can occur on a single channel and/or for a particular ssid.

I needed this so I could speed up the scan time in order to track the location of a mobile device using the measured signal strength. A three-second scan was too long. With this modification, the scan time is reduced to ~100 mS if the channel number is defined.

If folks find this useful, I might also fool around with the scan time parameter.

I hope that you will consider including this modification in the next release version.

Overloaded scanNetworks so scan can occur on a single channel and/or for a particular ssid.

struct scan_config config;
memset(&config, 0, sizeof(config));
config.ssid = ssid;
Copy link
Collaborator

Choose a reason for hiding this comment

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

The only difference between the original method and your overloaded one are these two lines:
config.ssid = ssid;
config.channel = channel;

where ssid and channel are new arguments.

Instead of duplicating the entire method, please just add the two arguments to the original method, and in the .h put set default values to keep the current behavior (i.e.: channel = 0 and ssid = nullptr, because of the memset).

Copy link
Contributor Author

@dtworth dtworth left a comment

Choose a reason for hiding this comment

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

Will do!

channel number and ssid have been added as optional parameters to the orginal scanNetworks()
@devyte devyte merged commit 7820fb7 into esp8266:master Apr 13, 2018
@happytm
Copy link

happytm commented Sep 13, 2019

Is it now possible to scan only specific ssid. If so how to do it?

Thanks.

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.

3 participants