GSSDP.ResourceBrowser

g GObject.Object GObject.Object GSSDP.ResourceBrowser GSSDP.ResourceBrowser GObject.Object->GSSDP.ResourceBrowser

Subclasses:None

Methods

Inherited:GObject.Object (37)
Structs:GObject.ObjectClass (5)
class new (client, target)
  get_active ()
  get_client ()
  get_mx ()
  get_target ()
  rescan ()
  set_active (active)
  set_mx (mx)
  set_target (target)

Virtual Methods

Inherited:GObject.Object (7)
  do_resource_unavailable (usn)
  do_resource_update (usn, boot_id, next_boot_id)

Properties

Name Type Flags Short Description
active bool r/w True if the resource browser is active.
client GSSDP.Client r/w/co The associated client.
mx int r/w The maximum number of seconds in which to request other parties to respond.
target str r/w The discovery target.

Signals

Inherited:GObject.Object (1)
Name Short Description
resource-available The ::resource-available signal is emitted whenever a new resource has become available.
resource-unavailable The ::resource-unavailable signal is emitted whenever a resource is not available any more.
resource-update The ::resource-update signal is emitted whenever an UPnP 1.1 device is about to change it’s BOOTID.

Fields

Inherited:GObject.Object (1)
Name Type Access Description
parent_instance GObject.Object r  

Class Details

class GSSDP.ResourceBrowser(**kwargs)
Bases:GObject.Object
Abstract:No
Structure:GSSDP.ResourceBrowserClass
classmethod new(client, target)
Parameters:
Returns:

A new GSSDP.ResourceBrowser object.

Return type:

GSSDP.ResourceBrowser

target is a generic string the resource browser listens for on the SSDP bus. There are several possible targets such as

  • “ssdp:all” for everything
  • “upnp:rootdevice” for UPnP device entry points, not caring about the device type
  • The UUID of a specific device
  • Device types such as “urn:schemas-upnp-org:py:data::device<GSSDP.ResourceBrowser.props.device>:MediaServer:1”
  • Service types such as “urn:schemas-upnp-org:py:data::service<GSSDP.ResourceBrowser.props.service>:ContentDirectory:1”
get_active()
Returns:True if self is active.
Return type:bool
get_client()
Returns:The GSSDP.Client self is associated with.
Return type:GSSDP.Client
get_mx()
Returns:The used MX value.
Return type:int
get_target()
Returns:The browser target.
Return type:str
rescan()
Returns:True if rescaning has been started.
Return type:bool

Begins discovery if self is active and no discovery is performed. Otherwise does nothing.

set_active(active)
Parameters:active (bool) – True to activate self

(De)activates self.

set_mx(mx)
Parameters:mx (int) – The to be used MX value

Sets the used MX value of self to mx.

set_target(target)
Parameters:target (str) – The browser target

Sets the browser target of self to target.

do_resource_unavailable(usn) virtual
Parameters:usn (str) –
do_resource_update(usn, boot_id, next_boot_id) virtual
Parameters:
  • usn (str) –
  • boot_id (int) –
  • next_boot_id (int) –

Signal Details

GSSDP.ResourceBrowser.signals.resource_available(resource_browser, usn, locations)
Signal Name:

resource-available

Flags:

RUN_LAST

Parameters:
  • resource_browser (GSSDP.ResourceBrowser) – The object which received the signal
  • usn (str) – The USN of the discovered resource
  • locations ([str]) – A GLib.List of strings describing the locations of the discovered resource.

The ::resource-available signal is emitted whenever a new resource has become available.

GSSDP.ResourceBrowser.signals.resource_unavailable(resource_browser, usn)
Signal Name:

resource-unavailable

Flags:

RUN_LAST

Parameters:
  • resource_browser (GSSDP.ResourceBrowser) – The object which received the signal
  • usn (str) – The USN of the resource

The ::resource-unavailable signal is emitted whenever a resource is not available any more.

GSSDP.ResourceBrowser.signals.resource_update(resource_browser, usn, boot_id, next_boot_id)
Signal Name:

resource-update

Flags:

RUN_LAST

Parameters:
  • resource_browser (GSSDP.ResourceBrowser) – The object which received the signal
  • usn (str) – The USN of the resource
  • boot_id (int) – The current boot-id
  • next_boot_id (int) – The next boot-id

The ::resource-update signal is emitted whenever an UPnP 1.1 device is about to change it’s BOOTID.

Property Details

GSSDP.ResourceBrowser.props.active
Name:active
Type:bool
Default Value:False
Flags:READABLE, WRITABLE

Whether this browser is active or not.

GSSDP.ResourceBrowser.props.client
Name:client
Type:GSSDP.Client
Default Value:None
Flags:READABLE, WRITABLE, CONSTRUCT_ONLY

The GSSDP.Client to use.

GSSDP.ResourceBrowser.props.mx
Name:mx
Type:int
Default Value:3
Flags:READABLE, WRITABLE

The maximum number of seconds in which to request other parties to respond.

GSSDP.ResourceBrowser.props.target
Name:target
Type:str
Default Value:None
Flags:READABLE, WRITABLE

The discovery target.