Created
March 31, 2016 16:32
-
-
Save petersaints/68b17bbee89b657641a5e09d813dec07 to your computer and use it in GitHub Desktop.
Convert a Wi-Fi's network center frequency to the corresponding channel number.
Based on: http://stackoverflow.com/a/33276767/356977
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public int getChannel() { | |
if (frequency == 2484) { | |
return 14; | |
} else if (frequency < 2484) { | |
return (frequency - 2407) / 5; | |
} else { | |
return frequency/5 - 1000; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment