mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-21 01:46:08 +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:
parent
a57ad137a3
commit
07a1c95187
@ -934,10 +934,12 @@ sub OWX_ASYNC_PT_Verify($) {
|
|||||||
my $romid = $hash->{ROM_ID};
|
my $romid = $hash->{ROM_ID};
|
||||||
|
|
||||||
#-- Verify a devices is present on the 1-Wire bus
|
#-- Verify a devices is present on the 1-Wire bus
|
||||||
if (defined $async) {
|
|
||||||
return PT_THREAD(sub {
|
return PT_THREAD(sub {
|
||||||
my ($thread) = @_;
|
my ($thread) = @_;
|
||||||
PT_BEGIN($thread);
|
PT_BEGIN($thread);
|
||||||
|
|
||||||
|
if (defined $async) {
|
||||||
|
|
||||||
$thread->{pt_verify} = $async->get_pt_verify($romid);
|
$thread->{pt_verify} = $async->get_pt_verify($romid);
|
||||||
$thread->{TimeoutTime} = gettimeofday()+2; #TODO: implement attribute-based timeout
|
$thread->{TimeoutTime} = gettimeofday()+2; #TODO: implement attribute-based timeout
|
||||||
PT_WAIT_THREAD($thread->{pt_verify});
|
PT_WAIT_THREAD($thread->{pt_verify});
|
||||||
@ -952,8 +954,6 @@ sub OWX_ASYNC_PT_Verify($) {
|
|||||||
readingsSingleUpdate($hash,"present",1,!$hash->{PRESENT});
|
readingsSingleUpdate($hash,"present",1,!$hash->{PRESENT});
|
||||||
}
|
}
|
||||||
$hash->{PRESENT} = $value;
|
$hash->{PRESENT} = $value;
|
||||||
PT_END;
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
my $owx_interface = $hash->{IODev}->{INTERFACE};
|
my $owx_interface = $hash->{IODev}->{INTERFACE};
|
||||||
if( !defined($owx_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}";
|
die "OWX: Verify called with unknown interface $owx_interface on bus $hash->{IODev}->{NAME}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
PT_END;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
########################################################################################
|
########################################################################################
|
||||||
|
Loading…
x
Reference in New Issue
Block a user