int[] as an argument of a Remote Method

hannehomuth hannehomuth1 at gmx.de
Wed Jul 16 08:13:08 PDT 2008




hannehomuth wrote:
> 
> Hi Everyone,
> 
> If tried a while to set an int[] as an argument of one of my remote
> methods. But that doesn't work, I have tried it with a single int and that
> worked, but not with an array? Is they anything I've to set or configure
> before, or is it possible in general to send arrays overs the dbus. Here
> some code.
> 
> This is a method in my RemoteObject
> 
> public class Services implements DBusInterface {
> ....
> ....
> 
> public void setLedArray(int[] whichLeds, int status)
>     {
>         System.out.println("Call setMoreLeds");
>         int elementCount = whichLeds.length;
>         setMoreLeds(whichLeds, status);
>         System.out.println("Call ready");
>     }
> 
> private native void setMoreLeds(int[] whichLeds, int status);
> ....
> ....
> ....
> }
> 
> And here the call in the Client
> 
> int[] allLeds;
> ...
> ...
> ...
> remoteObj.setLedArray(allLeds, status);
> ...
> ...
> ...
> 
> The Array is initialized and has values, was tested.
> 
> Thx for suggestions
> 
> 


Hi there I think I've found the problem. Could it be that one Dbus Service
could only support a well known number of methods?. Because my method did'nt
work, I'd comment out all other methods, and look, there it worked. I
comment in one method after the other because I wanted to test if any other
method causes the crash. And it worked until I comment out the last method
(or in?? I deleted the /* ..... */ block :-)). If the number of methods in
my service raises to 15 it will not work anymore, because I get an Error
"the object /de/sourcepark/dbus/PicoLcd is not provided by any services". Is
this a known bug or is only a specified size of memory allocated by the
system for a service? 

Thx for suggestions.

-- 
View this message in context: http://www.nabble.com/int---as-an-argument-of-a-Remote-Method-tp18482014p18489708.html
Sent from the Free Desktop - dbus mailing list archive at Nabble.com.



More information about the dbus mailing list