change writen routine
This commit is contained in:
parent
063201f59e
commit
b630478250
@ -471,7 +471,7 @@ sub CometBlueBTLE_ExecGatttool_Run($) {
|
|||||||
$cmd .= "gatttool -i $hci -b $mac ";
|
$cmd .= "gatttool -i $hci -b $mac ";
|
||||||
$cmd .= "--char-read -a $handle" if($gattCmd eq 'read');
|
$cmd .= "--char-read -a $handle" if($gattCmd eq 'read');
|
||||||
$cmd .= "--char-write-req -a $handle -n $value" if($gattCmd eq 'write');
|
$cmd .= "--char-write-req -a $handle -n $value" if($gattCmd eq 'write');
|
||||||
$cmd = "timeout 15 ".$cmd." --listen" if($gattCmd eq 'write');
|
$cmd = "timeout 15 ".$cmd." --listen" if($gattCmd eq 'write' and $handle eq $gatttChar{'payload'});
|
||||||
$cmd .= " 2>&1 /dev/null";
|
$cmd .= " 2>&1 /dev/null";
|
||||||
$cmd .= "'" if($sshHost ne 'none');
|
$cmd .= "'" if($sshHost ne 'none');
|
||||||
|
|
||||||
@ -497,6 +497,8 @@ sub CometBlueBTLE_ExecGatttool_Run($) {
|
|||||||
|
|
||||||
if($gtResult[1] =~ /^([0-9a-f]{2}(\s?))*$/) {
|
if($gtResult[1] =~ /^([0-9a-f]{2}(\s?))*$/) {
|
||||||
return "$name|$mac|ok|$gattCmd|$handle|$json_notification";
|
return "$name|$mac|ok|$gattCmd|$handle|$json_notification";
|
||||||
|
} elsif($gtResult[0] eq 'Characteristic value was written successfully' and $gattCmd eq 'write') {
|
||||||
|
return "$name|$mac|ok|$gattCmd|$handle|$json_notification";
|
||||||
} else {
|
} else {
|
||||||
return "$name|$mac|error|$gattCmd|$handle|$json_notification";
|
return "$name|$mac|error|$gattCmd|$handle|$json_notification";
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user