66_ECMD: ReadyFn added (fixes issue under Windows)
git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@6998 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
||||
# Do not insert empty lines here, update check depends on it.
|
||||
- change: 66_ECMD: ReadyFn added (fixes issue under Windows)
|
||||
- change: 02_RSS: use a GUID in RSS; urlq source for img command
|
||||
- feature: 70_PushNotifier improve usebility, configuration without cURL (xusader)
|
||||
- bugfix: SYSMON: prevent empty line im log by userReadings
|
||||
|
||||
@@ -41,7 +41,7 @@ sub ECMD_Clear($);
|
||||
#sub ECMD_Parse($$$$$);
|
||||
sub ECMD_Read($);
|
||||
sub ECMD_ReadAnswer($$);
|
||||
#sub ECMD_Ready($);
|
||||
sub ECMD_Ready($);
|
||||
sub ECMD_Write($$$);
|
||||
|
||||
|
||||
@@ -61,6 +61,7 @@ ECMD_Initialize($)
|
||||
# Consumer
|
||||
$hash->{DefFn} = "ECMD_Define";
|
||||
$hash->{UndefFn} = "ECMD_Undef";
|
||||
$hash->{ReadyFn} = "ECMD_Ready";
|
||||
$hash->{GetFn} = "ECMD_Get";
|
||||
$hash->{SetFn} = "ECMD_Set";
|
||||
$hash->{AttrFn} = "ECMD_Attr";
|
||||
@@ -150,6 +151,25 @@ ECMD_Log($$$)
|
||||
Log3 $hash, $loglevel , "$name: $logmsg";
|
||||
}
|
||||
|
||||
#####################################
|
||||
sub
|
||||
ECMD_Ready($)
|
||||
{
|
||||
my ($hash) = @_;
|
||||
|
||||
return DevIo_OpenDev($hash, 1, "ECMD_DoInit")
|
||||
if($hash->{STATE} eq "disconnected");
|
||||
|
||||
# This is relevant for windows/USB only
|
||||
my $po = $hash->{USBDev};
|
||||
my ($BlockingFlags, $InBytes, $OutBytes, $ErrorFlags);
|
||||
if($po) {
|
||||
($BlockingFlags, $InBytes, $OutBytes, $ErrorFlags) = $po->status;
|
||||
}
|
||||
return ($InBytes && $InBytes>0);
|
||||
}
|
||||
|
||||
|
||||
#####################################
|
||||
sub
|
||||
ECMD_SimpleRead($)
|
||||
|
||||
Reference in New Issue
Block a user