AVR
for (int i = 1; i < sp_dataLength; i++) {
sum += sp_recievedData[i];
}
for (int i = 1; i < sp_dataLength; i++) {
sum += sp_recievedData[i];
}
To copy to clipboard, switch view to plain text mode
Qt
for (int i = 0; i < sp_dataLength; i++) {
bytearray[0] = bytearray[0] + sp_ar_dataToSend[i];
}
for (int i = 0; i < sp_dataLength; i++) {
bytearray[0] = bytearray[0] + sp_ar_dataToSend[i];
}
To copy to clipboard, switch view to plain text mode
output
sp_recievedData[i] : 1, 10, 215, 35, 60
result sum: 65
result bytearray[0] : 65
bytearray[0] - is QByteArray same as dataToSend
1+10+215+35+60 = 321 - 256 = 65
May I ask you?
If so: why should I count it in integer if it is loss prevention protocol?
My question is replacement bytearray[0] by other variable, in QT, to operate BYTE. CHAR crush....
I can't say it other "clear" way.
Bookmarks