我的英文不好,这是从英文资料中复制下来的,我现在要生成这个值,大家帮我看看呀
Checksum Byte
The last byte of each message is a checksum.This is a one-byte longitudianl redundancy check(LRC).
It is calculated sa the bit wise exclusive-OR of all the message bytes ,including the message delimiters(STX,ETX)and the address.
The bit wise exclusive-OR function can be calculate by writing the binary value of all the concerned bytes beneath each other and then performing a modulo-2 addition on each column,thus without carry propagation(see examples)
Checksum Byte
The last byte of each message is a checksum.This is a one-byte longitudianl redundancy check(LRC).
It is calculated sa the bit wise exclusive-OR of all the message bytes ,including the message delimiters(STX,ETX)and the address.
The bit wise exclusive-OR function can be calculate by writing the binary value of all the concerned bytes beneath each other and then performing a modulo-2 addition on each column,thus without carry propagation(see examples)
解决方案 »
- 写一半透明窗口//在无编译环境下运行,窗口无法显示什么原因?
- 求助,大家都知道 CStatic 控件创建有两步,第一步,new 一个CStatic ,第二步 用Create 函数连接对象,那么假设我做过一遍,当我第二次用CStatic时,怎么判断这个对象已经被连接Create出来的对象
- 严重抗议当前一些网站的恶劣做法!
- 如何实现模糊查询?我新建了一个类CRecordSet的对象。
- 敬请赐教ODBC问题!
- 高分求离线浏览器的源码,或提供下载
- 这里高手多,问一个关于WEB浏览方面很难的问题?
- 坐标系的难题
- 请教各位,问一个关于类型转换的问题,急!
- 求几个库文件 zlib.lib libjpeg.lib libpng.lib
- $$$$高分求送程序$$$$
- 怎么判断 char c[120]={0},c还没有被赋予其他的值?
效验码
函 数 名:GetLRC
功 能:计算效验码LRC
入 参:cDataForLRC—要效验的字符串;
cLRC—效验码;iLen—要效验的字节数
出 参:cLRC—效验码
返 回 值:无;
*********************************************/
void GetLRC(char *cDataForLRC, char *cLRC,int iLen)
{
*cLRC=0x00;
for(DWORD i=0;i<(unsigned)iLen;i++)
*cLRC=*cLRC^cDataForLRC[i];
return ;
}