Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Forward error correction in C-programming applied to non-streaming data?

Forward error correction in C-programming applied to non-streaming data?

Scheduled Pinned Locked Moved C / C++ / MFC
hardwarehelpquestion
2 Posts 2 Posters 0 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.
  • A Offline
    A Offline
    arnold_w
    wrote on last edited by
    #1

    I need to read/write small chunks of data over an unreliable communication link in an embedded system. When I was student I learned about interleavers/deinterleavers, Viterbi-encoding, Reed Solomon-encoding, etc, but that was a million years ago so I'm sure there's something better out there today. I would prefer something that is available in open source C-code and my data is not streaming so it doesn't need to support on-the-fly operations, it just need to be able to encode/decode packets of arbitrary sizes. Can someone please recommend something?

    L 1 Reply Last reply
    0
    • A arnold_w

      I need to read/write small chunks of data over an unreliable communication link in an embedded system. When I was student I learned about interleavers/deinterleavers, Viterbi-encoding, Reed Solomon-encoding, etc, but that was a million years ago so I'm sure there's something better out there today. I would prefer something that is available in open source C-code and my data is not streaming so it doesn't need to support on-the-fly operations, it just need to be able to encode/decode packets of arbitrary sizes. Can someone please recommend something?

      L Offline
      L Offline
      leon de boer
      wrote on last edited by
      #2

      The old modem protocols XModem, YModem and Zmodem are designed for what you are doing they send packets with CRC checks and packets are accept or reject which causes the packet to be resent. You can net search for the code. A simple XModem send routine looks like this which should give you an understanding of what it does Send data of a fixed packet size, send the CRC for the packet .. wait for ACK or NAK. Resend packet on NAK. simple xmodem/ymodem implementation in C · GitHub[^] A full Zmodem with both send and receive implementation is more complex but once you understand the simple xmodem it should make sense. The greater complexity is because the transfer packet size auto adjusts, as you get more packet rejects it sends smaller and smaller packets. If you are getting transmission errors you don't want to waste time sending large packets over and over, expect an error and send small packets. The smaller packets means there is a lot of packet acknowledges going on but that is faster than resending large packets. pkg-sbbs/zmodem.c at master · ftnapps/pkg-sbbs · GitHub[^] ZMODEM - Wikipedia[^] Ethernet protocols extend beyond that in that they allow and expect the packets to arrive out of order. The X/Y/Z modem protocols are strictly packets in order processes which is what you said was okay.

      In vino veritas

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups