Skip to content

WiFi AP status doesn't change when a client connects #78

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

Closed
sebromero opened this issue Oct 26, 2020 · 0 comments · Fixed by #79
Closed

WiFi AP status doesn't change when a client connects #78

sebromero opened this issue Oct 26, 2020 · 0 comments · Fixed by #79
Labels
bug Something isn't working

Comments

@sebromero
Copy link
Collaborator

In the example code there is this snipped which checks for new clients connecting to the AP:

// compare the previous status to the current status
  if (status != WiFi.status()) {
    // it has changed update the variable
    status = WiFi.status();

    if (status == WL_AP_CONNECTED) {
      // a device has connected to the AP
      Serial.println("Device connected to AP");
    } else {
      // a device has disconnected from the AP, and we are back in listening mode
      Serial.println("Device disconnected from AP");
    }
  }

The status doesn't seem to change even when a client successfully connects. I couldn't find any references in the WiFi library where WL_AP_CONNECTED is set. The example worked with an old version of the core as there was a hardcoded value being returned by the status function:

uint8_t arduino::WiFiClass::status() {
    // @todo: fix
    return WL_CONNECTED;
}

Probably we need to look into register_event_handler function of the WhdSoftAPInterface class. The documentation is quite limited and I couldn't find an example of how to implement it yet. https://os.mbed.com/docs/mbed-os/v6.3/feature-i2c-doxy/class_whd_soft_a_p_interface.html#a2ab8fabaa3c42aa60fc3d4438368d43f

@sebromero sebromero added the bug Something isn't working label Oct 26, 2020
@sebromero sebromero linked a pull request Oct 27, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant