mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-22 02:10:32 +00:00
43 lines
1.5 KiB
Plaintext
43 lines
1.5 KiB
Plaintext
##############################################
|
|
# $Id: 98_ModbusGen${fName}.pm automatically generated by ModbusAttr $
|
|
# module generated automatically by ModbusAttr
|
|
|
|
package ModbusGen${fName};
|
|
use strict;
|
|
use warnings;
|
|
use GPUtils qw(:all);
|
|
|
|
use Exporter ('import');
|
|
our @EXPORT_OK = qw();
|
|
our %EXPORT_TAGS = (all => [@EXPORT_OK]);
|
|
|
|
BEGIN {
|
|
GP_Import( qw(
|
|
LoadModule
|
|
));
|
|
GP_Export( qw(
|
|
Initialize
|
|
));
|
|
};
|
|
|
|
|
|
my %ModbusGen${fName}parseInfo = (
|
|
${t}
|
|
|
|
|
|
#####################################
|
|
sub Initialize {
|
|
my $modHash = shift;
|
|
$modHash->{parseInfo} = \%ModbusGen${fName}parseInfo; # defines registers, inputs, coils etc. for this Modbus Defive
|
|
$modHash->{deviceInfo} = \%ModbusGen${fName}deviceInfo; # defines properties of the device like defaults and supported function codes
|
|
|
|
LoadModule "Modbus";
|
|
Modbus::InitializeLD($modHash); # Generic function of the Modbus module does the rest
|
|
|
|
$modHash->{AttrList} = $modHash->{AttrList} . " " . # Standard Attributes like IODEv etc
|
|
$modHash->{ObjAttrList} . " " . # Attributes to add or overwrite parseInfo definitions
|
|
$modHash->{DevAttrList} . " " . # Attributes to add or overwrite devInfo definitions
|
|
"poll-.* " . # overwrite poll with poll-ReadingName
|
|
"polldelay-.* "; # overwrite polldelay with polldelay-ReadingName
|
|
}
|