home *** CD-ROM | disk | FTP | other *** search
- #include <conio.h>
- #include <stdio.h>
- #include <process.h>
- #include <iostream.h>
- #include "warpcomm.hpp"
-
- int main(void)
- {
- char ch=0, ch2=0;
- clrscr();
- cout << "A simple terminal program for Warp-Comm (Ctrl-C to exit)\r\n\n";
-
- remote.open(2400, 4, 0x3F8, 2000, 2000);
- // opens the com port at 2400 baud, IRQ 4, base address 3F8 (hex) with
- // 2000 byte transmit and receive buffers
-
- while(ch != 3) {
- if(kbhit()) { // checks for a keypress
- ch=getch(); // gets a keypress
- remote << ch; // sends a character to the com port
- }
- if(remote.char_waiting()) {
- // checks to see if a character is waiting at the com port
-
- remote >> ch2; // gets a character from the com port
- putch(ch2); // outputs the character onto the screen
- }
- }
- remote.close(); // closes the com port
- exit(0); // exits with errorlevel 0
- }
-