Created
January 29, 2016 18:44
-
-
Save andersevenrud/c29e6299424a901736f9 to your computer and use it in GitHub Desktop.
setboardconfig.lua
This file contains hidden or 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
local function get_board_config_command(info) | |
local a = {} | |
if info["wifi"] ~= nil then | |
table.insert(a, "-wifipassword \"" .. info["wifi"]["password"] .. "\"") | |
table.insert(a, "-wifiencryption \"" .. info["wifi"]["encryption"] .. "\"") | |
table.insert(a, "-wifibssid \"" .. info["wifi"]["bssid"] .. "\"") | |
end | |
if info["hostname"] ~= nil then | |
table.insert(a, "-hostname \"" .. info["hostname"] .. "\"") | |
end | |
-- ... and so on | |
local commandline = table.concat(a, " ") | |
reutrn "sh " .. ROOTDIR .. "/bin/arduino-board-config.sh" .. commandline | |
end | |
-- ... | |
elif meth == "setboardconfig" then | |
command(get_board_config_command(iargs)) | |
-- ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment