2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-20 13:26:02 +00:00

OWX_ASYNC_PT_Verify: throw exception from within protothread if master is not active

git-svn-id: https://svn.fhem.de/fhem/trunk@6261 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
ntruchsess 2014-07-15 21:28:56 +00:00
parent a57ad137a3
commit 07a1c95187

View File

@ -934,10 +934,12 @@ sub OWX_ASYNC_PT_Verify($) {
my $romid = $hash->{ROM_ID};
#-- Verify a devices is present on the 1-Wire bus
if (defined $async) {
return PT_THREAD(sub {
my ($thread) = @_;
PT_BEGIN($thread);
if (defined $async) {
$thread->{pt_verify} = $async->get_pt_verify($romid);
$thread->{TimeoutTime} = gettimeofday()+2; #TODO: implement attribute-based timeout
PT_WAIT_THREAD($thread->{pt_verify});
@ -952,8 +954,6 @@ sub OWX_ASYNC_PT_Verify($) {
readingsSingleUpdate($hash,"present",1,!$hash->{PRESENT});
}
$hash->{PRESENT} = $value;
PT_END;
});
} else {
my $owx_interface = $hash->{IODev}->{INTERFACE};
if( !defined($owx_interface) ) {
@ -962,6 +962,8 @@ sub OWX_ASYNC_PT_Verify($) {
die "OWX: Verify called with unknown interface $owx_interface on bus $hash->{IODev}->{NAME}";
}
}
PT_END;
});
}
########################################################################################