DM> Depends on your OS. For example, under Linux, OS/2, and likely Win32,
DM> fopen would work. Under DOS, however, you need to either get a com
DM> port library, learn how to use a FOSSIL, or learn
GD> how to deal with the
DM> serial port on a low level (via outportb/inportb).
GD> Not so. The following works just fine under DOS:
GD> void offhook( void )
GD> {
GD> FILE *port ;
GD> port = fopen( "COM1", "w" );
GD> fprintf( port, "ATM0H1\n" );
GD> fclose( port );
GD> }
I'm not sure - I tried it with various compilers, not all of them liked it.
It worked in some situations, not others. Other OS's, however, force support
of this method.
---
---------------
* Origin: Tanktalus' Tower BBS (1:250/102)
|