This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Integration with Satel alarm system via ETHM-1
#6
Correction: default receive pattern is '*l' - a single line, not the whole result. Receive() will return partial result as a third return value when an error occurs (that's why you are getting an empty string). So you can use '*a' pattern to receive everything until timeout occurs. This is not the most efficient way, but it will work Smile

Code:
data, err, partial = client:receive('*a')

-- error
if not data then
  data = partial
end

-- do something with data that's available
if data then
  parsedata(data)
end

client:close()

As for hex logging, new firmware will have loghex() function to make this easier.
Reply


Messages In This Thread
RE: Integration with Satel alarm system via ETHM-1 - by admin - 25.10.2016, 08:51

Forum Jump: