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

ESP8266Wifi.status() function is not working as expected #13

Open
jordicasals opened this issue Feb 7, 2018 · 0 comments
Open

ESP8266Wifi.status() function is not working as expected #13

jordicasals opened this issue Feb 7, 2018 · 0 comments

Comments

@jordicasals
Copy link

Hi,

I think that the status() function in the ESP8266Wifi class is not working as expected (according to the function header comments). It affects the client.connected() function and the examples.

I propose a modification:

// status()
// Input: none
// Output:
//    - Success: 2, 3, 4, or 5 (ESP8266_STATUS_GOTIP, ESP8266_STATUS_CONNECTED, ESP8266_STATUS_DISCONNECTED, ESP8266_STATUS_NOWIFI)
//    - Fail: <0 (esp8266_cmd_rsp)
int16_t ESP8266Class::status()
{
	int16_t statusRet = updateStatus();
	if (statusRet > 0)
	{
		return _status.stat;
	}
	return -1;
}

Thank you

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

1 participant