共享串口(Modem协议+拨号器)
我想使用此代码通过 Xmodem 发送档案: http:// www.java2s.com/Code/Java/Network-Protocol/JModemsimpcommunicationsprogram.htm
在本例中,我想在两台计算机之间建立拨号连接并发送二进制文件。 但此代码不允许我在设置端口之后和传输文件之前设置要拨打的电话号码。 有没有办法与拨打电话号码的其他应用程序共享端口?
I wanted to use this code to send archives with Xmodem: http://www.java2s.com/Code/Java/Network-Protocol/JModemsimplecommunicationsprogram.htm
In this case, I want to establish a dialup connection between two computers and send a binary file. But this code doesn't let me set a phone number to dial after i setup the port and before I transfer the file. Is there any way of sharing the port with another application that dials the phone number?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
连接串行端口后,您不能通过串行线路发送普通的老式调制解调器命令吗?
所以,
连接后,发送 ATDT,后跟电话号码。
然后等待“连接”响应字符串(或错误响应)。
然后发送文件。
请参阅:http://en.wikipedia.org/wiki/Hayes_command_set
Can't you just send the plain old modem commands over the serial line after connecting the serial port ?
So,
after you connect, send ATDT followed by the telephone number.
Then wait for the "connect" response string (or error responses).
Then send the file.
See: http://en.wikipedia.org/wiki/Hayes_command_set
如果您不想修改 JModem 程序,那么为什么不使用提供您需要的所有功能的成熟通信程序呢? (过去有很多,但现在想到的是克米特)。 这比尝试让两个不同的程序一起工作要容易得多。
如果您是Java程序员,那么按照RoccoD的建议,修改JModem代码来拨打号码。
If you don't want to modify the JModem program, then why not use a full-fledged comm program that provides all the features you need? (There used to be a ton of them, but the one that comes to mind right now is kermit). This would be easier than trying to get two different programs to work together.
If you are a Java programmer, then follow RoccoD's suggestion and modify the JModem code to dial a number.
在unix或linux中这不是问题——只需由所有程序同时打开串行端口即可。 您也可以使用聊天或期待。
在 Windows 中,您需要多路复用数据流的服务器
In unix or linux it's not a problem - simply open serial port by all programs simultaneously. also You can use chat or expect.
in windows You need server which will multiplex data-streams