From 3630c4a3f0f63cee0948e7844eb864a0d0f15a05 Mon Sep 17 00:00:00 2001 From: markusbloch Date: Wed, 20 Feb 2013 22:04:57 +0000 Subject: [PATCH] fixing not recognizing hcitool binary path, adding debug log commands git-svn-id: https://svn.fhem.de/fhem/trunk@2778 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/73_PRESENCE.pm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/fhem/FHEM/73_PRESENCE.pm b/fhem/FHEM/73_PRESENCE.pm index 30e11f0e0..b87133dda 100755 --- a/fhem/FHEM/73_PRESENCE.pm +++ b/fhem/FHEM/73_PRESENCE.pm @@ -510,7 +510,11 @@ PRESENCE_DoLocalBluetoothScan($) my $wait = 1; my $ps; - if($hcitool) + Log GetLogLevel($name, 4), "PRESENCE ($name): 'which hcitool' returns: $hcitool"; + chomp $hcitool; + + + if(-x $hcitool) { while($wait) { # check if another hcitool process is running @@ -518,6 +522,7 @@ PRESENCE_DoLocalBluetoothScan($) if(not $ps =~ /^\s*$/) { # sleep between 1 and 5 seconds and try again + Log GetLogLevel($name, 5), "PRESENCE ($name) - another hcitool command is running. waiting..."; sleep(rand(4)+1); } else @@ -527,8 +532,10 @@ PRESENCE_DoLocalBluetoothScan($) } $devname = qx(hcitool name $device); + chomp($devname); - + Log GetLogLevel($name, 4), "PRESENCE ($name) - hcitool returned: $devname"; + if(not $devname =~ /^\s*$/) { $return = "$name|$local|present|$devname";