阅读:1829回复:3
请帮忙确定一下
有一段英文,是求校验和的,如下:
The last byte in the 250-byte block represents a checksum value for the entire 250-byte block of data. The checksum value for each 250-byte block is determined by the binary addition of the first 249 bytes and the subsequent subtraction of the sum from AA(hex). 其校验和的求法是否如下所似,请帮忙确认一下。 BYTE checksum = 0; for ( int i=1; i<=249; i++) { checksum += data; //data[251]为存放250个BYTE数据的数组 } checksum = 0xAA - checksum; |
|
沙发#
发布于:2002-03-20 14:54
i think you are right!
|
|
|
板凳#
发布于:2002-04-13 01:01
You must be right!
|
|
地板#
发布于:2002-04-20 23:26
我认为是:一帧数据总共有250个字节组成,头249个是有效数据,最后一个字节是校验和,该校验和是由头249个有效数据决定的,该例中,校验和为0XAA
|
|