title: How to implement collision avoidance on serial port
body: <p>I have many devices that communicate through COM port(tty/s0), i need to implement collision avoidance to make collision impossible. Please give me some algorithm or code. </p>
  
  <p>Using: smart6818(Friendly arm), Ubuntu 16.04.5 LTS</p>
  
  <p>I've found out this controller allows a CSMA/CA medium access. Before sending a packet, it sends some kind of acknowledgment frames (ACK, NACK or BUSY). But I do not know how to implement this</p>