[erlang-questions] Erlang Reading/Writing /dev/modem?

Keith Irwin <>
Tue Apr 28 00:09:04 CEST 2009


Folks--
I'm interested in using Erlang to read from a modem device /dev/cu.usbmodem
so that I can then send whatever I read to another Erlang service running on
an Internet port.

I have a point-of-sale terminal plugged into a phone-simulator, which in
turn is plugged into an Apple USB Modem.

When I initiate a function on the POS, it dials up.

I send an "ATA" (and any other necessary init strings) to /dev/cu.usbmodem,
and the modem answers. I get a "CONNECT 1200" string, which tells me that
the connection is fine and established.

Then the POS machine "hangs up" and tries again.

Can I assume I can just read bytes from /dev/cu.usbmodem (as if it were a
file), and then do something with those bytes? Is the reason the POS is
hanging up is because nothing is sitting there reading from /dev/cu.usbmodem
except "cat"?

I have to admit, I really don't know what "usually" happens after modems
negotiate with one another.

I think Erlang is an excellent choice for working with this because of the
pattern matching, if nothing else.

Keith
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20090427/3d0a8535/attachment.html>


More information about the erlang-questions mailing list