in reply to Spoof /dev/ttyS0
I've done something like this a long time ago to fool a DosEMU emulated app into thinking I had a real modem, I just can't recall the exact details but it worked by hooking your perl "emulator" to /dev/pty(a..z)(0..9) (pick one). This enables the pty's slave device on /dev/tty(a..z)(0..9).
Different *nixes implement pseudo-terms differently, apparently on MacOS it's possible to have a /dev/ttyS0 backed by a /dev/ptyS0 but not entirely sure on that, it's been a while :)
Anyhow, you can read/write to the pty from your perl script, and anything that goes there ends up on the corresponding slave term where the application you're testing can read/write from it, thinking you've got a network device behind it.
As long as you can properly "emulate" things, it shouldn't be a problem.
(It is, however, probably not the nicest way to do this)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Spoof /dev/ttyS0
by akujbida (Acolyte) on Sep 25, 2008 at 06:21 UTC | |
by MadCat (Initiate) on Sep 26, 2008 at 18:51 UTC | |
by Anonymous Monk on Sep 27, 2008 at 17:01 UTC |