2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 23:06:37 +00:00

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
This commit is contained in:
markusbloch 2013-02-20 22:04:57 +00:00
parent 70bd74eb73
commit c0df9f6b07

View File

@ -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";