From 2a221e91a6da98a447c34dd9328a9f2eaa48561f Mon Sep 17 00:00:00 2001 From: borisneubert <> Date: Fri, 20 Jun 2014 09:49:34 +0000 Subject: [PATCH] added notes enable perl specials in get ... raw git-svn-id: https://svn.fhem.de/fhem/trunk@6144 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/66_ECMD.pm | 46 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 8 deletions(-) diff --git a/fhem/FHEM/66_ECMD.pm b/fhem/FHEM/66_ECMD.pm index 523fe6841..2e5bb71c0 100644 --- a/fhem/FHEM/66_ECMD.pm +++ b/fhem/FHEM/66_ECMD.pm @@ -1,13 +1,35 @@ -# -# -# 66_ECMD.pm -# written by Dr. Boris Neubert 2011-01-15 -# e-mail: omega at online dot de -# -############################################## # $Id$ + +############################################################################## +# +# 66_ECMD.pm +# Copyright by Dr. Boris Neubert +# e-mail: omega at online dot de +# +# This file is part of fhem. +# +# Fhem is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# Fhem is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with fhem. If not, see . +# +############################################################################## + package main; +# +# Potential future extensions: add support for PARTIALly received datagrams +# http://forum.fhem.de/index.php/topic,24280.msg174330.html#msg174330 + + use strict; use warnings; use Time::HiRes qw(gettimeofday); @@ -207,6 +229,7 @@ ECMD_Get($@) #my $nonl= AttrVal($name, "nonl", 0); my $ecmd= join " ", @args; #ecmd .= "\n" unless($nonl); + $ecmd= AnalyzePerlCommand(undef, $ecmd); $answer= ECMD_SimpleExpect($hash, $ecmd, ".*"); } else { return "get $cmd: unknown command "; @@ -590,7 +613,14 @@ ECMD_Write($$$) get <name> raw <command>

Sends the command <command> to the physical ECMD device - <name> and reads the response. + <name> and reads the response. In the likely case that + the command needs to be terminated by a newline character, you have to + resort to a <perl special>. +

+ Example: +