Linux Usb Serial Programming

Programming

For my application, i wanted to communicate with SIM900 GSM module which was connected to my PC running Ubuntu OS. The SIM900 GSM module was connected to the PC using a CP2102 USB-UART bridge.Do remember that you need to select the right port code in the Array of ports in the library. If you dont find your port number listed there, you can add it by removing a existing entry, or even add a new one.For me the /dev/ttyUSB5 port entry was not present so i added it below in RS232.c, because my USB converter was enumerated as /dev/ttyUSB5.

Serial Communication In C

You can find yours and modify the array.In the demo code below you can see that i am sending the index value of the comports array list corresponding to my Port name.Thank you Teunis van Beelen:).

Posted :