ts-7000
[Top] [All Lists]

Re: [ts-7000] Re: TSDIO Driver 1.0 Byte Write Problem

To:
Subject: Re: [ts-7000] Re: TSDIO Driver 1.0 Byte Write Problem
From: Jim Jackson <>
Date: Thu, 12 Jul 2007 13:11:02 +0100 (BST)


On Thu, 12 Jul 2007, beyoung1 wrote:

> echo -n produces the correct output. It looks like I was just sending a
> newline to the bytewide dio device when I omitted the -n.

You were sending all the characters in the variable, including the
terminating LF that 'echo' added. However the last character was the one
leave its impression behind :-)

> I was able to
> send 0-255 using the following string to the byte wide device
>
>  echo -n $OPTARG | awk '{printf("%c",$0)}'>/dev/tsdio/twriteall

O boy. Maybe we should have an obfuscated output competition :-)
sorry Bryan.

Maybe you could try this

  printf "%c" $OPTARG > /dev/tsdio/twriteall

to output _just_ the first character in the $OPTARG variable. It saves
the extra program invocation and the pipe.

Or if you can guarantee the $OPTARG _only_ has one character

  echo -n $OPTARG > /dev/tsdio/twriteall

is perfectly ok.

cheers
Jim


> --- In  "Rich Wilson" <> wrote:
> >
> > 0x0A looks a lot like a line feed (\n) to me.
> > Does echo -n work?
> > Rich
> >
> >
> > On 7/10/07, beyoung1 <> wrote:
> > >
> > >   Hello,
> > >
> > > I have successfully installed the tsdio device driver that is posted
> > > on the files section of this web site. I am currently using a TS-7250
> > > running the 2.4.26-ts11 kernel.
> > >
> > > All of the single bit read and write command are working correctly and
> > > I can control individual LEDs tied to the ports. My current problem is
> > > that writes to the bytewide device /dev/tsdio/twriteall returns a 0x0A
> > > to the DIO port. Any ascii charters sent using echo...
> > >
> > > echo 0 > /dev/tsdio/twriteall DIO output = 0x0A
> > > echo 255 > /dev/tsdio/twriteall DIO output = 0x0A
> > >
> > > produce the same results.
> > >
> > > I can still controll all of the pins on the port with the...
> > >
> > > echo 1 > /dev/tsdia/twrite0
> > > echo 0 > /dev/tsdia/twrite0
> > >
> > > I have also tried making my own device...
> > >
> > > mknod /dev/leds c 238 153
> > >
> > > but get the exact same results.
> > >
> > > There are no examples of how to read or write the full 8bit device in
> > > the readme file.
> > >
> > > What am I doing wrong when writing to the full 8bits of the character
> > > device?
> > >
> > > --Bryan
> > >
> > >
> > >
> >
> >
> >
> > --
> > Rich Wilson
> > 
> >
>
>
>


 
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