Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 08 Jan 2005 11:38:23 -0800
From:      Brandon Fosdick <bfoz@bfoz.net>
To:        "M. Warner Losh" <imp@bsdimp.com>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: ucom and sio
Message-ID:  <41E036AF.2030407@bfoz.net>
In-Reply-To: <20050102.220156.79545944.imp@bsdimp.com>
References:  <40170.4.248.235.201.1104333403.squirrel@4.248.235.201> <20050102.220156.79545944.imp@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
M. Warner Losh wrote:
> In message: <40170.4.248.235.201.1104333403.squirrel@4.248.235.201>
>             "Brandon Fosdick" <bfoz@bfoz.net> writes:
> : Judging from the man page, ucom is limited to acting like a tty with no
> : support for sio. Is this true? Is there some magic config bit somewhere
> : that will enable hidden sio support?
> 
> Ummm, I don't know what you are asking here.  ucom supports all the
> rs232 stuff w/o problem.  I use it all the time with my phone to dial
> into the network.

Well, then I must be doing something wrong. The man page for ucom would 
seem to indicate that it is tty only...

      "The ucom driver attaches to USB modems, serial ports, and other 
devices that need to look like a tty.  The ucom driver shows a behavior 
like a tty(4).  This means that normal programs such as tip(1) or 
pppd(8) can be used to access the device."

If I use tip it works fine. But if I try to write a C program that opens 
the device it hangs on open, unless I set it to non-blocking. Then open 
returns and I set it back to blocking then try a read or a write. read() 
blocks regardless of whether any data has been sent by the other device 
(a terminal app on my palm pilot for debugging purposes) and write() 
blocks without sending anything. If I set the device to be non-blocking 
read() will return the data that was sent by the other device, but 
write() will still block.

Oddly, I get the same behavior on my powerbook, so I thought the adapter 
was defective. But it works with terminal apps on freebsd, osx and 
windows, so I'm pretty sure its working. I have no idea what I'm doing 
wrong though. Once I figure out where I put the code for this thing I'll 
send the test program I've been using. I always seem to lose something 
when I travel...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?41E036AF.2030407>