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

[复制链接]
 楼主| ruigeyun 发表于 2011-11-22 15:01 | 显示全部楼层 |阅读模式
单片机发送数据到PC,window xp 超级终端启动xmodem,接收数据,生成文件。
  xmodem协议上规定,不满128字符的最后那个数据包,用0x1A填充满。填充的0x1A字符,将不会被读到
xmodem生成的文件,但是,我得到的文件的结尾,却尽是0x1A!!!
    我得到的文件的数据如下图
    请各位大侠指教 谢谢!

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
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

粉丝
快速回复 在线客服 返回列表 返回顶部