jiuzhuaxiong / qextserialport

Automatically exported from code.google.com/p/qextserialport
Other
0 stars 0 forks source link

Higher baud rate on linux machine #100

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I am connecting a microcontroller with an ft232 usb to serial to an overo 
gumstix board and I need a higher baud rate. I need more than 115200. 230400 
would be fine. I have just hacked the posix_qextserialport.cpp and 
qextserialport.h files and it works great.

You could use:

.#else
.                Settings.BaudRate=baudRate;
.#endif
.                break;
.
.            case BAUD128000:
#ifndef B230400
            case BAUD230400:
#endif
.            case BAUD256000:
.                Settings.BaudRate=BAUD115200;
.                break;

And:

#ifdef B230400
            /*230400 baud*/
            case BAUD230400:
#ifdef CBAUD
                Posix_CommConfig.c_cflag&=(~CBAUD);
                Posix_CommConfig.c_cflag|=B230400;
#else
                cfsetispeed(&Posix_CommConfig, B230400);
                cfsetospeed(&Posix_CommConfig, B230400);
#endif
                break;
#endif

So that it the system does not support 230400 bauds it will not reclaim.

Thanks for your time and for the good work!

Original issue reported on code.google.com by lcasa...@gmail.com on 2 Jul 2011 at 3:25

GoogleCodeExporter commented 8 years ago
maybe we need an mechanism to support custom baudrate.

any suggestion?

Original comment by dbzhang...@gmail.com on 10 Nov 2011 at 2:48

GoogleCodeExporter commented 8 years ago

Original comment by dbzhang...@gmail.com on 16 Mar 2012 at 8:25