############################################## # $Id$ package main; use strict; use warnings; use Time::HiRes qw(gettimeofday); ##################################### sub at_Initialize($) { my ($hash) = @_; $hash->{DefFn} = "at_Define"; $hash->{UndefFn} = "at_Undef"; $hash->{AttrFn} = "at_Attr"; $hash->{StateFn} = "at_State"; $hash->{AttrList} = "disable:0,1 skip_next:0,1 loglevel:0,1,2,3,4,5,6 ". "alignTime"; } my $oldattr; ##################################### sub at_Define($$) { my ($hash, $def) = @_; my ($name, undef, $tm, $command) = split("[ \t]+", $def, 4); if(!$command) { if($hash->{OLDDEF}) { # Called from modify, where command is optional RemoveInternalTimer($hash); (undef, $command) = split("[ \t]+", $hash->{OLDDEF}, 2); $hash->{DEF} = "$tm $command"; } else { return "Usage: define at "; } } return "Wrong timespec, use \"[+][*[{count}]]