Zizione
23rd January 2018, 16:53
Hellow guys,
I am doing a programm using QT. I have a intelHex file(.mcs) which stores bunch of lines with Hex type data. For now my programm reads 1st line of the file, parsing(if i correct) this and store into an QbyteArray object.
For example 1st line of the file is :":020000040010EA" and after compilation in my QbyteArray object i have this :"\x02\x00\x00\x04\x00\x10\xEA".
What my teacher said thats right. Now I need to calculet checksum for this bytes and send a message.
If it would help to understand what i need there is a python code what I am trying to do
if (sum(bytes) & 0xFF) != 0:
print('Bad checksum!')
raise StopIteration
I am doing a programm using QT. I have a intelHex file(.mcs) which stores bunch of lines with Hex type data. For now my programm reads 1st line of the file, parsing(if i correct) this and store into an QbyteArray object.
For example 1st line of the file is :":020000040010EA" and after compilation in my QbyteArray object i have this :"\x02\x00\x00\x04\x00\x10\xEA".
What my teacher said thats right. Now I need to calculet checksum for this bytes and send a message.
If it would help to understand what i need there is a python code what I am trying to do
if (sum(bytes) & 0xFF) != 0:
print('Bad checksum!')
raise StopIteration