Results 1 to 3 of 3

Thread: setting port in qexserialport

  1. #1
    Join Date
    Apr 2009
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default setting port in qexserialport

    Hey everybody,

    just got a question if anyone noticed similar problem to mine...

    im using qt 4.5 with qexserialport 1.2 alpha

    got a device connected to USB Serial Port (FTDI)

    I noticed that it actually cant open (or set) the port correctly... like something in windows functions

    the application works ok only if i open the chosen port with other program (like putty,realterm etc.) close it and then open it with my application and communication works perfectly... but if i remove a cable and plug it again than windows closes and openes virtual port again and qextserialport cant set it parameters correctly

    some examples witch are in the library work the same way

    here is my port settings
    Qt Code:
    1. port = new QextSerialPort(COM, QextSerialPort::EventDriven);
    2. port->setBaudRate(BAUD57600);
    3. port->setFlowControl(FLOW_OFF);
    4. port->setParity(PAR_NONE);
    5. port->setDataBits(DATA_8);
    6. port->setStopBits(STOP_1);
    7. port->setTimeout(500);
    8. port->open(QIODevice::ReadWrite | QIODevice::Unbuffered);
    To copy to clipboard, switch view to plain text mode 

    read function
    Qt Code:
    1. //receive data from RS485 ... 422
    2. char data[1024];
    3. //int numBytes;
    4. //int bytesRead;
    5. QStringList msg_list;
    6. float var;
    7. port->readLine(data, sizeof(data));
    To copy to clipboard, switch view to plain text mode 
    before i had implementation of read() but it was the same


    write function
    Qt Code:
    1. if (port->isOpen()){
    2. port->write(message.toAscii(),
    3. message.length());
    4. }
    To copy to clipboard, switch view to plain text mode 

    just wanted to add that read and write are in other thread

  2. #2
    Join Date
    Apr 2009
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: setting port in qexserialport

    ok problem is solved... u just had to load port setting after calling QIODevice:pen

    easy correction directly in library

  3. #3
    Join Date
    Apr 2011
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: setting port in qexserialport

    Hi Myx,

    Is it possible for you to show me how you fixed that problem in the library please?

    Thank you!

Similar Threads

  1. QT Webkit port for Windows CE
    By darryncampbell in forum Qt Programming
    Replies: 1
    Last Post: 25th February 2009, 13:10
  2. serial port same local machine
    By adamatic in forum Qt Programming
    Replies: 7
    Last Post: 3rd February 2009, 07:29
  3. QUdpSocket -- Rebinding with Different Port Numbers
    By swamyonline in forum Qt Programming
    Replies: 0
    Last Post: 22nd January 2009, 13:39
  4. First attempt to display serial port data on GUI
    By ShaChris23 in forum Newbie
    Replies: 12
    Last Post: 4th May 2007, 09:14
  5. Replies: 6
    Last Post: 18th April 2007, 15:04

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.