Permalink
Browse files

Merge pull request #262 from tarasfrompir/master

Update Core.php
  • Loading branch information...
T-REX-XP committed Sep 3, 2018
2 parents 7cb1e78 + 61590c5 commit 9e5c32dbe3a50b2b2e1c537c5e71638579cef3da
Showing with 9 additions and 1 deletion.
  1. +9 −1 modules/ssdp_finder/upnp/vendor/jalder/upnp/src/Core.php
@@ -15,7 +15,15 @@ public function __construct()
public function search($st = 'ssdp:all', $mx = 2, $man = 'ssdp:discover', $from = null, $port = null, $sockTimout = '2')
{
//milight, MagicHome
$request = 'HF-A11ASSISTHREAD'."\r\n";
$socket = socket_create(AF_INET, SOCK_DGRAM, 0);
socket_set_option($socket, SOL_SOCKET, SO_BROADCAST, true);
socket_sendto($socket, $request, strlen($request), 0, '239.255.255.250', 48899);
//yeelight
$request = 'M-SEARCH * HTTP/1.1'."\r\n";
$request .= 'HOST: 239.255.255.250:1982'."\r\n";
$request .= 'MAN: "'.$man.'"'."\r\n";
@@ -27,7 +35,7 @@ public function search($st = 'ssdp:all', $mx = 2, $man = 'ssdp:discover', $from
socket_set_option($socket, SOL_SOCKET, SO_BROADCAST, true);
socket_sendto($socket, $request, strlen($request), 0, '239.255.255.250', 1982);
//all
$request = 'M-SEARCH * HTTP/1.1'."\r\n";
$request .= 'HOST: 239.255.255.250:1900'."\r\n";
$request .= 'MAN: "'.$man.'"'."\r\n";

0 comments on commit 9e5c32d

Please sign in to comment.