diff --git a/lora.py b/lora.py index 9dca579..54b2330 100644 --- a/lora.py +++ b/lora.py @@ -48,6 +48,7 @@ CMD_TERMINATE = 1 # no args: terminate the sesssion, reply confirms CMD_WAITFOR = 2 # arg: (length): waits for length seconds CMD_RUNFOR = 3 # arg: (chan, length): turns on chan for length seconds CMD_PING = 4 # arg: (): a no op command +CMD_SETUNSET = 5 # arg: (chan, val): sets chan to val class LORANode(object): '''Implement a LORANode initiator.''' @@ -121,6 +122,9 @@ class LORANode(object): async def runfor(self, chan, length): return await self._sendcmd(CMD_RUNFOR, chan, length) + async def setunset(self, chan, val): + return await self._sendcmd(CMD_SETUNSET, chan, val) + async def ping(self): return await self._sendcmd(CMD_PING) @@ -285,7 +289,7 @@ async def main(): await l.start() - valid_cmds = { 'waitfor', 'runfor', 'ping', 'terminate', } + valid_cmds = { 'waitfor', 'setunset', 'runfor', 'ping', 'terminate', } cmdargs = list(args.args) while cmdargs: