From d275e9eb7dfaa864064b0bc6b8ccfd25cff658cb Mon Sep 17 00:00:00 2001
From: borisneubert <>
Date: Sun, 8 Jul 2012 09:12:31 +0000
Subject: [PATCH] multiple responses from an ECMDDevice are joined with line
breaks (previously semicolon)
git-svn-id: https://svn.fhem.de/fhem/trunk@1703 2b470e98-0d58-463d-a4d8-8e2adae1ed80
---
fhem/FHEM/66_ECMD.pm | 2 +-
fhem/docs/commandref.html | 13 ++++++++-----
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/fhem/FHEM/66_ECMD.pm b/fhem/FHEM/66_ECMD.pm
index 4ca9d521b..9b40244e8 100644
--- a/fhem/FHEM/66_ECMD.pm
+++ b/fhem/FHEM/66_ECMD.pm
@@ -625,7 +625,7 @@ ECMD_Write($$)
push @r, $answer;
Log 5, $answer;
}
- return join(";", @r);
+ return join("\n", @r);
}
#####################################
diff --git a/fhem/docs/commandref.html b/fhem/docs/commandref.html
index 93da072a7..bc3e5b684 100644
--- a/fhem/docs/commandref.html
+++ b/fhem/docs/commandref.html
@@ -6232,9 +6232,12 @@ Attributes:
observe the log file.
- Neither apply the rules outlined in the documentation of perl specials
+
+ The rules outlined in the documentation of perl specials
+ for the <perl command>
in the postprocessor definitions apply.
+ Note: Beware of undesired side effects from e.g. doubling of semicolon!
The perl command
acts on $_
. The result of the perl command is the
final result of the get or set command.
@@ -6352,7 +6355,7 @@ Attributes:
params pinmask
set on cmd {"io set ddr 2 ff\nioset port 2 0%pinmask\nwait 1000\nio set port 2 00"}
- set on postproc {s/OK;OK;OK;OK/success/; "$_" eq "success" ? "ok" : "error"; }
+ set on postproc {s/^OK\nOK\nOK\nOK$/success/; "$_" eq "success" ? "ok" : "error"; }
In the fhem configuration file or on the fhem command line we do the following:
@@ -6369,8 +6372,8 @@ Attributes:
evaluates this to a literal string which is send as a plain ethersex command to the AVR-NET-IO line by line.
For any of the four plain ethersex commands, the AVR-NET-IO returns the string OK
. They are
- concatenated and separated by semicolons. The postprocessor takes the result from $_
,
- substitutes it by the string success
if it is OK;OK;OK;OK
, and then either
+ concatenated and separated by line breaks (\n). The postprocessor takes the result from $_
,
+ substitutes it by the string success
if it is OK\nOK\nOK\nOK
, and then either
returns the string ok
or the string error
.