Results 1 to 20 of 47

Thread: serial port programming in qt

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 418 Times in 411 Posts

    Default Re: serial port programming in qt

    I have not used any thing like this function .
    Sorry, I meant main().

    yeah, it runs if i comment that line and place a printf there.And i'm sure i dont use that anywhere in my code.
    Hmm... then from what you have said so far, it all points to a problem in your QextSerialPort lib.
    Also i'm using qextserialport-0.8.0 package since only this supports qt-3.3.5 version. remaining packages such as qextserialport-0.9.0,1.0,1.1 supports higher versions of qt. will there be any problem with this version changes ?
    What do you mean?
    using a Qt4 QextSerialPort with Qt3?
    That wont work.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  2. #2
    Join Date
    Dec 2006
    Posts
    123
    Qt products
    Qt3 Qt/Embedded
    Platforms
    Unix/X11
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Re: serial port programming in qt

    The following in my main():

    Qt Code:
    1. int main( int argc, char **argv )
    2. {
    3. QApplication a( argc, argv );
    4. ConnectWidget connect1;
    5. a.setMainWidget( &connect1 );
    6. connect1.show();
    7. return a.exec();
    8. }
    To copy to clipboard, switch view to plain text mode 
    What do you mean?
    using a Qt4 QextSerialPort with Qt3?
    That wont work.
    No i mean i'm using qt-3.3.5 version and the other versions of qextserialport requires header and libraries of qt 4 or greater version.

  3. #3
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 418 Times in 411 Posts

    Default Re: serial port programming in qt

    Well, from what I can see, there is no problem with the code it self.

    You can only link QextSerialPort for Qt3 (which is linked against Qt3) with Qt3 applications.
    You can only link QextSerialPort for Qt4 (which is linked against Qt4) with Qt4 applications.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  4. #4
    Join Date
    Dec 2006
    Posts
    123
    Qt products
    Qt3 Qt/Embedded
    Platforms
    Unix/X11
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Re: serial port programming in qt

    yeah as you said the code is right. and qextserialport package is used is also correct i think. i mean(for qt-3.3.5 package i used qextserialport-0.8.0 package).

    I think they may have updated these features in the latest versions.And i'm linking qt3 application with qt3 package only.

  5. #5
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 418 Times in 411 Posts

    Default Re: serial port programming in qt

    And i'm linking qt3 application with qt3 package only.
    That is the way it should be.

    Strange.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  6. #6
    Join Date
    Dec 2006
    Posts
    123
    Qt products
    Qt3 Qt/Embedded
    Platforms
    Unix/X11
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Re: serial port programming in qt

    hi,

    i did by using linux syscalls.I used these codes in my qt application. but the i could not get the output i desired. Thats what i went for this package. but this also did not work. Looking for some other way..

  7. #7
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 418 Times in 411 Posts

    Default Re: serial port programming in qt

    Are you working with Qt or QTopia?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  8. #8
    Join Date
    Dec 2006
    Posts
    123
    Qt products
    Qt3 Qt/Embedded
    Platforms
    Unix/X11
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Re: serial port programming in qt

    I'm working with qt-embedded -3.3.5 version.

  9. #9
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 418 Times in 411 Posts

    Default Re: serial port programming in qt

    I'm working with qt-embedded -3.3.5 version.
    It could be the reason this is not working, since it could be that the low level port handling is diefferent on your embeded system.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  10. #10
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 418 Times in 411 Posts

    Default Re: serial port programming in qt

    In the docs of QexstSerialPort 0.70:
    Posix_QextSerialPort::Posix_QextSerialPort ( )


    Default constructor. Note that the name of the device used by a QextSerialPort constructed with this constructor will be determined by defined constants, or lack thereof - the default behavior is the same as _TTY_LINUX_. Possible naming conventions and their associated constants are:

    Constant Used By Naming Convention
    ---------- ------------- ------------------------
    _TTY_WIN_ Windows COM1, COM2
    _TTY_IRIX_ SGI/IRIX /dev/ttyf1, /dev/ttyf2
    _TTY_HPUX_ HP-UX /dev/tty1p0, /dev/tty2p0
    _TTY_SUN_ SunOS/Solaris /dev/ttya, /dev/ttyb
    _TTY_DIGITAL_ Digital UNIX /dev/tty01, /dev/tty02
    _TTY_LINUX_ Linux /dev/ttyS0, /dev/ttyS1
    <none> Linux /dev/ttyS0, /dev/ttyS1

    This constructor assigns the device name to the name of the first port on the specified system. See the other constructors if you need to open a different port.
    You might try one of these defines, in case your system is compatible with one of them.

    And next time post QTopia questions under the QTopia forum.
    Last edited by high_flyer; 8th May 2007 at 14:03.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  11. #11
    Join Date
    Jun 2007
    Posts
    1
    Qt products
    Qt3
    Platforms
    Unix/X11
    Thanks
    1

    Question Re: serial port programming in qt

    hello dear all,
    will anybody pls post any working qt3 example of qextserial.


    thanks in advance

  12. #12
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 418 Times in 411 Posts

    Default Re: serial port programming in qt

    see post 21 in this thread.
    It is an example for Qt4, but the differences are minimal, or none.
    With reading the docs this example is more then enough to get started.
    Last edited by high_flyer; 13th June 2007 at 12:32.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  13. The following user says thank you to high_flyer for this useful post:

    jagdeep (16th June 2007)

Similar Threads

  1. Serial Port communication
    By mgurbuz in forum Qt Programming
    Replies: 12
    Last Post: 22nd January 2011, 02:38
  2. First attempt to display serial port data on GUI
    By ShaChris23 in forum Newbie
    Replies: 12
    Last Post: 4th May 2007, 09:14
  3. Replies: 12
    Last Post: 23rd March 2007, 09:23
  4. Serial Port access in Qt
    By Doug Broadwell in forum Newbie
    Replies: 2
    Last Post: 18th October 2006, 21:03
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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
  •  
Qt is a trademark of The Qt Company.