change white space to tabs instead of spaces

This commit is contained in:
payonel 2015-09-01 00:17:46 -07:00
parent 1b83c83d6d
commit 7e7851f0de
2 changed files with 203 additions and 198 deletions

View File

@ -107,7 +107,6 @@ end
-- backend private methods, these are not pushed to user machine environments -- backend private methods, these are not pushed to user machine environments
function modem_host.pushMessage(target, datagram) function modem_host.pushMessage(target, datagram)
if not modem_host.validTarget(target) then if not modem_host.validTarget(target) then
return false, "invalid target, no such client listening" --ignored return false, "invalid target, no such client listening" --ignored
end end
@ -154,7 +153,6 @@ function modem_host.processPendingMessages()
else else
table.remove(modem_host.messages, i) table.remove(modem_host.messages, i)
end end
end end
end end
@ -219,7 +217,6 @@ function modem_host.joinExistingMessageBoard()
end end
function modem_host.connectMessageBoard() function modem_host.connectMessageBoard()
if modem_host.connected then if modem_host.connected then
return true return true
end end
@ -276,11 +273,13 @@ function obj.getWakeMessage() -- Get the current wake-up message.
cprint("modem.getWakeMessage") cprint("modem.getWakeMessage")
return wakeMessage return wakeMessage
end end
function obj.setWakeMessage(message) -- Set the wake-up message. function obj.setWakeMessage(message) -- Set the wake-up message.
cprint("modem.setWakeMessage",message) cprint("modem.setWakeMessage",message)
compCheckArg(1,message,"string","nil") compCheckArg(1,message,"string","nil")
wakeMessage = message wakeMessage = message
end end
function obj.close(port) -- Closes the specified port (default: all ports). Returns true if ports were closed. function obj.close(port) -- Closes the specified port (default: all ports). Returns true if ports were closed.
cprint("modem.close",port) cprint("modem.close",port)
compCheckArg(1,port,"number","nil") compCheckArg(1,port,"number","nil")
@ -295,10 +294,12 @@ function obj.close(port) -- Closes the specified port (default: all ports). Retu
modem_host.open_ports[port] = nil modem_host.open_ports[port] = nil
return true return true
end end
function obj.maxPacketSize() -- Gets the maximum packet size (config setting). function obj.maxPacketSize() -- Gets the maximum packet size (config setting).
cprint("modem.maxPacketSize") cprint("modem.maxPacketSize")
return settings.maxNetworkPacketSize return settings.maxNetworkPacketSize
end end
if wireless then if wireless then
function obj.getStrength() -- Get the signal strength (range) used when sending messages. function obj.getStrength() -- Get the signal strength (range) used when sending messages.
cprint("modem.getStrength") cprint("modem.getStrength")
@ -310,11 +311,13 @@ if wireless then
strength = newstrength strength = newstrength
end end
end end
function obj.isOpen(port) -- Whether the specified port is open. function obj.isOpen(port) -- Whether the specified port is open.
cprint("modem.isOpen",port) cprint("modem.isOpen",port)
compCheckArg(1,port,"number") compCheckArg(1,port,"number")
return modem_host.open_ports[port] ~= nil return modem_host.open_ports[port] ~= nil
end end
function obj.open(port) -- Opens the specified port. Returns true if the port was opened. function obj.open(port) -- Opens the specified port. Returns true if the port was opened.
cprint("modem.open",port) cprint("modem.open",port)
compCheckArg(1,port,"number") compCheckArg(1,port,"number")
@ -332,10 +335,12 @@ function obj.open(port) -- Opens the specified port. Returns true if the port wa
modem_host.open_ports[port] = true modem_host.open_ports[port] = true
return true return true
end end
function obj.isWireless() -- Whether this is a wireless network card. function obj.isWireless() -- Whether this is a wireless network card.
cprint("modem.isWireless") cprint("modem.isWireless")
return wireless return wireless
end end
function obj.broadcast(port, ...) -- Broadcasts the specified data on the specified port. function obj.broadcast(port, ...) -- Broadcasts the specified data on the specified port.
cprint("modem.broadcast",port, ...) cprint("modem.broadcast",port, ...)
compCheckArg(1,port,"number") compCheckArg(1,port,"number")
@ -353,17 +358,17 @@ end
local cec = {} local cec = {}
local doc = { local doc = {
["send"]="function(address:string, port:number, data...) -- Sends the specified data to the specified target.", ["send"]="function(address:string, port:number, data...) -- Sends the specified data to the specified target.",
["getWakeMessage"]="function():string -- Get the current wake-up message.", ["getWakeMessage"]="function():string -- Get the current wake-up message.",
["setWakeMessage"]="function(message:string):string -- Set the wake-up message.", ["setWakeMessage"]="function(message:string):string -- Set the wake-up message.",
["close"]="function([port:number]):boolean -- Closes the specified port (default: all ports). Returns true if ports were closed.", ["close"]="function([port:number]):boolean -- Closes the specified port (default: all ports). Returns true if ports were closed.",
["maxPacketSize"]="function():number -- Gets the maximum packet size (config setting).", ["maxPacketSize"]="function():number -- Gets the maximum packet size (config setting).",
["getStrength"]="function():number -- Get the signal strength (range) used when sending messages.", ["getStrength"]="function():number -- Get the signal strength (range) used when sending messages.",
["setStrength"]="function(strength:number):number -- Set the signal strength (range) used when sending messages.", ["setStrength"]="function(strength:number):number -- Set the signal strength (range) used when sending messages.",
["isOpen"]="function(port:number):boolean -- Whether the specified port is open.", ["isOpen"]="function(port:number):boolean -- Whether the specified port is open.",
["open"]="function(port:number):boolean -- Opens the specified port. Returns true if the port was opened.", ["open"]="function(port:number):boolean -- Opens the specified port. Returns true if the port was opened.",
["isWireless"]="function():boolean -- Whether this is a wireless network card.", ["isWireless"]="function():boolean -- Whether this is a wireless network card.",
["broadcast"]="function(port:number, data...) -- Broadcasts the specified data on the specified port.", ["broadcast"]="function(port:number, data...) -- Broadcasts the specified data on the specified port.",
} }
return obj,cec,doc return obj,cec,doc