mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 03:06:37 +00:00
37_fakeRoku.pm: added serial attribute
git-svn-id: https://svn.fhem.de/fhem/trunk@16289 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
6d8ff8f444
commit
57ee126a82
@ -39,7 +39,7 @@ fakeRoku_Initialize($)
|
|||||||
#$hash->{SetFn} = "fakeRoku_Set";
|
#$hash->{SetFn} = "fakeRoku_Set";
|
||||||
#$hash->{GetFn} = "fakeRoku_Get";
|
#$hash->{GetFn} = "fakeRoku_Get";
|
||||||
$hash->{AttrFn} = "fakeRoku_Attr";
|
$hash->{AttrFn} = "fakeRoku_Attr";
|
||||||
$hash->{AttrList} = "disable:1,0 favourites fhemIP httpPort reusePort:1,0";
|
$hash->{AttrList} = "disable:1,0 favourites fhemIP httpPort reusePort:1,0 serial";
|
||||||
}
|
}
|
||||||
|
|
||||||
#####################################
|
#####################################
|
||||||
@ -88,8 +88,10 @@ fakeRoku_Define($$)
|
|||||||
return "install IO::Socket::Multicast to use autodiscovery" if(!$fakeRoku_hasMulticast);
|
return "install IO::Socket::Multicast to use autodiscovery" if(!$fakeRoku_hasMulticast);
|
||||||
$hash->{"HAS_IO::Socket::Multicast"} = $fakeRoku_hasMulticast;
|
$hash->{"HAS_IO::Socket::Multicast"} = $fakeRoku_hasMulticast;
|
||||||
|
|
||||||
$hash->{serial} = md5_hex(getUniqueId());
|
$hash->{helper}{serial} = md5_hex(getUniqueId());
|
||||||
$hash->{serial} .= "-$hash->{ID}" if( $hash->{ID} );
|
$hash->{helper}{serial} .= "-$hash->{ID}" if( $hash->{ID} );
|
||||||
|
|
||||||
|
$attr{$name}{serial} = $hash->{helper}{serial} if( !defined($attr{$name}{serial}) );
|
||||||
|
|
||||||
$hash->{fhemHostname} = hostname();
|
$hash->{fhemHostname} = hostname();
|
||||||
$hash->{fhemIP} = fakeRoku_getLocalIP();
|
$hash->{fhemIP} = fakeRoku_getLocalIP();
|
||||||
@ -470,7 +472,7 @@ fakeRoku_Parse($$;$$$)
|
|||||||
$msg .= fakeRoku_hash2header( { 'Cache-Control' => 'max-age=300',
|
$msg .= fakeRoku_hash2header( { 'Cache-Control' => 'max-age=300',
|
||||||
'ST' => 'roku:ecp',
|
'ST' => 'roku:ecp',
|
||||||
'Location' => "http://$hash->{fhemIP}:$hash->{helper}{listener}{PORT}/",
|
'Location' => "http://$hash->{fhemIP}:$hash->{helper}{listener}{PORT}/",
|
||||||
'USN' => "uuid:roku:ecp:$hash->{serial}", } );
|
'USN' => "uuid:roku:ecp:". AttrVal($name,'serial',$hash->{helper}{serial}), } );
|
||||||
$msg .= "\r\n";
|
$msg .= "\r\n";
|
||||||
|
|
||||||
my $sin = sockaddr_in($peerport, inet_aton($peerhost));
|
my $sin = sockaddr_in($peerport, inet_aton($peerhost));
|
||||||
@ -848,6 +850,7 @@ Log 1, "!!!!!!!!!!";
|
|||||||
not set -> set ReusePort on multicast socket if SO_REUSEPORT flag ist known. should work in most cases.<br>
|
not set -> set ReusePort on multicast socket if SO_REUSEPORT flag ist known. should work in most cases.<br>
|
||||||
0 -> don't set ReusePort on multicast socket<br>
|
0 -> don't set ReusePort on multicast socket<br>
|
||||||
1 -> set ReusePort on multicast socket</li>
|
1 -> set ReusePort on multicast socket</li>
|
||||||
|
<li>serial</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</ul><br>
|
</ul><br>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user