GUPnP Reference Manual | ||||
---|---|---|---|---|
GUPnPServiceProxy; GUPnPServiceProxyAction; void (*GUPnPServiceProxyActionCallback) (GUPnPServiceProxy *proxy, GUPnPServiceProxyAction *action, gpointer user_data); void (*GUPnPServiceProxyNotifyCallback) (GUPnPServiceProxy *proxy, const char *variable, GValue *value, gpointer user_data); gboolean gupnp_service_proxy_send_action (GUPnPServiceProxy *proxy, const char *action, GError **error, ...); gboolean gupnp_service_proxy_send_action_valist (GUPnPServiceProxy *proxy, const char *action, GError **error, va_list var_args); gboolean gupnp_service_proxy_send_action_hash (GUPnPServiceProxy *proxy, const char *action, GError **error, GHashTable *in_hash, GHashTable *out_hash); GUPnPServiceProxyAction* gupnp_service_proxy_begin_action (GUPnPServiceProxy *proxy, const char *action, GUPnPServiceProxyActionCallback callback, gpointer user_data, ...); GUPnPServiceProxyAction* gupnp_service_proxy_begin_action_valist (GUPnPServiceProxy *proxy, const char *action, GUPnPServiceProxyActionCallback callback, gpointer user_data, va_list var_args); GUPnPServiceProxyAction* gupnp_service_proxy_begin_action_hash (GUPnPServiceProxy *proxy, const char *action, GUPnPServiceProxyActionCallback callback, gpointer user_data, GHashTable *hash); gboolean gupnp_service_proxy_end_action (GUPnPServiceProxy *proxy, GUPnPServiceProxyAction *action, GError **error, ...); gboolean gupnp_service_proxy_end_action_valist (GUPnPServiceProxy *proxy, GUPnPServiceProxyAction *action, GError **error, va_list var_args); gboolean gupnp_service_proxy_end_action_hash (GUPnPServiceProxy *proxy, GUPnPServiceProxyAction *action, GError **error, GHashTable *hash); void gupnp_service_proxy_cancel_action (GUPnPServiceProxy *proxy, GUPnPServiceProxyAction *action); gboolean gupnp_service_proxy_add_notify (GUPnPServiceProxy *proxy, const char *variable, GType type, GUPnPServiceProxyNotifyCallback callback, gpointer user_data); gboolean gupnp_service_proxy_remove_notify (GUPnPServiceProxy *proxy, const char *variable, GUPnPServiceProxyNotifyCallback callback, gpointer user_data); void gupnp_service_proxy_set_subscribed (GUPnPServiceProxy *proxy, gboolean subscribed); gboolean gupnp_service_proxy_get_subscribed (GUPnPServiceProxy *proxy);
GUPnPServiceProxy sends commands to a remote UPnP service and handles incoming event notifications. GUPnPServiceProxy implements the GUPnPServiceInfo interface.
typedef struct _GUPnPServiceProxy GUPnPServiceProxy;
This struct contains private data only, and should be accessed using the functions below.
typedef struct _GUPnPServiceProxyAction GUPnPServiceProxyAction;
Opaque structure for holding in-progress action data.
void (*GUPnPServiceProxyActionCallback) (GUPnPServiceProxy *proxy, GUPnPServiceProxyAction *action, gpointer user_data);
Callback notifying that action
on proxy
has returned and
gupnp_service_proxy_end_action()
etc can be called.
|
The GUPnPServiceProxy action is called from
|
|
The GUPnPServiceProxyAction in progress |
|
User data |
void (*GUPnPServiceProxyNotifyCallback) (GUPnPServiceProxy *proxy, const char *variable, GValue *value, gpointer user_data);
Callback notifying that the state variable variable
on proxy
has changed to
value
.
|
The GUPnPServiceProxy the notification originates from |
|
The name of the variable being notified |
|
The GValue of the variable being notified |
|
User data |
gboolean gupnp_service_proxy_send_action (GUPnPServiceProxy *proxy, const char *action, GError **error, ...);
Sends action action
with parameters Varargs
to the service exposed by
proxy
synchronously. If an error occurred, error
will be set. In case of
a UPnPError the error code will be the same in error
.
|
A GUPnPServiceProxy |
|
An action |
|
The location where to store any error, or NULL
|
|
tuples of in parameter name, in parameter type, and in parameter
value, followed by NULL , and then tuples of out parameter name,
out parameter type, and out parameter value location, terminated with NULL
|
Returns : |
TRUE if sending the action was succesful.
|
gboolean gupnp_service_proxy_send_action_valist (GUPnPServiceProxy *proxy, const char *action, GError **error, va_list var_args);
See gupnp_service_proxy_send_action()
; this version takes a va_list for
use by language bindings.
|
A GUPnPServiceProxy |
|
An action |
|
The location where to store any error, or NULL
|
|
va_list of tuples of in parameter name, in parameter type, and in
parameter value, followed by NULL , and then tuples of out parameter name,
out parameter type, and out parameter value location
|
Returns : |
TRUE if sending the action was succesful.
|
gboolean gupnp_service_proxy_send_action_hash (GUPnPServiceProxy *proxy, const char *action, GError **error, GHashTable *in_hash, GHashTable *out_hash);
See gupnp_service_proxy_send_action()
; this version takes a pair of
GHashTables for runtime determined parameter lists.
|
A GUPnPServiceProxy |
|
An action |
|
The location where to store any error, or NULL
|
|
A GHashTable of in parameter name and GValue pairs |
|
A GHashTable of out parameter name and initialized GValue pairs |
Returns : |
TRUE if sending the action was succesful.
|
GUPnPServiceProxyAction* gupnp_service_proxy_begin_action (GUPnPServiceProxy *proxy, const char *action, GUPnPServiceProxyActionCallback callback, gpointer user_data, ...);
Sends action action
with parameters Varargs
to the service exposed by
proxy
asynchronously, calling callback
on completion. From callback
, call
gupnp_service_proxy_end_action()
to check for errors, to retrieve return
values, and to free the GUPnPServiceProxyAction.
|
A GUPnPServiceProxy |
|
An action |
|
The callback to call when sending the action has succeeded or failed |
|
User data for callback
|
|
tuples of in parameter name, in parameter type, and in parameter
value, terminated with NULL
|
Returns : |
A GUPnPServiceProxyAction handle. This will
be freed when calling gupnp_service_proxy_cancel_action() or
gupnp_service_proxy_end_action_valist() .
|
GUPnPServiceProxyAction* gupnp_service_proxy_begin_action_valist (GUPnPServiceProxy *proxy, const char *action, GUPnPServiceProxyActionCallback callback, gpointer user_data, va_list var_args);
See gupnp_service_proxy_begin_action()
; this version takes a va_list for
use by language bindings.
|
A GUPnPServiceProxy |
|
An action |
|
The callback to call when sending the action has succeeded or failed |
|
User data for callback
|
|
A va_list of tuples of in parameter name, in parameter type, and in parameter value |
Returns : |
A GUPnPServiceProxyAction handle. This will
be freed when calling gupnp_service_proxy_cancel_action() or
gupnp_service_proxy_end_action_valist() .
|
GUPnPServiceProxyAction* gupnp_service_proxy_begin_action_hash (GUPnPServiceProxy *proxy, const char *action, GUPnPServiceProxyActionCallback callback, gpointer user_data, GHashTable *hash);
See gupnp_service_proxy_begin_action()
; this version takes a GHashTable
for runtime generated parameter lists.
|
A GUPnPServiceProxy |
|
An action |
|
The callback to call when sending the action has succeeded or failed |
|
User data for callback
|
|
A GHashTable of in parameter name and GValue pairs |
Returns : |
A GUPnPServiceProxyAction handle. This will
be freed when calling gupnp_service_proxy_cancel_action() or
gupnp_service_proxy_end_action_hash() .
|
gboolean gupnp_service_proxy_end_action (GUPnPServiceProxy *proxy, GUPnPServiceProxyAction *action, GError **error, ...);
Retrieves the result of action
. The out parameters in Varargs
will be
filled in, and if an error occurred, error
will be set. In case of
a UPnPError the error code will be the same in error
.
|
A GUPnPServiceProxy |
|
A GUPnPServiceProxyAction handle |
|
The location where to store any error, or NULL
|
|
tuples of out parameter name, out parameter type, and out parameter
value location, terminated with NULL . The out parameter values should be
freed after use
|
Returns : |
TRUE on success.
|
gboolean gupnp_service_proxy_end_action_valist (GUPnPServiceProxy *proxy, GUPnPServiceProxyAction *action, GError **error, va_list var_args);
See gupnp_service_proxy_end_action()
; this version takes a va_list for
use by language bindings.
|
A GUPnPServiceProxy |
|
A GUPnPServiceProxyAction handle |
|
The location where to store any error, or NULL
|
|
A va_list of tuples of out parameter name, out parameter type, and out parameter value location. The out parameter values should be freed after use |
Returns : |
TRUE on success.
|
gboolean gupnp_service_proxy_end_action_hash (GUPnPServiceProxy *proxy, GUPnPServiceProxyAction *action, GError **error, GHashTable *hash);
See gupnp_service_proxy_end_action()
; this version takes a GHashTable
for runtime generated parameter lists.
|
A GUPnPServiceProxy |
|
A GUPnPServiceProxyAction handle |
|
The location where to store any error, or NULL
|
|
A GHashTable of out parameter name and initialised GValue pairs |
Returns : |
TRUE on success.
|
void gupnp_service_proxy_cancel_action (GUPnPServiceProxy *proxy, GUPnPServiceProxyAction *action);
Cancels action
, freeing the action
handle.
|
A GUPnPServiceProxy |
|
A GUPnPServiceProxyAction handle |
gboolean gupnp_service_proxy_add_notify (GUPnPServiceProxy *proxy, const char *variable, GType type, GUPnPServiceProxyNotifyCallback callback, gpointer user_data);
Sets up callback
to be called whenever a change notification for
variable
is recieved.
|
A GUPnPServiceProxy |
|
The variable to add notification for |
|
The type of the variable |
|
The callback to call when variable changes
|
|
User data for callback
|
Returns : |
TRUE on success.
|
gboolean gupnp_service_proxy_remove_notify (GUPnPServiceProxy *proxy, const char *variable, GUPnPServiceProxyNotifyCallback callback, gpointer user_data);
Cancels the variable change notification for callback
and user_data
.
|
A GUPnPServiceProxy |
|
The variable to add notification for |
|
The callback to call when variable changes
|
|
User data for callback
|
Returns : |
TRUE on success.
|
void gupnp_service_proxy_set_subscribed (GUPnPServiceProxy *proxy, gboolean subscribed);
(Un)subscribes to this service.
Note that 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.
|
A GUPnPServiceProxy |
|
TRUE to subscribe to this service
|
gboolean gupnp_service_proxy_get_subscribed (GUPnPServiceProxy *proxy);
Returns if we are subscribed to this service.
|
A GUPnPServiceProxy |
Returns : |
TRUE if we are subscribed to this service, otherwise FALSE .
|
"subscribed"
property"subscribed" gboolean : Read / Write
Whether we are subscribed to this service.
Default value: FALSE
"subscription-lost"
signalvoid user_function (GUPnPServiceProxy *proxy, gpointer error, gpointer user_data) : Run Last
Emitted whenever the subscription to this service has been lost due to an error condition.
|
The GUPnPServiceProxy that received the signal |
|
A pointer to a GError describing why the subscription has been lost |
|
user data set when the signal handler was connected. |