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)
In reply to Re: Spoof /dev/ttyS0
by MadCat
in thread Spoof /dev/ttyS0
by akujbida
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |