2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

OWX_ASYNC: fix commandref

git-svn-id: https://svn.fhem.de/fhem/trunk@5528 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
ntruchsess 2014-04-14 22:20:54 +00:00
parent d1d2212815
commit d3e169a0d7
5 changed files with 15 additions and 15 deletions

View File

@ -4,8 +4,8 @@
#
# FHEM module to commmunicate with 1-Wire bus devices
# * via an active DS2480 bus master interface attached to an USB port
# * via an Arduino running CopnfigurableFirmata attached to USB
# * via an Arduino running CopnfigurableFirmata connecting to FHEM via Ethernet
# * via an Arduino running ConfigurableFirmata attached to USB
# * via an Arduino running ConfigurableFirmata connecting to FHEM via Ethernet
#
# Norbert Truchsess
# Prof. Dr. Peter A. Henning
@ -189,15 +189,15 @@ sub OWX_ASYNC_Define ($$) {
#-- First step - different methods
#-- check if we have a serial device attached
if ( $dev =~ m|$SER_regexp|i){
require "$main::attr{global}{modpath}/FHEM/11_OWX_SER.pm";
require "$main::attr{global}{modpath}/FHEM/OWX_SER.pm";
$owx = OWX_SER->new();
#-- check if we have a COC/CUNO interface attached
}elsif( (defined $main::defs{$dev} && (defined( $main::defs{$dev}->{VERSION} ) ? $main::defs{$dev}->{VERSION} : "") =~ m/CSM|CUNO/ )){
require "$main::attr{global}{modpath}/FHEM/11_OWX_CCC.pm";
require "$main::attr{global}{modpath}/FHEM/OWX_CCC.pm";
$owx = OWX_CCC->new();
#-- check if we are connecting to Arduino (via FRM):
} elsif ($dev =~ /^\d{1,2}$/) {
require "$main::attr{global}{modpath}/FHEM/11_OWX_FRM.pm";
require "$main::attr{global}{modpath}/FHEM/OWX_FRM.pm";
$owx = OWX_FRM->new();
} else {
return "OWX: Define failed, unable to identify interface type $dev"

View File

@ -7,7 +7,7 @@
# Prof. Dr. Peter A. Henning
# Norbert Truchsess
#
# $Id: 11_OWX_SER.pm 2013-03 - pahenning $
# $Id: OWX_DS2480.pm 2013-04 - ntruchsess $
#
########################################################################################
#
@ -98,7 +98,7 @@ sub query ($$$) {
$hwdevice->baudrate($serial->{baud});
$hwdevice->write_settings;
if( $main::owx_debug > 2){
if( $main::owx_async_debug > 2){
main::Log3($serial->{name},3, "OWX_DS2480.query sending out: ".unpack ("H*",$cmd));
}
@ -134,10 +134,10 @@ sub read() {
$serial->{string_in} .= $string_part;
$serial->{retcount} += $count_in;
$serial->{num_reads}++;
if( $main::owx_debug > 2){
if( $main::owx_async_debug > 2){
main::Log3($serial->{name},3, "OWX_DS2480 read: Loop no. $serial->{num_reads}");
}
if( $main::owx_debug > 2){
if( $main::owx_async_debug > 2){
main::Log3($serial->{name},3, "OWX_DS2480 read: Receiving in loop no. $serial->{num_reads} ".unpack("H*",$string_part));
}
return $count_in > 0 ? 1 : undef;

View File

@ -7,7 +7,7 @@
# Prof. Dr. Peter A. Henning
# Norbert Truchsess
#
# $Id: 11_OWX_SER.pm 2013-03 - pahenning $
# $Id: OWX_SER.pm 2013-04 - ntruchsess $
#
########################################################################################
#
@ -43,7 +43,7 @@ no warnings 'deprecated';
sub new() {
my $class = shift;
require "$main::attr{global}{modpath}/FHEM/11_OWX_Executor.pm";
require "$main::attr{global}{modpath}/FHEM/OWX_Executor.pm";
my $self = OWX_Executor->new();
@ -202,7 +202,7 @@ sub pt_execute($$$$$$$) {
}
#-- for debugging
if( $main::owx_debug > 1){
if( $main::owx_async_debug > 1){
main::Log3($self->{name},3,"OWX_SER::Execute: Sending out ".unpack ("H*",$select));
}
$self->block($select);
@ -213,7 +213,7 @@ sub pt_execute($$$$$$$) {
my $res = $self->{string_in};
#-- for debugging
if( $main::owx_debug > 1){
if( $main::owx_async_debug > 1){
main::Log3($self->{name},3,"OWX_SER::Execute: Receiving ".unpack ("H*",$res));
}
@ -286,7 +286,7 @@ sub initialize($) {
my $interface;
require "$main::attr{global}{modpath}/FHEM/11_OWX_DS2480.pm";
require "$main::attr{global}{modpath}/FHEM/OWX_DS2480.pm";
my $ds2480 = OWX_DS2480->new($self);
#-- timing byte for DS2480
@ -350,7 +350,7 @@ sub initialize($) {
if ($interface eq "DS2480") {
return $ds2480;
} elsif ($interface eq "DS9097") {
require "$main::attr{global}{modpath}/FHEM/11_OWX_DS9097.pm";
require "$main::attr{global}{modpath}/FHEM/OWX_DS9097.pm";
return OWX_DS9097->new($self);
} else {
die $ress;