问题描述
您好,
Ia ??使用手持设备与Windows服务进行通信
串口。
设备之间的交易我的应用程序如下:
握手:
设备发送ENQ
服务响应DLE 0
设备发送DLESOH4168840000SR01L01DLEETX4 ??
正如您在字符串末尾看到的那样,在DLE ETX(数据链接转义和结束
文本)控制之后代码,设备发送另外两个字符4 ??。
如果我没有误会,这将是这个
字符串的CRC校验和的计算。
每次交易后,我需要计算CRC并与
设备发送的CRC进行比较。只是为了确保我们没有错过任何数据。
我尝试了很多不同的方法,但是我们没有想出正确的算法来
得到4 ??在这个字符串上。
有人可以帮我一个吗?
谢谢
Hello,
Ia??m working with handheld device that communicates with windows service thru
the serial port.
Transaction between device and my application looks like this:
Handshaking:
Device sends ENQ
Service responds DLE 0
Device sends DLESOH4168840000SR01L01DLEETX4??
As you see at the end of the string, after DLE ETX (Data Link escape and end
of text) control codes, device sends two more characters 4??.
If Ia??m not mistaking, this would be the calculation of CRC checksum of this
string.
After each transaction, I need to calculate CRC and compare to the one that
device sends. Just to make sure that we didna??t miss any data.
I tried many different ways, but cana??t come up with the correct algorithm to
get 4?? on this string.
Is anybody can give me a hand on this one?
Thanks
推荐答案
这篇关于CRC校验和算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!