ts-7000
[Top] [All Lists]

Re: [ts-7000] Re: TS7200 COM2 - ttyAM1 Issues

To:
Subject: Re: [ts-7000] Re: TS7200 COM2 - ttyAM1 Issues
From: Donal <>
Date: Thu, 5 Feb 2009 13:40:15 +0000
Could try adding \x0D to end of string being sent back.

On Thu, Feb 5, 2009 at 1:38 PM, bonjelo2000 <> wrote:

OK,

I found some dumb mistakes in coding. I tested with Hyperterminal on
another computer and could see write command work. Read appeared to
work but required I hit the enter key when in Hyperterminal.

When connecting back to device the write command works but I hang
when attempting to read. I must have one of the c_cflag parameters
sent wrong.

Any help is appreciated



--- In ts-7000%40yahoogroups.com, "bonjelo2000" <> wrote:
>
>
> Hi,
>
> I am attempting to communicate with a device.
>
> I use the folowing write and read commands. The write appears to
work
> in that the device responds correctly to the appropriate command
sent.
> The read command always returns a -1.
>
> i=write(fd_com,cSendBuf,iSendLen);
>
> sleep(1);
>
> iReturnLen=read(fd_com,cRecBuf,6);
>
>
> int comm_init ()
> {
> struct termios termConf;
> bzero (&termConf, sizeof (struct termios));
>
> tcgetattr(fd_com, &termConf);
>
> termConf.c_cflag = B38400 | CREAD | CLOCAL;
> termConf.c_cflag |= PARENB;
> termConf.c_cflag &= ~PARODD;
> termConf.c_cflag &= ~CSIZE;
> termConf.c_cflag |= CS8;
> termConf.c_cflag |= CRTSCTS;
>
> fd_com = open(PORT, O_RDWR | O_NOCTTY | O_NDELAY);
> if (fd_com < 0)
> {
> return FAILURE;
> }
>
> tcsetattr(fd_com, TCSADRAIN, &termConf); // Set the new
options for
> the port...
>
> return SUCCESS;
> }
>
>
>
> -----------------------------------------------------
> So what are you trying to do?
>
> I don't understand what you mean by "read commands"?
>
> did you write a program to use COM2, or are you trying to use
> it as a login port?
>




__._,_.___


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