Path: utzoo!utgpu!watserv1!ria!uwovax.uwo.ca!thielen From: thielen@uwovax.uwo.ca Newsgroups: comp.lang.c Subject: Serial stuff Message-ID: <1991Feb20.094234.8643@uwovax.uwo.ca> Date: 20 Feb 91 14:42:34 GMT Lines: 40 I have been having a bunch of trouble reading the output from a very simple voice activator box attached to a serial line on my Sun 3/50. Now, I think I am just completely off base, but can't really fathom what else I should do. The code I am using is the following... and the program just sits in the fread command and never gets out of it. Any Ideas??? The code is here.. /* It's pretty simple stuff */ #include #include #include #define TRUE 1 #define FALSE 0 int size = 1; int nitems = 1; FILE *stream; char *buf; char input[10]; main() { if ((stream = fopen("/dev/ttya", "r")) == NULL){ printf("cannot open serial port \n"); exit(0); } setbuffer(stream,buf, size); fread( input, size, nitems, stream); fprintf("\nread character input %s", input); fclose(stream); } Any, suggestions, flames, whining would be greatly appreciated. Susan KJ Thielen Centre for Cognitive Science UWO