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.

ELK M1 Alarm panel
#2
Here's a basic SSL connection example:
Code:
socket = require('socket')
ssl = require('ssl')

ip = '192.168.1.1'
port = 2601

sock = socket.tcp()
sock:settimeout(5)
sock:connect(ip, port)
sock = ssl.wrap(sock, 'tlsv1')
sock:dohandshake()

Checksum calculation:
Code:
function checksum(str)
  local sum = 0
  for i = 1, #str do
    sum = (sum + str:byte(i)) % 256
  end
  return string.format('%02X', 256 - sum)
end
Reply


Messages In This Thread
ELK M1 Alarm panel - by rocfusion - 07.08.2017, 17:04
RE: ELK M1 Alarm panel - by admin - 08.08.2017, 08:50
RE: ELK M1 Alarm panel - by rocfusion - 12.08.2017, 23:21
RE: ELK M1 Alarm panel - by admin - 14.08.2017, 06:13
RE: ELK M1 Alarm panel - by rocfusion - 14.08.2017, 17:14
RE: ELK M1 Alarm panel - by admin - 17.08.2017, 06:30
RE: ELK M1 Alarm panel - by rocfusion - 17.08.2017, 07:07
RE: ELK M1 Alarm panel - by rocfusion - 19.08.2017, 23:32
RE: ELK M1 Alarm panel - by rocfusion - 22.08.2017, 06:31
RE: ELK M1 Alarm panel - by admin - 22.08.2017, 06:52

Forum Jump: