windows 是否可以通过串口通过 PuTTY 发送文本文件的内容?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/30826002/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Is it possible to send the content of text file over PuTTY over a serial port?
提问by jliu83
I'd like to send the text content of a file over the serial port, over PuTTY. I know that extensions exists such as Xmodem and Zmodem, but they all use some checksum protocols to confirm that a file is sent over the port.
我想通过 PuTTY 通过串行端口发送文件的文本内容。我知道存在 Xmodem 和 Zmodem 等扩展,但它们都使用一些校验和协议来确认文件是通过端口发送的。
However, my requirements are more simple. I'd like to simply send a bunch of text (in a file) over the serial port in Windows (under Linux this would be must more simple), but my preferred terminal program is PuTTY. Is this possible? Is there another terminal program that has this type of feature built it?
但是,我的要求更简单。我想简单地通过 Windows 中的串行端口发送一堆文本(在一个文件中)(在 Linux 下这必须更简单),但我首选的终端程序是 PuTTY。这可能吗?是否有另一个具有此类功能的终端程序构建了它?
回答by Martin Prikryl
Use Plink (a command-line connection tool from PuTTY suite). It's a console application intended to automate connection tasks, like yours. Being a console application, you can redirect its input from a text file:
使用 Plink(PuTTY 套件中的命令行连接工具)。这是一个控制台应用程序,旨在自动化连接任务,就像你的一样。作为控制台应用程序,您可以从文本文件重定向其输入:
plink.exe -serial -sercfg ... < input.txt
See Using the command-line connection tool Plink
See also related How to execute remote command using PuTTY over Telnet.
另请参阅相关的如何使用 PuTTY 通过 Telnet 执行远程命令。