Skip to content

Instantly share code, notes, and snippets.

@andersevenrud
Created January 29, 2016 18:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andersevenrud/c29e6299424a901736f9 to your computer and use it in GitHub Desktop.
Save andersevenrud/c29e6299424a901736f9 to your computer and use it in GitHub Desktop.
setboardconfig.lua
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