Results 1 to 2 of 2

Thread: Question about frame generation

  1. #1
    Join Date
    Feb 2025
    Posts
    1
    Qt products
    Qt4
    Platforms
    Android

    Default Question about frame generation

    Hello,
    I'm currently working with Qextserialport to establish serial communication for a data acquisition system, which requires implementing a specific protocol. I need to create a frame with the following sequence: 0x01, 0x81, and 0x82 (representing the format byte, service ID, and checksum byte). This frame should be transmitted to another computer via RS232 with the click of a button. How can I construct this frame and transmit it in the specified sequence? Additionally, I need to transmit data as well.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,298
    Thanks
    312
    Thanked 870 Times in 857 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Question about frame generation

    create a frame with the following sequence: 0x01, 0x81, and 0x82 (representing the format byte, service ID, and checksum byte)
    Putting the data into or pulling it out of a QByteArray seems to be the way to do this. QextSerialPort has a readAll() method that replaces the same method from the QIODevice base class. The base class has a QIODevice::write() method that uses a QByteArray argument.

    Why aren't you using the built-in QSerialPort class from Qt? It seems to have nearly the same functionality and interface.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Replies: 10
    Last Post: 16th December 2018, 08:23
  2. Replies: 1
    Last Post: 5th December 2013, 07:46
  3. Frame generation (qextserialport)
    By dheeraj in forum Qt Programming
    Replies: 0
    Last Post: 7th May 2008, 09:13
  4. Previous frame inner to this frame(corrupt stack?)
    By coralbird in forum Qt Programming
    Replies: 1
    Last Post: 28th May 2007, 02:35
  5. Previous frame inner to this frame(corrupt stack?)
    By coralbird in forum Qt Programming
    Replies: 17
    Last Post: 29th April 2006, 02:42

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.