ts-7000
[Top] [All Lists]

Re: [ts-7000] com 3 in 7800

To:
Subject: Re: [ts-7000] com 3 in 7800
From: "Eric Robishaw" <>
Date: Wed, 13 Aug 2008 11:48:05 -0500
You might want to look at the microterm.c example in the files section of this yahoo group:
http://tech.groups.yahoo.com/group/ts-7000/files/
look for "microterm.c"

Eric


On Wed, Aug 13, 2008 at 11:40 AM, vigu <> wrote:

thanks a lot .. but when i read data it returned me -1. is there
something wrong in what i'm doing. i'm sorry am very new to serial
programming. here is the code

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

int initComm() {

int fd;
struct termios options;

// Open the RS232 port
fd = open("/dev/ttts4", O_RDWR | O_NOCTTY );
if(fd == -1) {
#ifdef DEBUG
printf("Could not open the comm port.\r\n");
#endif
return fd;
}

// Clear the flags
fcntl(fd, F_SETFL, 0);

// Get the port options
tcgetattr(fd, &options);
// Set the speed
cfsetispeed(&options, B9600);
cfsetospeed(&options, B9600);

// Set the comm flags (115200 8N1)
options.c_cflag = B9600 | CS8 | CLOCAL | CREAD;
options.c_iflag = 0;
options.c_oflag = 0;
options.c_lflag = 0;

// Set the timeout to be 1000ms
options.c_cc[VMIN] = 0;
options.c_cc[VTIME] = 10;

// Save these settings
tcsetattr(fd, TCSANOW, &options);

// Flush the settings
tcflush(fd, TCIFLUSH);
tcflush(fd, TCOFLUSH);

return fd;

}


__._,_.___

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: =Email Delivery: Digest | m("yahoogroups.com?subject","ts-7000-fullfeatured");=Change Delivery Format: Fully Featured">Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | =Unsubscribe

__,_._,___
<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