include check for existing FRM device before calling FRM_Client_Define

git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@2662 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
ntruchsess
2013-02-08 11:27:52 +00:00
parent 4359e4f2be
commit ad998c90d1

View File

@@ -193,9 +193,12 @@ sub OWX_Define ($$) {
$hash->{HWDEVICE} = $owx_hwdevice;
#-- check if we are connecting to Arduino (via FRM):
} elsif ($dev =~ /^\d{1,2}$/) {
require "10_FRM.pm";
$hash->{INTERFACE} = "firmata";
FRM_Client_Define($hash,$def);
if (defined $main::modules{FRM}) {
$hash->{INTERFACE} = "firmata";
FRM_Client_Define($hash,$def);
} else {
Log 1,"module FRM not yet loaded, please define an FRM device first.";
}
} else {
$hash->{DeviceName} = $dev;
#-- Second step in case of CUNO: See if we can open it