hswqs
驱动小牛
驱动小牛
  • 注册日期2001-03-27
  • 最后登录2012-03-31
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望2点
  • 贡献值0点
  • 好评度2点
  • 原创分0分
  • 专家分0分
阅读:1797回复:3

请帮忙确定一下

楼主#
更多 发布于:2002-03-20 14:00
有一段英文,是求校验和的,如下:
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;

游客

返回顶部