Hi guys,
I have a serial connection between two arduinos. One is the "master" -A and always on the other one (B) turns on and off as needed.
The communication is bidirectional: A send some bytes to B and B sends some bytes to A.
The problem is when B goes offline how do i ensure that A doesnt run into a "outgoing buffer overflow".
I am coding in simulink not the traditional IDE so i really cant post any code. I am just looking for a methodology or code snippet that allows me to either detect when B goes offline so i can stop sending data and/or clear the buffer so its empty when B comes back online.
B may be sending or not sending data so using received data as an indicator whether its on or off wont work.
any help is appreciated!
-phil