Date: Thu, 4 Nov 1999 13:18:05 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Surahyo cc: djgpp AT delorie DOT com Subject: Re: Need help In-Reply-To: <4.1.19991104211819.00a243a0@mail.student.unimelb.edu.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Thu, 4 Nov 1999, Surahyo wrote: > Could you please send me any simple program > to send and receive data using RS-232 (DOS, PC). The following is UNTESTED: int main (void) { static char message[] = "$PASHQ,GGA"; char buf[80]; int c; /* Send the string to COM1. */ fwrite (message, 1, sizeof(message), stdaux); /* Read the first character of the response. */ c = getc (stdaux); /* Read 10 characters. */ fread (buf, 1, 10, stdaux); return 0; }