How can I add ECC to my packets?
What is the physical representation of bits being sent?  In many cases, intra-packet error-correcting codes will be useless because even a transient glitch will cause many bits to be misinterpreted--quite possibly all bits until the next synchronization mark.

If forward error correction is needed, and packets are of uniform size, the simplest approach may be to send n packets worth of data using n+1 packets--each labeled with a packet number--where the (n+1)th packet contains the xor of the other ones.  If the first n packets are read successfully, ignore the extra one.  Otherwise, if one packet is missing or corrupted, infer its value by xor'ing the remaining n packets together.

A slight improvement of this approach would be to send 2n packets worth of data using 2n+2 packets, interleaving two sets of n+1 packets, each set being formulated as above.  That would guarantee recovery from any single communications glitch which was no longer than the time required to send a single packet (a short glitch might hit the end of one packet and the start of the next, but the two packets would be in different xor-groups).

The biggest limitation with this approach is that packets must be assembled into groups (or, putting it another way, what could otherwise be larger packets must be subdivided into smaller ones).  On the other hand, it is robust against glitches that would cause synchronization loss render large amounts of data unreadable.