ph0 and ph1 problems
Vernon C. Hoxie
vern at zebra.UUCP
Tue Jun 20 02:23:37 AEST 1989
Hi, I'm back again for help in using the 'ph0' and 'ph1' in a program.
I did get a lot of suggestions on how to work with 'phtoggle(undoc)' and
seem to have some of the problems with that "usable".
My program has progressed to the point that when I have the system
configured as a single line, it works OK. But when I set the system to
a two line configuration ( from the Install/Hardware Setup/Phones
window. ), I can't get the 'ph1' to 'read(2)'.
To reiterate:
Configuration: Line 1, Voice and Data.
1. 'myprogram ph0'
a. open( "/dev/ph0", O_RDWR | O_NDELAY );
b. sense line status with 'ioctl( tiofd, PIOCGETP, &myupdata )'
c. phtoggle( 1 );
d. repeat (a.)
e. dump 'uugetty' ( with a modified implementation of
John Milton's 'setgetty(1)' ).
f. dial the phone with 'ioctl( tiofd, PIOCDIAL, phnum )'
g. wait for 'ioctl ( tiofd, PIOCGETP, &thisupdata )'
h. get MODEMCONNECTED.
i. read in data with 'read(2)'
j. hang up with 'ioctl( tiofd, PIOCDISC, &oldupdata )'
k. close tiofd
l. toggle back to VOICE.
m. restart 'uugetty'
n. unlink LCK..ph0
o. exit( 0 )
2. 'myprogram ph1'
Same as above except omit steps c, d, and l. I'm not sure that
this should work since 'Line 2' is not active according to the
"Install" settings. In fact, it works great.
3. 'myprogram tty000'
Similar sequence that works fine.
Configuration: Line 1 'VOICE', Line 2 'DATA'
1. 'myprogram ph0'
Same sequence as above but 'phtoggle(undoc)' sets Line 2 to
VOICE and subsequent tests fail and the program fails after
re-setting Line 1 to VOICE and Line 2 to DATA. This is pretty
much as expected. It would be nice if I could toggle line 1 to
data if the OBM was not in use.
2. 'myprogram ph1'
Same sequence as above. It progresses fine to the point at
which it is to read in data. It just sits there until a timeout
trap aborts 'myprogram' and rests the files etc. I have tried
various configurations of the 'termio (7)', 'fcntl( tiofd, O_RDWR )'
'close(open ( "/dev/ph1", O_RDWR )' etc. Why does this work
when the line is not selected for DATA but doesn't work when
it is?? I have also tried shutting the machine off and rebooting
in case some of testing has left it confused.
3. 'myprogran tty000'
Works great as before.
In the header file <sys/phone.h>, there are several ioctl commands which
aren't given in the manual under PHONE(7). In particular,
"PIOCLINESEL" seems intriguing. All I can get it to do however is to
give "Bad Address" error messages. Any suggestions are welcome.
I appreciate all the help from my previous plea and my thanks to all who
responded. I tried sending e-mail responses but some of them bounced.
If you didn't a "Thank You", please accept this generic note of
appreciation.
vern-
--
Vernon C. Hoxie {ncar,nbires,boulder,isis}!scicom!zebra!vern
3975 W. 29th Ave. voice: 303-477-1780
Denver, Colo., 80212 ( TB+ ) uucp: 303-455-2670
More information about the Unix-pc.general
mailing list