Class: WifiGeoLocation::WifiTower
- Inherits:
-
Object
- Object
- WifiGeoLocation::WifiTower
- Defined in:
- lib/wifi_geo_location/wifi_tower.rb
Class Method Summary collapse
Class Method Details
.scan ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/wifi_geo_location/wifi_tower.rb', line 3 def self.scan if RUBY_PLATFORM =~ /darwin/ lines = `/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -s`.split(/[\r\n]/) lines.shift lines.map do |i| a = i.scan(/[^\s]+/) { mac_address: a[1], signal_strength: a[2].to_i, channel: a[3].to_i } end else raise 'using only Max OSX' end end |