more options vor timeout

This commit is contained in:
Marko Oldenburg 2018-01-27 15:28:21 +01:00
parent 9e422e26ac
commit 0d965a45af

View File

@ -465,7 +465,7 @@ sub XiaomiBTLESens_ExecGatttool_Run($) {
$cmd .= "gatttool -i $hci -b $mac ";
$cmd .= "--char-read -a $handle" if($gattCmd eq 'read');
$cmd .= "--char-write-req -a $handle -n $value" if($gattCmd eq 'write');
#$cmd = "timeout 10 ".$cmd." --listen" if( AttrVal($name,"model","none") eq 'thermoHygroSens' and $gattCmd eq 'write' and $handle eq '0x10');
$cmd = "timeout -s 15 -k 15 5 ".$cmd." --listen" if( AttrVal($name,"model","none") eq 'thermoHygroSens' and $gattCmd eq 'write' and $handle eq '0x10');
$cmd .= " 2>&1 /dev/null";
$cmd .= "'" if($sshHost ne 'none');
$cmd = "ssh $sshHost 'gatttool -i $hci -b $mac --char-write-req -a 0x33 -n A01F && gatttool -i $hci -b $mac --char-read -a 0x35 2>&1 /dev/null'" if($sshHost ne 'none' and $gattCmd eq 'write' and AttrVal($name,"model","none") eq 'flowerSens');