NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Writing data to serial device failed



Steven Bellovin <smb%cs.columbia.edu@localhost> wrote:

>
> On Jan 26, 2011, at 5:44 10PM, David Young wrote:
>
> > On Wed, Jan 26, 2011 at 11:06:28PM +0100, Volker Wolfram wrote:
> >> Hi all,
> >> 
> >> Google helps me not further. I use this litte program to switch on a LED
> >> on a USB-I2C adapter. This sample code works not.              
> > *snip snip*
> >>            err = write(fd,"\5a\x10\x0e\x00",4);
> > 
> > Do you mean to write {0x5a, 0x10, 0x0e, 0x00} ? Double-check that string
> > constant.
>
> That isn't what the string is, of course -- that first one is \5a rather than
> \x5a, so it's writing 0x05, 'a', 0x10, 0x0e, 0x00, which is 5 bytes long.
>
>
>               --Steve Bellovin, http://www.cs.columbia.edu/~smb
>
>
>
>
Hi all,

I'm so sorry about my mistake. Here is the correct string, but it has no effect 
to
the adapter. I'm using the DEVANTECH USB-I2C module. If you like, you can see 
the
full documentation on their website.

I've tried several programs to work with but on Windows it works fine, on 
NetBSD 5.1
all failed.

Regards,

Volker


Home | Main Index | Thread Index | Old Index