return nil \r
end,\r
\r
- ------------ CRC-16 ccitt checksums\r
- -- Takes a hex string and calculates a crc16\r
+ ------------ CRC-8 Legic checksums\r
+ -- Takes a hex string and calculates a crc8\r
Crc8Legic = function(s)\r
if s == nil then return nil end\r
if #s == 0 then return nil end\r
return n\r
end,\r
\r
+ -- a simple implementation of a sleep command. Thanks to Mosci\r
+ -- takes number of seconds to sleep\r
+ Sleep = function(n)\r
+ local clock = os.clock\r
+ local t0 = clock()\r
+ while clock() - t0 <= n do end\r
+ return nil \r
+ end,\r
+ \r
-- function convertStringToBytes(str)\r
-- local bytes = {}\r
-- local strLength = string.len(str)\r