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.

Receive UDP string
#4
It works, but if I make a script like this there is 5-10 delay of sending KNX address (in if statement) after UDP string is sent by the client:
I use this code as resident with 0s interval.
Any thoughts of making this script work faster?
Code:
if not server then
 require('socket')
 server = socket.udp()
 server:setsockname('*', 8891)
 server:settimeout(1)
end

data = server:receive()

local TerminalID = string.byte(data, 9, 12)
local FingerID = string.byte(data, 33, 36)

if (FingerID == 6 and TerminalID == 63) then
 grp.write('4/0/10', 1)
elseif (FingerID == 7 and TerminalID == 63) then
 grp.write('0/5/18', 0)  
end

Nevermind! I solved it by putting logic in "if data then" statement
Reply


Messages In This Thread
Receive UDP string - by leonidas - 24.08.2017, 13:16
RE: Receive UDP string - by admin - 24.08.2017, 17:51
RE: Receive UDP string - by AlexLV - 24.08.2017, 22:47
RE: Receive UDP string - by leonidas - 28.08.2017, 05:25
RE: Receive UDP string - by admin - 28.08.2017, 08:54
RE: Receive UDP string - by AlexLV - 04.09.2017, 08:41
RE: Receive UDP string - by Diggerz - 15.02.2021, 01:38
RE: Receive UDP string - by admin - 15.02.2021, 07:46
RE: Receive UDP string - by Diggerz - 18.02.2021, 08:56
RE: Receive UDP string - by admin - 18.02.2021, 08:58

Forum Jump: