Serial (UART) communication
Async serial has no data integrity guarantees.  If data integrity is important to your application, add a checksum.  But if everything is connected properly, it should be pretty solid.
You get a series of bytes.  The rest is up to you.
If the serial is connected while transmission is underway, it will not automatically synchronize.  Some garbage will appear on the line.


One common scheme is to represent data with packets.  Then the packet format is like:

[sync byte][data length byte][data bytes][checksum byte]

There are a lot of variations on it.  The sync byte lets the receiver synchronize if it gets a partial message.  The sync byte can be escaped if it appears elsewhere in the packet, or not.  Checksum can be a sum of all bytes, or XOR, or CRC16, etc.

An alternative is to only use ASCII for the serial communications.  Then you can synchronize on the '\n' at the end of the message.  This is a nice format for debugging, because you can use your favorite terminal emulator.