code: def send_ssdp_broadcast():
      
      # Send up to three different broadcast messages
      for i, ssdp_query in enumerate(SSDP_QUERIES):
          # Prepare SSDP broadcast message
          sock = socket.socket(
              socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
          sock.settimeout(2)
          sock.sendto(ssdp_query.encode(), (SSDP_ADDR, SSDP_PORT))
  
          # Collect all responses within the timeout period
          res = []
          try:
              while True:
                  res.append(sock.recvfrom(10240))
          except socket.timeout:
              sock.close()
  
          if res:
              _LOGGER.debug("Got results after %s SSDP queries", i + 1)
              sock.close()
              break
  
      # Prepare output of responding devices
      devices = {}
      device = {}
  
      for entry in res:
          device["address"] = entry[1]
          # Some string operations to get the receivers URL
          # which could be found between LOCATION and end of line of the response
          en_decoded = entry[0].decode("utf-8")
          # If location is not found, skip the entry
          try:
              device["URL"] = (
                  en_decoded[
                      en_decoded.lower().index(
                          "location:") + 10:en_decoded.index(
                              "\r\n", en_decoded.lower().index("location:"))]
              )
          except ValueError:
              continue
          devices[device["address"]] = device.copy()
  
      _LOGGER.debug("Following devices found: %s", list(devices.values()))
      return list(devices.values())
docs: Send SSDP broadcast message to discover UPnP devices.
  
      Returns a list of dictionaries with "address" (IP, PORT) and "URL"
      of SCPD XML for all discovered devices.