On Tue, Mar 29, 2016 at 12:26 PM, Muni Sekhar <munisekharrms@xxxxxxxxx> wrote: > On Tue, Mar 29, 2016 at 4:36 AM, Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx> wrote: >> On Mon, Mar 28, 2016 at 11:11:26PM +0530, Muni Sekhar wrote: >>> Hi All, >>> >>> >>> >>> I would like to know is there any user mode test application source >>> code(in C language) available to test the serial port in Linux ? >>> >>> >>> >>> Basically I need to get the following things. >>> >>> >>> >>> Open the Serial interface (/dev/ttyn) >>> Set the Baud rate(does it calls tty_operations -> set_termios()?) >>> Close the Serial interface(/dev/ttyn) >>> >>> >>> >>> Step1 & Step3 are simple by calling open() & close(), but I don’t know >>> how to set the baud rate, is there any API for this? >>> >>> >>> >>> Later I will extend this program to issue various commands over this >>> serial interface. >> >> Have you searched for how to program a serial port on Linux? There is a >> whole TODO written many years ago that answers these questions for >> you... >> >> good luck! >> >> greg k-h > > Thanks Greg, I found the useful information in the below mentioned link. > > http://www.tldp.org/HOWTO/Serial-Programming-HOWTO/index.html > > > > -- > Thanks, > Sekhar We are having customized serial port driver, it always sets the baud to 9600 (by configuring UART BAUD_RATE register) on device file open, but not updating the termios structure. The python code(pySerial) reads the termios parameter for baud rate and only sets the baud rate if it needs to. So pySerial fails to work with this driver. Is there any kernel API to update termios structure about 9600 baud on driver device open? -- Thanks, Sekhar -- To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html