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

Getting the BSSID in softAP #18

Closed
tobyloki opened this issue Jul 14, 2020 · 3 comments
Closed

Getting the BSSID in softAP #18

tobyloki opened this issue Jul 14, 2020 · 3 comments

Comments

@tobyloki
Copy link

I wanted to know how it would be possible to retrieve the BSSID of the currently connected device in softAP mode. I know that the ESPTouch sample android app has this, but I haven't found any way to do so in this Provisioning app. How can I do this?

@KhushbuShah25
Copy link
Contributor

Hi @gearsmotion789 ,

You can get BSSID of the currently connected network by using this function.

private String getBSSID() {

        String bssid = null;
        WifiManager wifiManager = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE);
        WifiInfo wifiInfo = wifiManager.getConnectionInfo();
        if (wifiInfo.getSupplicantState() == SupplicantState.COMPLETED) {

            bssid = wifiInfo.getBSSID();
        }
        return bssid;
    }

@tobyloki
Copy link
Author

@khushbushah2302 Thank you very much. It works.

@shahpiyushv
Copy link
Collaborator

Closing this issue as it has been resolved.

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

No branches or pull requests

3 participants