如何通过 minicom 或 screen 与 pty 通信?
我试图在某些硬件周围提供类似 AT/调制解调器的接口。 在这篇帖子之后,我让服务器使用 openpty() 设置 pty。
现在,我可以通过客户端应用程序按预期与服务器进行通信,该客户端应用程序打开从站并通过 read() 和 write() 调用进行通信。
不过,我还希望能够使用 screen 命令或 minicom 手动向从机发出命令。然而,在尝试执行此操作时,服务器似乎从未收到任何数据。这种方法中我缺少什么重要的东西吗?
I am trying to provide an AT/Modem-like interface around some hardware.
Follwing this post I have the server setting up a pty using openpty().
Now I can communicate with the server as expected with a client app that open the slave and communicates via read() and write() calls.
However I would also like to be able to use either the screen command or minicom to issue commands by hand to the slave. However the server never seems to receive any data when trying to do this. Is there something significant I am missing with this approach?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
因此,客户端应用程序可以与硬件配合使用,但 minicom 则不能。客户端应用程序很可能正确设置了波特率和停止位数(至少是那些),并且您没有要求 minicom 执行相同的操作。您需要正确设置这些设置。
So the client app works with the hardware, but minicom does not. Very likely the client app is properly setting the baud rate and number of stop bits (at least those), and you haven't asked minicom to do the same. You need to get those settings right.