From a0625153dc092430f5b42896ad04d24440469bbb Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Sun, 29 Jul 2018 00:54:16 -0400 Subject: [PATCH] test --- txupnp/constants.py | 2 ++ txupnp/ssdp.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/txupnp/constants.py b/txupnp/constants.py index 1a5ca1f..5e9d8c8 100644 --- a/txupnp/constants.py +++ b/txupnp/constants.py @@ -25,6 +25,8 @@ service_types = [ SSDP_IP_ADDRESS = '239.255.255.250' SSDP_PORT = 1900 SSDP_DISCOVER = "ssdp:discover" +SSDP_ALL = "ssdp:all" + M_SEARCH_TEMPLATE = "\r\n".join([ "M-SEARCH * HTTP/1.1", "HOST: {}:{}", diff --git a/txupnp/ssdp.py b/txupnp/ssdp.py index 53139b8..67acd31 100644 --- a/txupnp/ssdp.py +++ b/txupnp/ssdp.py @@ -3,7 +3,7 @@ import binascii from twisted.internet import defer from twisted.internet.protocol import DatagramProtocol from txupnp.fault import UPnPError -from txupnp.constants import GATEWAY_SCHEMA, M_SEARCH_TEMPLATE, SSDP_DISCOVER, SSDP_IP_ADDRESS, SSDP_PORT +from txupnp.constants import GATEWAY_SCHEMA, M_SEARCH_TEMPLATE, SSDP_DISCOVER, SSDP_IP_ADDRESS, SSDP_PORT, SSDP_ALL log = logging.getLogger(__name__) @@ -75,7 +75,7 @@ class SSDPProtocol(DatagramProtocol): return self._sem.run(self.do_start) def send_m_search(self): - data = M_SEARCH_TEMPLATE.format(self.ssdp_address, self.ssdp_port, GATEWAY_SCHEMA, SSDP_DISCOVER, self.ttl) + data = M_SEARCH_TEMPLATE.format(self.ssdp_address, self.ssdp_port, GATEWAY_SCHEMA, SSDP_ALL, self.ttl) try: log.info("sending m-search (%i bytes) to %s:%i", len(data), self.ssdp_address, self.ssdp_port) self.transport.write(data.encode(), (self.ssdp_address, self.ssdp_port))