Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Parsing UDP data failure (solved)
Forum Updated to NodeBB v4.3 + New Features

Parsing UDP data failure (solved)

Scheduled Pinned Locked Moved Mobile and Embedded
2 Posts 1 Posters 618 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    houmingc
    wrote on last edited by
    #1

    I successfully read 1st byte. My question is how to read subsequent next 4 bytes and subsequent 1 bytes till last bit.
    Mycode:
    QDataStream in(UDPdataRec); //UDPdataRec is 17 bytes
    qint8 n;
    in>>n;
    qDebug()<<n;

    1 Reply Last reply
    0
    • H Offline
      H Offline
      houmingc
      wrote on last edited by
      #2

      I can solved the problem by setting different variable size
      qint8 a;
      qint32 b;
      qint64 c;

      and push QDatastream into each variable by sequence using in keyword.

      in>>a>>b>>c

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved