title: How usb OTG works(master/slave)
body: <p>A device has USB OTG support. Following are scenarios:</p>
  
  <ol>
  <li><p>When a device is connected to a PC, the device acts as slave. (How does the device know it has to act as slave?)</p></li>
  <li><p>When a device is connected to a printer, the device acts as master.
  (How does the device know it has to act as master?)</p></li>
  </ol>
  
  <p>What are the steps executed when a device is connected to OTG?
  How to implement this mechanism (in brief)?</p>