Re: [Vala] need help



I'am just writting a simple program that aims at collecting gps data from the 
NeoFreerunner. I'm doing this using the vala programing language. I came into 
trouble while trying to read GetPosition() data from the 
org.freedesktop.Gypsy.Position interface. as the method GetPosition() returns 5 
values, I'hve decalred an array as followed
int[] data = positionobject.GetPosition() , unfortunately I'm getting the 
Segmentation fault Error.

A tuple is not an array. As you can see in the documentation
(http://git.freesmartphone.org/?p=specs.git;a=blob_plain;f=html/org.freedesktop.Gypsy.Position.html;hb=HEAD#GetPosition),
GetPosition delivers a 5-tuple – the correct signature for this method
hence is 

[DBus (name  "GetPosition")]
public abstract void get_position( out int fields, out int tstamp, out double lat, out double lon, out double 
alt) throws DBus.Error

That aside, I strongly recommend not using dynamic DBus, but
rather static DBus with interface classes. That way you'll get
a compiler error rather than a runtime SIGSEGV.

Or even better, use libfso-glib, which already contains all
those interface classes.

Cheers,

:M:


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