From 57f0eb91b0200524bec4a6c095e67c7b169f4ed5 Mon Sep 17 00:00:00 2001 From: MarkusF <> Date: Fri, 18 Apr 2025 12:52:00 +0000 Subject: [PATCH] 50_MOBILEALERTSGW.pm: Added Internal lastGateway git-svn-id: https://svn.fhem.de/fhem/trunk@29871 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/FHEM/50_MOBILEALERTSGW.pm | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 8a426e2d5..c3cd4e513 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it + - feature: 50_MOBILEALERTSGW: Added Internal lastGateway - feature: 76_SolarForecast: Major release 1.51.0 - feature: 76_SolarForecast: Version 1.50.3 - bufgix: 72_FRITZBOX: set smartHome diff --git a/fhem/FHEM/50_MOBILEALERTSGW.pm b/fhem/FHEM/50_MOBILEALERTSGW.pm index 875a7524f..2b8fb9e77 100644 --- a/fhem/FHEM/50_MOBILEALERTSGW.pm +++ b/fhem/FHEM/50_MOBILEALERTSGW.pm @@ -267,8 +267,8 @@ sub MOBILEALERTSGW_Set ($$@) { Log3 $MA_wname, 5, "$MA_wname MOBILEALERTSGW: Good Checksum got: 0x" . sprintf( "%02X", $sum ); - - Dispatch( $hash, $data, undef ); + my %addvals = ( lastGateway => "Debuginsert"); + Dispatch( $hash, $data, \%addvals ); return undef; } else { @@ -476,7 +476,7 @@ sub MOBILEALERTSGW_Read($$) { Log3 $MA_wname, 4, "$MA_wname MOBILEALERTSGW: $MA_cname: Data from $gwserial $gwmac"; MOBILEALERTSGW_DefaultAnswer($hash); - MOBILEALERTSGW_DecodeData( $hash, $POSTdata ); + MOBILEALERTSGW_DecodeData( $hash, $gwserial, $POSTdata); } else { TcpServer_WriteBlocking( $MA_chash, @@ -572,8 +572,8 @@ sub MOBILEALERTSGW_DecodeInit($$) { "$MA_wname MOBILEALERTSGW: Uptime (s): " . $upTime . " ID: " . $ID; } -sub MOBILEALERTSGW_DecodeData($$) { - my ( $hash, $POSTdata ) = @_; +sub MOBILEALERTSGW_DecodeData($$$) { + my ( $hash, $gwserial, $POSTdata ) = @_; my $verbose = GetVerbose($MA_wname); for ( my $pos = 0 ; $pos < length($POSTdata) ; $pos += MA_PACKAGE_LENGTH ) { @@ -605,7 +605,8 @@ sub MOBILEALERTSGW_DecodeData($$) { "$MA_wname MOBILEALERTSGW: Data for $deviceID: " . unpack( "H*", $data ) if ( $verbose >= 5 ); - my $found = Dispatch( $defs{$MA_wname}, $data, undef ); + my %addvals = ( lastGateway => $gwserial); + my $found = Dispatch( $defs{$MA_wname}, $data, \%addvals ); } } }