GUPnP.Service¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/co |
The |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted whenever an action is invoked. |
|
Emitted whenever notification of a client fails. |
|
Emitted whenever service needs to know the value of variable. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class GUPnP.Service(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
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
) – aGUPnPServiceAction
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 notificationreason (
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 notifyvalue (
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 queriedvalue (
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
) – aGUPnPServiceAction
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 notificationreason (
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 queriedvalue (
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:
- Parameters:
service (
GUPnP.Service
) – The object which received the signalaction (
GUPnP.ServiceAction
) – the invokedGUPnP.ServiceAction
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:
- Parameters:
service (
GUPnP.Service
) – The object which received the signalreason (
GLib.Error
) – a pointer to aGLib.Error
describing why the notify failed
Emitted whenever notification of a client fails.
- GUPnP.Service.signals.query_variable(service, variable, value)¶
- Signal Name:
query-variable
- Flags:
- Parameters:
service (
GUPnP.Service
) – The object which received the signalvariable (
str
) – the variable that is being queriedvalue (
GObject.Value
) – the location of theGObject.Value
of the variable
- 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:
- Default Value:
- Flags:
The containing
GUPnP.RootDevice
.