Skip to content

Commit

Permalink
Worked on the analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
kodarn committed Jan 24, 2018
1 parent b7949c4 commit e07604a
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Samples/400-552-259/1-invalid/400-552-259.cu8

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions Samples/400-552-259/1-invalid/400-552-259.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@


Decoded stream for 400-552-259:
-------------------------------

0xaa, 0xaa, 0xaa, 0xaa, 0x5b, 0xfd, 0xdd, 0x79, 0xc5, 0xf1, 0xe2, 0xbb, 0x1e, 0x2d, 0xf6, 0x60, 0x81, 0x19, 0x03, 0x70, 0x60, 0xb9, 0x96, 0x3f, 0xdb, 0xf7



Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions Samples/400-565-321/400-565-321.cu8

Large diffs are not rendered by default.

36 changes: 36 additions & 0 deletions crc16/TI-crc16.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import sys

def culCalcCRC(crcData, crcReg):
CRC_POLY = 0x8005

for i in xrange(0, 8):
if ((((crcReg & 0x8000) >> 8) ^ (crcData & 0x80)) & 0xFFFF):
crcReg = (((crcReg << 1) & 0xFFFF) ^ CRC_POLY) & 0xFFFF
else:
crcReg = (crcReg << 1) & 0xFFFF
crcData = (crcData << 1) & 0xFF

return crcReg

def crc16(txtBuffer, expectedChksum):
CRC_INIT = 0xFFFF
checksum = CRC_INIT

hexarray = bytearray.fromhex(txtBuffer)
for i in hexarray:
checksum = culCalcCRC(i, checksum)

if checksum == int(expectedChksum, 16):
print "CRC OK"
return True
else:
print "CRC Fail. Expected=" + expectedChksum + " Calculated=" + str(hex(checksum))
return False

#
# Main
#
payload = "11431d070ea270e904cfbf737e47cfa334e0"
expectedCrc = "1204"
success = crc16(payload, expectedCrc)
print "Match" + success

0 comments on commit e07604a

Please sign in to comment.