Thread: Sending Data
View Single Post
  #3   Spotlight this post!  
Unread 10-09-2003, 13:11
Raven_Writer's Avatar
Raven_Writer Raven_Writer is offline
2004 Detroit & Pittsburgh Winners
AKA: Eric Hansen
FRC #0005 (RoboCards)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2002
Location: Melvindale
Posts: 1,549
Raven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really nice
Send a message via ICQ to Raven_Writer Send a message via AIM to Raven_Writer Send a message via MSN to Raven_Writer Send a message via Yahoo to Raven_Writer
Re: Re: Sending Data

Quote:
Originally posted by Brandon Martus
File Descriptor. I can't help with your actual question, though, .. sorry
Thanks Brandon I talked to Rob last night, and now I only need help on the last code section. read() = ReadFile(), write() = WriteFile().

<< Edit >>: The stuff below bolded is what I don't get:
Code:
int openSerial(char *port){
   struct termios tios;

   fd=open(port, O_NOCTTY | O_RDWR | O_NONBLOCK);
   if(fd<0){
     sprintf(lastError, "%s: %s\n", port, strerror(errno));
     return fd;
   }

   tios.c_cflag = BAUDRATE | CS8 | CREAD;
   tios.c_iflag = IGNPAR;
   tios.c_oflag=0;

   tios.c_lflag=0;

   //satisfy read immediately.
   tios.c_cc[VTIME]=0;
   tios.c_cc[VMIN]=0;

   tcflush(fd, TCIFLUSH);
   tcsetattr(fd, TCSANOW, &tios);

   return fd;
}
__________________
AIM: wisprmylastbreth
EMail: nightskywriter@gmail.com
Y!: synsoflife

"ai yoru ga" -- "Love the nights"

Last edited by Raven_Writer : 10-09-2003 at 16:02.