Skip to content
Permalink
Browse files

Improve check on running adapter

  • Loading branch information...
diving91 committed Mar 21, 2017
1 parent d6f06df commit 032135593c4d1e689c6c7767a9956088d8af488d
Showing with 2 additions and 1 deletion.
  1. +2 −1 BTdaemon.php
@@ -261,7 +261,8 @@ private function checkHCI($adapter) {
unset($r);
exec("$hciconfig -a $adapter",$r);
//$this->dbg(print_r($r,true));
if (@trim($r[2]) != "UP RUNNING") {die("ERROR $adapter adapter not running, use: sudo hciconfig $adapter up\n");}
$t = explode(" ",trim($r[2]));
if (!in_array("UP",$t) || !in_array("RUNNING",$t)) {die("ERROR $adapter adapter not running, use: sudo hciconfig $adapter up\n");}
$this->dbg("Bluetooth adapter UP & RUNNING\n");
}

0 comments on commit 0321355

Please sign in to comment.
You can’t perform that action at this time.