diff options
Diffstat (limited to 'lib/support/drivers/gas.lua')
-rw-r--r-- | lib/support/drivers/gas.lua | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/lib/support/drivers/gas.lua b/lib/support/drivers/gas.lua deleted file mode 100644 index a056759..0000000 --- a/lib/support/drivers/gas.lua +++ /dev/null @@ -1,20 +0,0 @@ -local device = _G -local RD_GAS = string.char(0x01) -local char000 = string.char(0,0,0) - -api={} -api.get_gas = {} -api.get_gas.parameters = {} --no parameter -api.get_gas.returns = {[1]={rname="gas level", rtype="number"}} --one return -api.get_gas.call = function () - local get_payload = RD_GAS - device:send(get_payload) - local response = device:read(3) - if not response then - print ('WARN: api.get_gas.call failure on device:read(3)') - response=char000 - end - local raw_val = string.byte(response, 2) + 255*string.byte(response, 3) - return raw_val -end - |