GUPnP.ServiceProxy

g GObject.Object GObject.Object GUPnP.ServiceInfo GUPnP.ServiceInfo GObject.Object->GUPnP.ServiceInfo GUPnP.ServiceProxy GUPnP.ServiceProxy GUPnP.ServiceInfo->GUPnP.ServiceProxy

Subclasses:

None

Methods

Inherited:

GUPnP.ServiceInfo (11), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

add_notify (variable, type, callback, *user_data)

add_raw_notify (callback, *user_data)

call_action (action, cancellable)

call_action_async (action, cancellable, callback, *user_data)

call_action_finish (result)

get_subscribed ()

remove_notify (variable, callback, *user_data)

remove_raw_notify (callback, *user_data)

set_credentials (user, password)

set_subscribed (subscribed)

Virtual Methods

Inherited:

GObject.Object (7)

do_subscription_lost (reason)

Properties

Inherited:

GUPnP.ServiceInfo (7)

Name

Type

Flags

Short Description

subscribed

bool

r/w

Whether we are subscribed to this service

Signals

Inherited:

GObject.Object (1)

Name

Short Description

subscription-lost

Emitted whenever the subscription to this service has been lost due to an error condition.

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GUPnP.ServiceInfo

r

Class Details

class GUPnP.ServiceProxy(**kwargs)
Bases:

GUPnP.ServiceInfo

Abstract:

No

Structure:

GUPnP.ServiceProxyClass

Proxy class for remote services.

GUPnP.ServiceProxy sends commands to a remote UPnP service and handles incoming event notifications.

add_notify(variable, type, callback, *user_data)
Parameters:
Returns:

True on success.

Return type:

bool

Sets up callback to be called whenever a change notification for variable is recieved.

New in version 0.20.12.

add_raw_notify(callback, *user_data)
Parameters:
Returns:

True on success.

Return type:

bool

Get a notification for anything that happens on the peer.

value in callback will be of type GObject.TYPE_POINTER and contain the pre-parsed [type`libxml2`.Doc]. Do NOT free or modify this document.

New in version 0.20.12.

call_action(action, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

None on error, action if successful.

Return type:

GUPnP.ServiceProxyAction or None

Synchronously call the action on the remote UPnP service.

New in version 1.2.0.

call_action_async(action, cancellable, callback, *user_data)
Parameters:

Start a call on the remote UPnP service using the pre-configured action. Use GUPnP.ServiceProxy.call_action_finish() in the callback to finalize the call and gupnp_service_proxy_action_get_result(), GUPnP.ServiceProxyAction.get_result_hash() or GUPnP.ServiceProxyAction.get_result_list() to extract the result of the remote call.

New in version 1.2.0.

call_action_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult

Raises:

GLib.Error

Returns:

None, if the call had an error, the action otherwise.

Return type:

GUPnP.ServiceProxyAction or None

Finish an asynchronous call initiated with GUPnP.ServiceProxy.call_action_async().

New in version 1.2.0.

get_subscribed()
Returns:

True if we are subscribed to this service, otherwise False.

Return type:

bool

Returns if we are subscribed to this service.

remove_notify(variable, callback, *user_data)
Parameters:
Returns:

True on success.

Return type:

bool

Cancels the variable change notification for callback and user_data.

Up to version 0.20.9 this function must not be called directlya or indirectly from a GUPnP.ServiceProxyNotifyCallback associated with this service proxy, even if it is for another variable. In later versions such calls are allowed.

remove_raw_notify(callback, *user_data)
Parameters:
Returns:

True on success.

Return type:

bool

Cancels the variable change notification for callback and user_data.

This function must not be called directly or indirectly from a GUPnP.ServiceProxyNotifyCallback associated with this service proxy, even if it is for another variable.

set_credentials(user, password)
Parameters:
  • user (str) – user name for authentication

  • password (str) – user password for authentication

Sets user and password for authentication

New in version 1.6.4.

set_subscribed(subscribed)
Parameters:

subscribed (bool) – True to subscribe to this service

(Un)subscribes to this service.

The relevant messages are not immediately sent but queued. If you want to unsubcribe from this service because the application is quitting, rely on automatic synchronised unsubscription on object destruction instead.

do_subscription_lost(reason) virtual
Parameters:

reason (GLib.Error) –

Signal Details

GUPnP.ServiceProxy.signals.subscription_lost(service_proxy, error)
Signal Name:

subscription-lost

Flags:

RUN_LAST

Parameters:

Emitted whenever the subscription to this service has been lost due to an error condition.

Property Details

GUPnP.ServiceProxy.props.subscribed
Name:

subscribed

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

Whether we are subscribed to this service.