diff --git a/fhem/CHANGED b/fhem/CHANGED index bab7e41a3..e5e167388 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -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. + - feature: 66_ECMD: requestSeparator can be turned off - feature: 02_RSS: viewport configurable by attribute - change: 93_DbLog: removed use of perl's 'switch' feature. - change: 93_DbLog: removed string length limitation for SQLITE. diff --git a/fhem/FHEM/66_ECMD.pm b/fhem/FHEM/66_ECMD.pm index 488eafd28..789615a6c 100644 --- a/fhem/FHEM/66_ECMD.pm +++ b/fhem/FHEM/66_ECMD.pm @@ -84,6 +84,8 @@ ECMD_Define($$) return $msg; } + $attr{$name}{"requestSeparator"}= "\000"; + DevIo_CloseDev($hash); $hash->{Protocol}= $protocol; @@ -550,9 +552,14 @@ ECMD_Write($$$) my $name= $hash->{NAME}; my $answer; my $ret= ""; - my $requestSeparator= AttrVal($hash, "requestSeparator", "\000"); + my $requestSeparator= AttrVal($hash, "requestSeparator", undef); my $responseSeparator= AttrVal($hash, "responseSeparator", ""); - my @ecmds= split $requestSeparator, $msg; + my @ecmds; + if(defined($requestSeparator)) { + @ecmds= split $requestSeparator, $msg; + } else { + push @ecmds, $msg; + } ECMD_Log $hash, 5, "command split into " . ($#ecmds+1) . " parts." if($#ecmds>0); foreach my $ecmd (@ecmds) { ECMD_Log $hash, 5, "sending command " . dq($ecmd); @@ -691,8 +698,9 @@ ECMD_Write($$$)
  • requestSeparator
    A single request from FHEM to the device might need to be split in several datagrams. A command string is split at all occurrences of the requestSeparator. The requestSeparator itself is removed from the command string and thus - not part of the request. It defaults to the - value \000 (octal representation of control char with code zero). + not part of the request. + This attribute is set by default. It defaults to the value \000 (octal representation of control char with code zero). + To disable this feature, delete the attribute from the device's attribute list.
  • responseSeparator
    In order to identify the single responses from the device to FHEM for each part of a split command, a responseSeparator