2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-08 07:24:21 +00:00

changes for TRX modules

git-svn-id: https://svn.fhem.de/fhem/trunk@1284 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
wherzig 2012-02-24 19:37:59 +00:00
parent b10dc6ae9a
commit 1f4dfafcb0

View File

@ -47,8 +47,15 @@ my %flogpar = (
=> { GPLOT => "rain4:RainRate", FILTER => "%NAME" },
# X10 sensors received by RFXCOM
"RFXX10SEC.*"
"(RFXX10SEC|TRX_DS10A).*"
=> { GPLOT => "fht80tf:Window,", FILTER => "%NAME" },
# X10 Window sensors received by RFXTRX
"TRX_DS10A.*"
=> { GPLOT => "fht80tf:Window,", FILTER => "%NAME" },
# TX3 temperature sensors received by RFXTRX
"TX3_T.*"
=> { GPLOT => "temp4:Temp,", FILTER => "%NAME" },
# USB-WDE1
"USBWX_[0-8]"
@ -311,6 +318,15 @@ my @usbtable = (
request => pack("H*", "8105044fc90185"), # get fhtbuf
response => "^\x81........",
define => "FHZ_PARAM FHZ DEVICE", },
{ NAME => "TRX",
matchList => ["cu.usbserial(.*)", "ttyUSB(.*)"],
DeviceName=> "DEVICE\@38400",
init => pack("H*", "0D00000000000000000000000000"), # Reset
request => pack("H*", "0D00000102000000000000000000"), # GetStatus
response => "^\x0d\x01\x00...........",
define => "TRX_PARAM TRX DEVICE\@38400", },
);
@ -390,6 +406,12 @@ CommandUsb($$)
goto NEXTDEVICE;
}
# Send reset (optional)
if(defined($thash->{init})) {
DevIo_SimpleWrite($hash, $thash->{init}, 0);
DevIo_TimeoutRead($hash, 0.5);
}
# Clear the USB buffer
DevIo_SimpleWrite($hash, $thash->{flush}, 0) if($thash->{flush});
DevIo_TimeoutRead($hash, 0.1);