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

Qt Code:
  1. if (sum(bytes) & 0xFF) != 0:
  2. print('Bad checksum!')
  3. raise StopIteration
To copy to clipboard, switch view to plain text mode