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

Class handling resource discovery.

After creating a browser and activating it, the [signalGSSDP.ResourceBrowser::resource-available] and [signalGSSDP.ResourceBrowser::resource-unavailable] signals will be emitted whenever the availability of a resource matching the specified discovery target changes. A discovery request is sent out automatically when activating the browser.

If the associated [classGSSDP.Client] was configured to support UDA 1.1, it will also emit the [signalGSSDP.ResourceBrowser::resource-update] if any of the UDA 1.1 devices on the nework annouced its upcoming BOOTID change.

classmethod new(client, target)
Parameters:
Returns:

A new GSSDP.ResourceBrowser object.

Return type:

GSSDP.ResourceBrowser

Create a new resource browser for target.

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 that is announced using SSDP

  • upnp:rootdevice for UPnP device entry points, not caring about a special device type

  • The UUID of a specific device

  • Device types, such as urn:schemas-upnp-org:device:MediaServer:1

  • Service types, such as urn:schemas-upnp-org:service:ContentDirectory:1

get_active()
Returns:

True if self is active.

Return type:

bool

Get whether the browser is currently active.

get_client()
Returns:

The GSSDP.Client self is associated with.

Return type:

GSSDP.Client

Get the GSSDP.Client this resource browser is using for SSDP.

get_mx()
Returns:

The used MX value.

Return type:

int

Get the current MX value.

get_target()
Returns:

The browser target.

Return type:

str

Get the current browse target.

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 [struct`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.

New in version 1.2.0.

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 [classGSSDP.Client] to use for listening to SSDP messages

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 this resource browser is looking for.