GUPnP.Service

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

Subclasses:

None

Methods

Inherited:

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

Structs:

GObject.ObjectClass (5)

action_invoked (action)

freeze_notify ()

notify_failed (callback_urls, reason)

notify_value (variable, value)

query_variable (variable, value)

thaw_notify ()

Virtual Methods

Inherited:

GObject.Object (7)

do_action_invoked (action)

do_notify_failed (callback_urls, reason)

do_query_variable (variable, value)

Properties

Inherited:

GUPnP.ServiceInfo (7)

Name

Type

Flags

Short Description

root-device

GUPnP.RootDevice

r/w/co

The GUPnP.RootDevice

Signals

Inherited:

GObject.Object (1)

Name

Short Description

action-invoked

Emitted whenever an action is invoked.

notify-failed

Emitted whenever notification of a client fails.

query-variable

Emitted whenever service needs to know the value of variable.

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GUPnP.ServiceInfo

r

Class Details

class GUPnP.Service(**kwargs)
Bases:

GUPnP.ServiceInfo

Abstract:

No

Structure:

GUPnP.ServiceClass

Implementation of an UPnP service

GUPnP.Service allows for handling incoming actions and state variable notification. It implements the [class`GUPnP`.ServiceInfo] interface.

To implement a service, you can either connect to the [signal`GUPnP`.Service::action-invoked] and [signal`GUPnP`.Service::query-variable] or derive from the GUPnPService class and override the virtual functions [vfunc`GUPnP`.Service.action_invoked] and [vfunc`GUPnP`.Service.query_variable].

For more details, see the “Implementing UPnP devices” document

action_invoked(action)
Parameters:

action (GUPnP.ServiceAction) – a GUPnPServiceAction

Default handler for [signal`GUPnP`.Service::action_invoked]. See its documentation for details.

Can be overridden by child classes instead of connecting to the signal.

freeze_notify()

Stops sending out notifications to remote clients.

It causes new notifications to be queued up until [method`GUPnP`.Service.thaw_notify] is called.

notify_failed(callback_urls, reason)
Parameters:
  • callback_urls ([GLib.Uri]) – a list of call-back urls that failed the notification

  • reason (GLib.Error) – An error that describes why the notification failed

Default handler for [signal`GUPnP`.Service::notify_failed]. See its documentation for details.

Can be overridden by child classes instead of connecting to the signal.

notify_value(variable, value)
Parameters:
  • variable (str) – the name of the variable to notify

  • value (GObject.Value) – the value of the variable

Notifies remote clients that variable has changed to value.

query_variable(variable, value)
Parameters:
  • variable (str) – the name of the variable that was queried

  • value (GObject.Value) – a value that should be filled to the current value of variable

Default handler for [signal`GUPnP`.Service::query_variable]. See its documentation for details.

Can be overridden by child classes instead of connecting to the signal.

thaw_notify()

Sends out any pending notifications, and stops queuing of new ones.

do_action_invoked(action) virtual
Parameters:

action (GUPnP.ServiceAction) – a GUPnPServiceAction

Default handler for [signal`GUPnP`.Service::action_invoked]. See its documentation for details.

Can be overridden by child classes instead of connecting to the signal.

do_notify_failed(callback_urls, reason) virtual
Parameters:
  • callback_urls ([GLib.Uri]) – a list of call-back urls that failed the notification

  • reason (GLib.Error) – An error that describes why the notification failed

Default handler for [signal`GUPnP`.Service::notify_failed]. See its documentation for details.

Can be overridden by child classes instead of connecting to the signal.

do_query_variable(variable, value) virtual
Parameters:
  • variable (str) – the name of the variable that was queried

  • value (GObject.Value) – a value that should be filled to the current value of variable

Default handler for [signal`GUPnP`.Service::query_variable]. See its documentation for details.

Can be overridden by child classes instead of connecting to the signal.

Signal Details

GUPnP.Service.signals.action_invoked(service, action)
Signal Name:

action-invoked

Flags:

RUN_LAST, DETAILED

Parameters:

Emitted whenever an action is invoked. Handler should process action and must call either [method`GUPnP`.ServiceAction.return_success] or [method`GUPnP`.ServiceAction.return_error].

GUPnP.Service.signals.notify_failed(service, callback_url, reason)
Signal Name:

notify-failed

Flags:

RUN_LAST

Parameters:

Emitted whenever notification of a client fails.

GUPnP.Service.signals.query_variable(service, variable, value)
Signal Name:

query-variable

Flags:

RUN_LAST, DETAILED

Parameters:
Returns:

the location of the GObject.Value of the variable

Return type:

value: GObject.Value

Emitted whenever service needs to know the value of variable. Handler should fill value with the value of variable.

Property Details

GUPnP.Service.props.root_device
Name:

root-device

Type:

GUPnP.RootDevice

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The containing GUPnP.RootDevice.