2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-07 23:09:26 +00:00

after sending "on" to the wol_host, now the sending of magic packet follows at once.

git-svn-id: https://svn.fhem.de/fhem/trunk@4150 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
dietmar63 2013-11-04 20:41:47 +00:00
parent 48d7306e9a
commit 62340d90e8

View File

@ -23,7 +23,7 @@ use strict;
use warnings;
use IO::Socket;
use Time::HiRes qw(gettimeofday);
################################################################################
sub WOL_Initialize($)
{
my ($hash) = @_;
@ -34,9 +34,7 @@ sub WOL_Initialize($)
$hash->{AttrList} = "interval shutdownCmd sysCmd ".
$readingFnAttributes;
}
#
#
#
################################################################################
sub WOL_Set($@)
{
my ($hash, @a) = @_;
@ -68,13 +66,11 @@ sub WOL_Set($@)
InternalTimer(gettimeofday()+5, "WOL_UpdateReadings", $hash, 0);
if ($hash->{STATE} eq "on") {
InternalTimer(gettimeofday()+1, "WOL_GetUpdate", $hash, 0);
InternalTimer(gettimeofday(), "WOL_GetUpdate", $hash, 0);
}
return undef;
}
#
#
#
################################################################################
sub WOL_Define($$)
{
my ($hash, $def) = @_;
@ -120,9 +116,7 @@ sub WOL_Define($$)
readingsSingleUpdate($hash, "packet_via_UDP", "none",0);
return undef;
}
#
#
#
################################################################################
sub WOL_Undef($$) {
my ($hash, $arg) = @_;
@ -130,9 +124,7 @@ sub WOL_Undef($$) {
RemoveInternalTimer($hash);
return undef;
}
#
#
#
################################################################################
sub WOL_UpdateReadings($)
{
my ($hash) = @_;
@ -151,9 +143,7 @@ sub WOL_UpdateReadings($)
readingsEndUpdate($hash, defined($hash->{LOCAL} ? 0 : 1));
InternalTimer(gettimeofday()+$hash->{INTERVAL}, "WOL_UpdateReadings", $hash, 0);
}
#
#
#
################################################################################
sub WOL_GetUpdate($)
{
my ($hash) = @_;
@ -166,9 +156,7 @@ sub WOL_GetUpdate($)
InternalTimer(gettimeofday()+$hash->{REPEAT}, "WOL_GetUpdate", $hash, 0);
}
}
#
#
#
################################################################################
sub wake($)
{
my ($hash) = @_;
@ -190,9 +178,7 @@ sub wake($)
}
readingsEndUpdate($hash, defined($hash->{LOCAL} ? 0 : 1));
}
#
#
################################################################################
# method to wakevia lan, taken from Net::Wake package
sub wol_by_udp {
my ($hash, $mac_addr, $host, $port) = @_;
@ -218,8 +204,7 @@ sub wol_by_udp {
return 1;
}
#
#
################################################################################
# method to wake via system command
sub wol_by_ew($$) {
my ($hash, $mac) = @_;