Hello, I am trying to wrtie a program in Ubuntu where, throught the console, I can read and write a serial port. So I have started using the qextserialport library. I found code online and tried to emulate it to make a simple test to see if I can get the program to merely connect to the serial port. But alas my program does not seem to be connecting. And I am at a loss for why it won't open the port. Here is my code

Qt Code:
  1. #include <QtCore/QCoreApplication>
  2. #include <3rdparty/qextserialport/src/qextserialport.h>
  3. #include <iostream>
  4. #include <qiodevice.h>
  5. using namespace std;
  6. int main(int argc, char *argv[])
  7. {
  8. QCoreApplication a(argc, argv);
  9. const char data[]= "e";
  10. QextSerialPort * port = new QextSerialPort("/dev/ttyUSB0");
  11. port->setBaudRate(BAUD115200);
  12. port->setFlowControl(FLOW_OFF);
  13. port->setParity(PAR_NONE);
  14. port->setDataBits(DATA_8);
  15. port->setStopBits(STOP_1);
  16. port->setTimeout(10);
  17. bool res = false;
  18. res = port->open(QIODevice::ReadWrite | QIODevice::Unbuffered);
  19.  
  20. if(res)
  21. {
  22. cout << "Opened" << endl;
  23. char i = port->write(data);
  24. }
  25. else
  26. {
  27. cout << "Failed to connect" << endl;
  28. }
  29. return a.exec();
  30. }
To copy to clipboard, switch view to plain text mode 
The console that is opened always displays "Failed to connect"
Can anyone see any very obvious erros?

Thanks
-Jvwlong