title: how to check ping for a bluetooth device in python
body: <p>i have connected a bluetooth controller to control a rover.
  i am able to ping the controller using <code>sudo l2ping 84:30:95:06:C6:6C</code> on the terminal.
  basically i want to execute certain code when ping is not available. i.e., when controller is disconnected.
  i tried this:</p>
  <pre><code>import bluetooth
  
  while True:
      if bluetooth.lookup_name('84:30:95:06:C6:6C'):
          print(&quot;do nothing&quot;)
  
      else:
          print(&quot;do something&quot;)
  </code></pre>
  <p>but this has bit of delay, it takes around 2-3 seconds to give me the output when the controller is disconnected.
  is there any other way of doing this in python ?</p>