On Tue, Dec 02, 2003 at 10:59:17PM +0800, Zheng Hao wrote:
> help:How to change the attribute of the serial port in embedded linux?
>
> When I tried to change the attibute of the serial port in embedded linux
> with the function tcgetattr() and tcsetattr(), I found that they didn't work,
> although the return of these two functions were both '0', i.e. success.
> Another problem. In the linux on PC, I can read all the message in the
> buffer of serial port with the function read() only once, and it returns the
> number of the characters in the buffer. But when I read the message in
> embedded linux, it always stops when it encounters <enter> or <space>, and I
> can just get part of the message, and don't know exactly the number of
> characters in the buffer.
> For example, suppose the string in the buffer is
> "abcd<enter>efgh<space>ijk". When on PC , after using the function read(), I
> can get the whole string and the number 13 (11 letters and a <enter> and a
> <space>). But in embedded linux, I can only get the string "abcd" and the
> number 4 with one read(). Read() again, I can get "efgh" and the number 4.
> Again and again, I can get "ijk" and number 3. Again and again and again, I
> will get "abcd" and number 4 again. Then it repeats.
> What I want is that the serial port in embedded linux can perform as the
> one in the linux on PC, i.e., I can read all the message and get the exact
> number with one read().
> Can you tell me how to do?
> I use PXA250, linux kernel 2.4.18,patch-2.4.18-rmk6 patches by Russell
> King and diff-2.4.18-rmk6-pxa2 by Nicolas Pitre
No idea. The tty subsystem which handles this is unmodified. I'm
not aware of anyone else seeing this behaviour.
BTW, I don't consider my kernels to be "embedded linux" - they're
full blown Linux. Therefore, it's a misrepresentation. Please
don't refer to them as "embedded linux".
-------------------------------------------------------------------
Subscription options: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ/Etiquette: http://www.arm.linux.org.uk/armlinux/mailinglists.php
|