Ok, found it.
Code:
def checksum(data):
# group the data by word, little endian
data_list = []
for t in range(10):
data_list.append( data[2*t] + (data[2*t+1]<<8) )
# compute the checksum.
chk32 = 0
for data in data_list:
chk32 = (chk32 << 1) + data
# return a value wrapped around on 15bits, and truncated to still fit into 15 bits
checksum = (chk32 & 0x7FFF) + ( chk32 >> 15 ) # wrap around to fit into 15 bits
checksum = checksum & 0x7FFF # truncate to 15 bits
return int( checksum )
This is implemented and tested in the last version of the code here : https://github.com/Xevel/NXV11
(package attached for your convenience)
Bookmarks