linux serial buffer question

Is there an easy way to increase my receive serial buffer in linux? It looks like it's currently set at 4096 bytes. I'm using pyserial + python and would like to read larger chunks than this at one time.

Thanks for any help,

-es

Reply to
Eric Spaulding
Loading thread data ...

You'd have to rebuild the kernel after modifying the sources to the tty line discipline module.

Right. The last time I looked it's set to one page. On IA32 that's 4K.

Why not wrap the read() method in three lines of python to keep calling read() until you get the desired amount of data? Just subclass the serial port object, override the read() method with a loop that calls the super's read.

--
Grant Edwards                   grante             Yow!  I'd like some JUNK
                                  at               FOOD... and then I want to
                               visi.com            be ALONE --
Reply to
Grant Edwards

I don't know, 3 lines sounds like an awful lot *grin*.

Ok, I'll work with what I've got. Thanks!

Grant Edwards wrote:

Reply to
Eric Spaulding

[...]

There is one case where my suggestion isn't a substitute for larger buffers. If the data is being sent when your application ready for it (it isn't calling read()), you would need larger buffers to prevent data loss or flow-control kicking in.

--
Grant Edwards                   grante             Yow!  This is a NO-FRILLS
                                  at               flight -- hold th' CANADIAN
                               visi.com            BACON!!
Reply to
Grant Edwards

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.