mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-04 05:16:45 +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:
parent
70bd74eb73
commit
c0df9f6b07
@ -510,7 +510,11 @@ PRESENCE_DoLocalBluetoothScan($)
|
|||||||
my $wait = 1;
|
my $wait = 1;
|
||||||
my $ps;
|
my $ps;
|
||||||
|
|
||||||
if($hcitool)
|
Log GetLogLevel($name, 4), "PRESENCE ($name): 'which hcitool' returns: $hcitool";
|
||||||
|
chomp $hcitool;
|
||||||
|
|
||||||
|
|
||||||
|
if(-x $hcitool)
|
||||||
{
|
{
|
||||||
while($wait)
|
while($wait)
|
||||||
{ # check if another hcitool process is running
|
{ # check if another hcitool process is running
|
||||||
@ -518,6 +522,7 @@ PRESENCE_DoLocalBluetoothScan($)
|
|||||||
if(not $ps =~ /^\s*$/)
|
if(not $ps =~ /^\s*$/)
|
||||||
{
|
{
|
||||||
# sleep between 1 and 5 seconds and try again
|
# 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);
|
sleep(rand(4)+1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -527,8 +532,10 @@ PRESENCE_DoLocalBluetoothScan($)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$devname = qx(hcitool name $device);
|
$devname = qx(hcitool name $device);
|
||||||
|
|
||||||
chomp($devname);
|
chomp($devname);
|
||||||
|
Log GetLogLevel($name, 4), "PRESENCE ($name) - hcitool returned: $devname";
|
||||||
|
|
||||||
if(not $devname =~ /^\s*$/)
|
if(not $devname =~ /^\s*$/)
|
||||||
{
|
{
|
||||||
$return = "$name|$local|present|$devname";
|
$return = "$name|$local|present|$devname";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user