Dear all,
i have the problem with checksum generate array data.
This is a sample piece of my program
Code:
unsigned char data1[3];
unsigned char data2[4]={0x7F,0xA0,0x00,0x00};
void send(unsigned char *a, unsigned char b, unsigned char *b){
//I do not know what program should i write
// in this modular, i want to display result of checksum
}
//main program
//call the modular of send
send(data1, 0x33, data2); //
//end of main program
so, how to generate checksum data in modular send?
i want to generate checksum data from array data1, array data2 and 0x33
note : i want to use XOR for checksum the data.
checksum in other words in this case is error detection.
error detection is generated by "exclusive-OR" all bytes data.
give me advice
many thanks