打印

本人做xmodem协议,出了莫名问题

[复制链接]
2220|1
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
ruigeyun|  楼主 | 2011-11-22 15:01 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
单片机发送数据到PC,window xp 超级终端启动xmodem,接收数据,生成文件。
  xmodem协议上规定,不满128字符的最后那个数据包,用0x1A填充满。填充的0x1A字符,将不会被读到
xmodem生成的文件,但是,我得到的文件的结尾,却尽是0x1A!!!
    我得到的文件的数据如下图
    请各位大侠指教 谢谢!

444.jpg (117.29 KB )

444.jpg

相关帖子

沙发
dengm| | 2011-11-22 15:38 | 只看该作者
xmodem 协议并不包括文件长度.  

ref: http://www.techheap.com/communication/modems/xmodem.html

The file was marked "complete" with a <EOT> character sent after the last block. This character was not in a packet, but sent alone as a single byte. Since the file length was not sent as part of the protocol, the last packet was padded out with a "known character" that could be dropped. In the original specification this defaulted to <SUB> or 26 decimal, which CP/M used as the end-of-file marker inside its own disk format. The standard suggested any character could be used for padding, but there was no way for it to be changed within the protocol itself – if an implementation changed the padding character, only clients using the same implementation would correctly interpret the new padding character.

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

0

主题

14

帖子

1

粉丝