Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Receiving data packets from the serial port
Forum Updated to NodeBB v4.3 + New Features

Receiving data packets from the serial port

Scheduled Pinned Locked Moved Unsolved General and Desktop
serialserial portframe
5 Posts 2 Posters 2.4k 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.
  • Basti46B Offline
    Basti46B Offline
    Basti46
    wrote on last edited by Basti46
    #1
    This post is deleted!
    ? 1 Reply Last reply
    0
    • Basti46B Basti46

      This post is deleted!

      ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      @Basti46 So what's your question?

      Basti46B 1 Reply Last reply
      0
      • ? A Former User

        @Basti46 So what's your question?

        Basti46B Offline
        Basti46B Offline
        Basti46
        wrote on last edited by
        #3

        @Wieland Sooo my question is, how can i interpret the data from my device. I know that i will receive a data paket with low and high bytes. But as you can see the charArray doen't contain any usefull values. (\x00\xFF\x13g\xDE\xF8\x13\b8@\xC0\xB8\xF9\x03\b\t\xFF\x03\xC8\tB\xFF) I know that withing this data paket there are some ASCII chars. but how can i get those. I don't even know where my problem is that's why i am not able to explain my question better. Sorry for that.

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          Okay. Wikipedia says:

          A zero byte appears at the end of every packet to indicate end-of-packet to the data receiver. This packet delimiter byte does not correspond to a data byte; it is an additional byte that is appended to the encoded output.

          So you need to scan the received data for zero bytes and break the input stream into single frames there.

          Also the wikipedia article you provided features an example implementation of a COBS decoder in C, which you can copy and paste as a starting point.

          Basti46B 1 Reply Last reply
          0
          • ? A Former User

            Okay. Wikipedia says:

            A zero byte appears at the end of every packet to indicate end-of-packet to the data receiver. This packet delimiter byte does not correspond to a data byte; it is an additional byte that is appended to the encoded output.

            So you need to scan the received data for zero bytes and break the input stream into single frames there.

            Also the wikipedia article you provided features an example implementation of a COBS decoder in C, which you can copy and paste as a starting point.

            Basti46B Offline
            Basti46B Offline
            Basti46
            wrote on last edited by
            #5

            @Wieland Well i found my problem, I chose the wrong baudrate. Now i have to adjust my code, but i think it will work sooner or later. Thanks again!

            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