Hey, I had a few questions about programming with serial ports if you don't mind.
I'm pretty experienced at writing sockets and full on servers with internet protocols but lately I have been playing around with serial port communication amongst my PC and various microcontrollers. I had a few questions about guaranteeing data transmission and such.
1) When dealing with TCP I know there is a client connected before I start transmitting. With a serial port how do I know I can transmit to anybody? Does the client usually send some special packet to the serial host to let them know hey i'm listening? Then what about dealing with disconnects/reconnects?
2) What are "heartbeats" that I keep hearing about when people talk about serial communications?
3) Maybe this is unlikely but I was just curious...if a host is sending mid packet and I plugin the serial cable, what is to stop the data from being totally corrupted from the client starting to read "mid byte" ?
Thanks for any help/info/tips on dealing with serial ports that you can offer.