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
#4
You don't need a separate function for this, last 2 bytes of the message is the resulting checksum. You can do it like this:
Code:
message = '16XK40392361108171100067'
calccs = checksum(message:sub(1, -3)) -- calculated checksum from message data
recvcs = message:sub(-2, -1) -- received checksum
log(calccs, recvcs)
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: