Last active
January 1, 2016 21:09
-
-
Save cupakromer/8201917 to your computer and use it in GitHub Desktop.
Radius iBeacon offline mode minor decoder
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
def decode_minor(minor) | |
day = minor >> 11 | |
hour = (minor >> 6) & 0b11111 | |
min = minor & 0b111111 | |
"#{day} #{hour}:#{min} UTC" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment