GSSDP.ResourceGroup

g GObject.Object GObject.Object GSSDP.ResourceGroup GSSDP.ResourceGroup GObject.Object->GSSDP.ResourceGroup

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (client)

add_resource (target, usn, locations)

add_resource_simple (target, usn, location)

get_available ()

get_client ()

get_max_age ()

get_message_delay ()

remove_resource (resource_id)

set_available (available)

set_max_age (max_age)

set_message_delay (message_delay)

update (new_boot_id)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

available

bool

r/w

Whether this group of resources is available or not.

client

GSSDP.Client

r/w/co

The associated client.

max-age

int

r/w

The number of seconds advertisements are valid.

message-delay

int

r/w

The minimum number of milliseconds between SSDP messages.

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class GSSDP.ResourceGroup(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

GSSDP.ResourceGroupClass

Class for controlling resource announcement.

A GSSDP.ResourceGroup is a group of SSDP resources whose availability can be controlled as one. This is useful when one needs to announce a single service as multiple SSDP resources (UPnP does this for example).

classmethod new(client)
Parameters:

client (GSSDP.Client) – The GSSDP.Client to associate with

Returns:

A new GSSDP.ResourceGroup object.

Return type:

GSSDP.ResourceGroup

add_resource(target, usn, locations)
Parameters:
  • target (str) – The resource’s target

  • usn (str) – The resource’s USN

  • locations ([str]) – A GLib.List of the resource’s locations

Returns:

The ID of the added resource.

Return type:

int

Add an additional resource to announce in this resource group.

Adds a resource with target target, USN usn, and locations locations to self. If the resource group is set [propertyGSSDP.ResourceGroup:available], it will be announced right away.

If your resource only has one location, you can use [methodGSSDP.ResourceGroup.add_resource_simple] instead.

The resource id that is returned by this function can be used with [methodGSSDP.ResourceGroup.remove_resource].

add_resource_simple(target, usn, location)
Parameters:
  • target (str) – The resource’s target

  • usn (str) – The resource’s USN

  • location (str) – The resource’s location

Returns:

The ID of the added resource.

Return type:

int

Adds a resource with target target, USN usn, and location location to self. If the resource group is set [propertyGSSDP.ResourceGroup:available], it will be announced right away.

The resource id that is returned by this function can be used with [methodGSSDP.ResourceGroup.remove_resource].

get_available()
Returns:

True if self is available (advertised).

Return type:

bool

get_client()
Returns:

The GSSDP.Client self is associated with.

Return type:

GSSDP.Client

get_max_age()
Returns:

The number of seconds advertisements are valid.

Return type:

int

get_message_delay()
Returns:

the minimum time between each SSDP message in ms.

Return type:

int

remove_resource(resource_id)
Parameters:

resource_id (int) – The ID of the resource to remove

Removes the resource with ID resource_id from self.

set_available(available)
Parameters:

available (bool) – True if self should be available (advertised)

Sets self s availability to available. Changing self s availability causes it to announce its new state to listening SSDP clients.

set_max_age(max_age)
Parameters:

max_age (int) – The number of seconds advertisements are valid

Sets the number of seconds advertisements are valid to max_age.

set_message_delay(message_delay)
Parameters:

message_delay (int) – The message delay in ms.

Sets the minimum time between each SSDP message.

update(new_boot_id)
Parameters:

new_boot_id (int) – The new boot id of the device

Send an ssdp::update message if the underlying GSSDPClient is running the UDA 1.1 protocol. Does nothing otherwise.

New in version 1.2.0.

Property Details

GSSDP.ResourceGroup.props.available
Name:

available

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

Whether this group of resources is available or not.

GSSDP.ResourceGroup.props.client
Name:

client

Type:

GSSDP.Client

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The GSSDP.Client to use.

GSSDP.ResourceGroup.props.max_age
Name:

max-age

Type:

int

Default Value:

1800

Flags:

READABLE, WRITABLE

The number of seconds our advertisements are valid.

GSSDP.ResourceGroup.props.message_delay
Name:

message-delay

Type:

int

Default Value:

120

Flags:

READABLE, WRITABLE

The minimum number of milliseconds between SSDP messages. The default is 120 based on DLNA specification.