4. ssdp — SSDP Server implementation

python-brisa provides a SSDP (Simple Service Discovery Protocol) module which can be used on the control point’s side or on the device’s.

  • Device’s side - Used for annoucing the device, its embedded devices and all services.
  • Control Point’s side - Used for keeping record of known devices.

There’s no need to use the SSDP Server directly when using the control point or device API’s.

4.1. SSDPServer class

Implementation of a SSDP Server.

4.1.1. Attributes

The attribute of the SSDPServer class are:

  • server_name - name of the server.
  • xml_description_filename - XML description filename.
  • max_age - max age parameter, default is 1800.
  • receive_notify - if False, ignores notify messages.
  • known_devices - dict of the known devices.
  • advertised - dict of the advertised devices.
  • _callbacks - dict of the callbacks.

4.1.2. Methods

Returns True if the SSDPServer is running, False otherwise.
Starts the SSDPServer.
Sends bye bye notifications and stops the SSDPServer.
Destroys the SSDPServer.
Clears the device list.
Device could not be fully built, so forget it.
Returns if the device with the passed usn is already known.
subscribe(name, callback)
Subscribes a callback for an given name event.
unsubscribe(name, callback)
Unsubscribes a call back for an event.
Announces the device.
Registers a device on the SSDP Server.
_datagram_received(data, (host, pot))
Handles a received multicast datagram.
_discovery_request(headers, (host, port))
Processes the discovery requests and responds accordingly.
_notify_received(headers, (host, port))
Processes a presence announcement.
_register(usn, st, location, server, cache_control, where='remote')
Registers a service or device.
_local_register(usn, st, location, server, cache_control)
Registers locally a new service or device.
Registers a device.
Renew notifications (sends a notify).
Unregisters a device.
Do a notification for the usn specified.
Do byebye notification for the usn specified.
_callback(name, *args)
Performs callbacks for events.
Cleans the SSDPServer by removing known devices and internal cache.

Table Of Contents

Previous topic

3. upnp_defaults — UPnP Constants

Next topic

5. Applications

This Page