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

Wifi.status() gives garbage on first run #7

Closed
Spritetm opened this issue Jul 24, 2015 · 2 comments
Closed

Wifi.status() gives garbage on first run #7

Spritetm opened this issue Jul 24, 2015 · 2 comments
Assignees

Comments

@Spritetm
Copy link

I'm testing your smart.js code, and I think I found a bug in it. When I first started it up, I tried to get the WiFi status:

smartjs 12040/3456$ Wifi.status()
"�W�?"

I compiled this with the 1.2.0 SDK, and it looks like the bug originally stems from there: when the WiFi station isn't online for whatever reason, wifi_station_get_connect_status() returns -1 (well, it's an u8 so actually 255.) I'll see if I can get that fixed or documented in the SDK, but in general, maybe the select statement in v7_esp.c, Wifi_status could use a default case so it doesn't return uninitialized memory when the WiFi status value is something weird?

@imax9000
Copy link
Contributor

Good point, I'll fix that.

@imax9000 imax9000 self-assigned this Jul 24, 2015
@imax9000
Copy link
Contributor

Fixed in 0f8516c

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

2 participants