The interface with two return values :
@BusInterface(name = "com.cykj.alljoyn.servicetest.MutipleRVInterface")
public interface MutipleRVInterface {
//多返回值
public class Values {
@Position(0)
public int startTime;
@Position(1)
public int endTime;
}
@BusMethod(replySignature = "ii")
public Values getTime() throws BusException;
}
A class implements the interface and BusObject and on the AllJoyn Service:
class ServiceTest implements MutipleRVInterface, BusObject {
@Override
public Values getTime() throws BusException {
Values t = new Values ();
t.startTime = 11;
t.endTime = 22;
return t;
}
}
The client uses the service object:
try {
MutipleRVInterface.Values time = mutipleRVInterface.getTime();
logResult(time.startTime + "-" + time.endTime);
} catch (BusException e) {
LogResult(e.getMessage());
Log.e(TAG, e.getMessage());
e.printStackTrace();
}
When I called the method of MutipleRVInterface,an exception is thrown.
02-20 14:00:17.209 20695-20954/com.cykj.alljoyn.clienttest W/System.err: org.alljoyn.bus.ErrorReplyBusException: org.alljoyn.Bus.ErStatus
02-20 14:00:17.209 20695-20954/com.cykj.alljoyn.clienttest W/System.err: at org.alljoyn.bus.ProxyBusObject.methodCall(Native Method)
02-20 14:00:17.210 20695-20954/com.cykj.alljoyn.clienttest W/System.err: at org.alljoyn.bus.ProxyBusObject.access$300(ProxyBusObject.java:35)
02-20 14:00:17.210 20695-20954/com.cykj.alljoyn.clienttest W/System.err: at org.alljoyn.bus.ProxyBusObject$Handler.invoke(ProxyBusObject.java:264)
02-20 14:00:17.210 20695-20954/com.cykj.alljoyn.clienttest W/System.err: at $Proxy1.getTime(Native Method)
02-20 14:00:17.210 20695-20954/com.cykj.alljoyn.clienttest W/System.err: at com.cykj.alljoyn.clienttest.BusMethodTActivity$BusHandler.handleMessage(BusMethodTActivity.java:584)
02-20 14:00:17.210 20695-20954/com.cykj.alljoyn.clienttest W/System.err: at android.os.Handler.dispatchMessage(Handler.java:110)
02-20 14:00:17.211 20695-20954/com.cykj.alljoyn.clienttest W/System.err: at android.os.Looper.loop(Looper.java:193)
02-20 14:00:17.211 20695-20954/com.cykj.alljoyn.clienttest W/System.err: at android.os.HandlerThread.run(HandlerThread.java:61)
How can I solve the problem? where is wrong in the code?
ps:This is an Android Project with using AllJoyn Framework. And I am not very good at English, the question may not be described clear.Try to be understanding.