ts-7000
[Top] [All Lists]

[ts-7000] Com2 Problem TS-7250

To:
Subject: [ts-7000] Com2 Problem TS-7250
From: "cspin_2001" <>
Date: Tue, 06 Feb 2007 01:15:02 -0000
I am still getting up to speed on the TS-7260. I am trying to read a 
GPS data from the serial port. It reads the data from the first 
burst coming from the GPS (several messages). I get $GPSRMC and a 
few other messages and then it pauses for a while and then just 
keeps outputing "buff= ". I would like to read the stream 
continuosly. Any idea what is screwed up?

Thanks 
Charlie   




#include <fcntl.h>
#include <termios.h>
#include <stdio.h>

#define BAUDRATE B9600
#define MODEMDEVICE "/dev/ttyAM1"
#define _POSIX_SOURCE 1 /* POSIX compliant source */


main()
{
  int fd;
  struct termios oldtio,newtio;
  char buf[512];

  fd = open(MODEMDEVICE, O_RDWR | O_NOCTTY );
  if (fd <0) {perror(MODEMDEVICE); exit(-1); }
  tcgetattr(fd,&oldtio); /* save current serial port settings */
  bzero(&newtio, sizeof(newtio)); /* clear struct for new port 
settings */
  newtio.c_cflag = BAUDRATE | CRTSCTS | CS8 | CLOCAL | CREAD;
  newtio.c_iflag = IGNPAR | ICRNL;
  newtio.c_oflag = 0;
  newtio.c_lflag = ICANON;
  tcflush(fd, TCIFLUSH);
  tcsetattr(fd,TCSANOW,&newtio);


  while (1)
    {
    read(fd,buf,512);
    printf("buf = %s\n" ,buf);
    }

  tcsetattr(fd,TCSANOW,&oldtio);  // restore the old port settings
}




 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU