EnglishFrenchSpanish

Ad


OnWorks favicon

gupnp-binding-tool - Online in the Cloud

Run gupnp-binding-tool in OnWorks free hosting provider over Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

This is the command gupnp-binding-tool that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

PROGRAM:

NAME


gupnp-binding-tool - creates C convenience wrappers for UPnP services

SYNOPSIS


gupnp-binding-tool [--prefix {PREFIX}] [--mode {client|server}] {SCPD file}

DESCRIPTION


gupnp-binding-tool takes a SCPD file and generates convenience C functions which call the
actual GUPnP functions. The client-side bindings can be seen as a service-specific version
of the GUPnPServiceProxy API and the service-side bindings are the same for GUPnPService.

These generated functions are less verbose and also safer as function call parameters are
correctly typed. Action, variable and query names are easier to get correct with bindings
(or at least the errors will be compile-time errors instead of run-time), and are also
available in editor autocompletion.

CLIENT SIDE BINDINGS


As an example, this action:

<action>
<name>DeletePortMapping</name>
<argumentList>
<argument>
<name>NewRemoteHost</name>
<direction>in</direction>
<relatedStateVariable>RemoteHost</relatedStateVariable>
</argument>
<argument>
<name>NewExternalPort</name>
<direction>in</direction>
<relatedStateVariable>ExternalPort</relatedStateVariable>
</argument>
<argument>
<name>NewProtocol</name>
<direction>in</direction>
<relatedStateVariable>PortMappingProtocol</relatedStateVariable>
</argument>
</argumentList>
</action>

Will generate the following synchronous client-side (control point) function:

static inline gboolean
igd_delete_port_mapping (GUPnPServiceProxy *proxy,
const gchar *in_new_remote_host,
const guint in_new_external_port,
const gchar *in_new_protocol,
GError **error);

As can be seen, the arguments have the correct types and are prefixed with the argument
direction.

gupnp-binding-tool generates both synchronous and asynchronous wrappers. The
igd_delete_port_mapping example above is the synchronous form, the asynchronous form is as
follows:

typedef void (*igd_delete_port_mapping_reply) (GUPnPServiceProxy *proxy,
GError *error,
gpointer userdata);

static inline GUPnPServiceProxyAction *
igd_delete_port_mapping_async (GUPnPServiceProxy *proxy,
const gchar *in_new_remote_host,
const guint in_new_external_port,
const gchar *in_new_protocol,
igd_delete_port_mapping_reply callback,
gpointer userdata);

The asynchronous form (implemented using gupnp_service_proxy_begin_action() and
gupnp_service_proxy_end_action()) will return without blocking and later invoke the
callback from the main loop when the reply is received.

The tool also creates bindings for state variable notifications. This state variable
definition:

<stateVariable sendEvents="yes">
<name>ExternalIPAddress</name>
<dataType>string</dataType>
</stateVariable>

will create this client binding that can be used to get notifications on
"ExternalIPAddress" changes:

typedef void
(*igd_external_ip_address_changed_callback) (GUPnPServiceProxy *proxy,
const gchar *external_ip_address,
gpointer userdata);

static inline gboolean
igd_external_ip_address_add_notify (GUPnPServiceProxy *proxy,
igd_external_ip_address_changed_callback callback,
gpointer userdata);

All of the examples were produced with gupnp-binding-tool --prefix igd --mode client
WANIPConnection.xml.

SERVER SIDE BINDINGS


The corresponding server bindings for the same UPnP action (DeletePortMapping) look like
this:

void
igd_delete_port_mapping_action_get (GUPnPServiceAction *action,
gchar **in_new_remote_host,
guint *in_new_external_port,
gchar **in_new_protocol);

gulong
igd_delete_port_mapping_action_connect (GUPnPService *service,
GCallback callback,
gpointer userdata);

The generated *_action_connect() function can be used to connect the action handler. The
*_action_get() and *_action_set() functions can then be used inside the action handler to
get/set action variables. If notified variables are modified, the *_variable_notify()
should be used to send the notifications (see below).

typedef gchar *(*igd_external_ip_address_query_callback) (GUPnPService *service,
gpointer userdata);

gulong
igd_external_ip_address_query_connect (GUPnPService *service,
igd_external_ip_address_query_callback callback,
gpointer userdata);
void
igd_external_ip_address_variable_notify (GUPnPService *service,
const gchar *external_ip_address);

The *_query_connect() function can be used to connect the service-specific query handler.
The return value of the handler is the returned state variable value.

All of the examples were produced with gupnp-binding-tool --prefix igd --mode server
WANIPConnection.xml.

COPYRIGHT


Copyright © 2007, 2008, 2009 OpenedHand Ltd, Nokia Corporation

Permission is granted to copy, distribute and/or modify this document under the terms of
the GNU Free Documentation License, Version 1.1 or any later version published by the Free
Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
Texts. You may obtain a copy of the GNU Free Documentation License from the Free Software
Foundation by visiting their Web site or by writing to:

The Free Software Foundation, Inc.,
59 Temple Place - Suite 330,
Boston, MA 02111-1307,
USA

Use gupnp-binding-tool online using onworks.net services


Free Servers & Workstations

Download Windows & Linux apps

  • 1
    XISMuS
    XISMuS
    ATTENTION: Cumulative update 2.4.3 has
    been released!! The update works for any
    previous 2.x.x version. If upgrading
    from version v1.x.x, please download and
    i...
    Download XISMuS
  • 2
    facetracknoir
    facetracknoir
    Modular headtracking program that
    supports multiple face-trackers, filters
    and game-protocols. Among the trackers
    are the SM FaceAPI, AIC Inertial Head
    Tracker ...
    Download facetracknoir
  • 3
    PHP QR Code
    PHP QR Code
    PHP QR Code is open source (LGPL)
    library for generating QR Code,
    2-dimensional barcode. Based on
    libqrencode C library, provides API for
    creating QR Code barc...
    Download PHP QR Code
  • 4
    Freeciv
    Freeciv
    Freeciv is a free turn-based
    multiplayer strategy game, in which each
    player becomes the leader of a
    civilization, fighting to obtain the
    ultimate goal: to bec...
    Download Freeciv
  • 5
    Cuckoo Sandbox
    Cuckoo Sandbox
    Cuckoo Sandbox uses components to
    monitor the behavior of malware in a
    Sandbox environment; isolated from the
    rest of the system. It offers automated
    analysis o...
    Download Cuckoo Sandbox
  • 6
    LMS-YouTube
    LMS-YouTube
    Play YouTube video on LMS (porting of
    Triode's to YouTbe API v3) This is
    an application that can also be fetched
    from
    https://sourceforge.net/projects/lms-y...
    Download LMS-YouTube
  • More »

Linux commands

  • 1
    a2crd
    a2crd
    a2crd - attempts the conversion of
    lyrics file into chordii input ...
    Run a2crd
  • 2
    a2j
    a2j
    a2j - Wrapper script to simulate
    a2jmidid's non-DBUS behaviour though
    a2jmidid actually being in DBUS mode ...
    Run a2j
  • 3
    coqdoc
    coqdoc
    coqdoc - A documentation tool for the
    Coq proof assistant ...
    Run coqdoc
  • 4
    coqide
    coqide
    coqide - The Coq Proof Assistant
    graphical interface ...
    Run coqide
  • 5
    g.gisenvgrass
    g.gisenvgrass
    g.gisenv - Outputs and modifies the
    user�s current GRASS variable settings.
    Prints all defined GRASS variables if no
    option is given. KEYWORDS: general,
    settin...
    Run g.gisenvgrass
  • 6
    g.guigrass
    g.guigrass
    g.gui - Launches a GRASS graphical user
    interface (GUI) session. Optionally
    updates default user interface settings.
    KEYWORDS: general, GUI, user interface ...
    Run g.guigrass
  • More »

Ad