Introspection with GUPnP



Hello,

[I'm resending this as I originally sent it before I joined the
mailing list, and I've not seen it appear on the list archives. Sorry
if it dupes]

I'm hoping someone might be able to help me with the following.

I've been using the Glib::Object::Introspection perl module to call
into the GUPnP package, and it's been working really really well.
Well done guys.

However, when I call some of the routines on
https://developer.gnome.org/gupnp/unstable/GUPnPServiceProxy.html,
specifically ones that return a GError and other return values, I'm
getting assertion errors.

The following code snippet demonstrates the issue. I'm using
Glib::Object::Introspection 0.027, gboject-introspection 1.41.4 and
gupnp 0.20.12.

use Glib::Object::Introspection;

my $next_state = 1;

Glib::Object::Introspection->setup(
    basename => 'GUPnP',
    version => '1.0',
    package => 'GUPnP',
    );

Glib::Object::Introspection->setup(
    basename => 'GSSDP',
    version => '1.0',
    package => 'GSSDP',
    );


my $main_loop = Glib::MainLoop->new(undef, 0);

my $context = GUPnP::Context->new(undef, undef, 0);

my $control_point = GUPnP::ControlPoint->new($context,

'urn:schemas-upnp-org:device:DimmableLight:1');

$control_point->signal_connect('device-proxy-available' => \&discovered);

GSSDP::ResourceBrowser::set_active($control_point, 1);

$main_loop->run;


my @services;

sub discovered
{
    my ($control_point, $device_proxy) = @_;

    print "Discovered: ". $device_proxy->get_friendly_name . "\n";

    my $service_proxy =
        $device_proxy->get_service('urn:schemas-upnp-org:service:SwitchPower:1');

    my $service_action_proxy = $service_proxy->begin_action_list (

        'SetTarget',

        ['NewTargetValue'],
        [Glib::Object::Introspection::GValueWrapper->new ('Glib::Boolean',
                                                          $next_state ? 1 : 0)],

        \&action_callback,

        undef
        );

    push @services,  $service_proxy;

    $next_state = !$next_state;
}

sub action_callback
{
    my ($service_proxy, $service_proxy_action) = @_;

    print "Action complete\n";

    # In newer GUPnP I think this can be undef
    my $error =  Glib::File::Error->new ('io', '');

    my ($success, $out_values) = $service_proxy->end_action_list
        ($service_proxy_action,
         $error,
         [ ], [ ]
        );
}

Run it with a gupnp-network-light running, and the output I get is:

Discovered: GUPnP Network Light
Action complete
**
ERROR:gperl-i11n-marshal-arg.c:116:sv_to_arg: assertion failed:
(transfer == GI_TRANSFER_EVERYTHING)
Aborted (core dumped)

I have tried commenting out the assertions, and it runs further, but
then I'm getting a double-free error in gperl-i11n-marshal-interface.c
around line 116 where g_boxed_free is called.

I'm guessing there's something not expected going on.

Can anyway suggest how we can get this call working?

Thanks in advance,

Nick Glencross


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]