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

Android WIFI Connection Not Reported Correctly #6

Open
devon-o opened this issue May 27, 2013 · 2 comments
Open

Android WIFI Connection Not Reported Correctly #6

devon-o opened this issue May 27, 2013 · 2 comments

Comments

@devon-o
Copy link

devon-o commented May 27, 2013

Hey Freshplanet,

Thank you for releasing this fantastic ANE.

Just ran across a small problem though. In the method AirNetworkInfo::isNotNativeConnectedWithWIFI() (confusing name, btw), this line:

if (interfaces[i].active && ["en0", "wifi"].indexOf(interfaces[i].name.toLocaleLowerCase()))

will cause the method to return true even if WIFI is not connected (an indexOf() -1 will return true). Simply adding a >0 will fix this like so:

if (interfaces[i].active && ["en0", "wifi"].indexOf(interfaces[i].name.toLocaleLowerCase()) > 0)

I'll post a pull request later.

Thank you again for making this available. It's very useful.

-devon

devon-o added a commit to meez/ANE-Network-Info that referenced this issue May 27, 2013
Added a >0 when checking interface names in
isNotNativeConnectedWithWIFI()
@cosmith
Copy link

cosmith commented May 28, 2013

Hey, thanks for contributing! Shouldn't it be if (interfaces[i].active && ["en0", "wifi"].indexOf(interfaces[i].name.toLocaleLowerCase()) >= 0) though? (We want to detect ethernet connection for the simulator).

@devon-o
Copy link
Author

devon-o commented Jun 13, 2013

Very sorry about the delay. You're dead right, of course. I've made the fix in my fix branch which still has the pull request outstanding if you'd like to accept it now.

-devon

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