Skip to content

Commit

Permalink
backport get_phy_mac from develop
Browse files Browse the repository at this point in the history
  • Loading branch information
G10h4ck committed Oct 28, 2014
1 parent e44b804 commit 25d803d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/lime-system/files/usr/lib/lua/lime/wireless.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,19 @@
local config = require("lime.config")
local network = require("lime.network")
local libuci = require("uci")
local fs = require("nixio.fs")

wireless = {}

wireless.modeParamsSeparator=":"
wireless.limeIfNamePrefix="lm_"

function wireless.get_phy_mac(phy)
local path = "/sys/class/ieee80211/"..phy.."/macaddress"
local mac = assert(fs.readfile(path), "wireless.get_phy_mac(..) failed reading: "..path):gsub("\n","")
return utils.split(mac, ":")
end

function wireless.clean()
print("Clearing wireless config...")
local uci = libuci:cursor()
Expand Down

0 comments on commit 25d803d

Please sign in to comment.