debita
debita

Reputation:

Sharing serial port (Modem protocol + dialer)

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?

Upvotes: 1

Views: 1662

Answers (3)

vitaly.v.ch
vitaly.v.ch

Reputation: 2532

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

Upvotes: 0

jdigital
jdigital

Reputation: 12286

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.

Upvotes: 1

RoccoD
RoccoD

Reputation: 118

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

Upvotes: 2

Related Questions