public QStatus MethodCallSynch(string ifaceName, string methodName, MsgArgs args, Message replyMsg, uint timeout, byte flags) { return alljoyn_proxybusobject_methodcall_synch(_proxyBusObject, ifaceName, methodName, args.UnmanagedPtr, (UIntPtr)args.Length, replyMsg.UnmanagedPtr, timeout, flags); }
public string CallRemoteMethod() { using(AllJoyn.ProxyBusObject remoteObj = new AllJoyn.ProxyBusObject(sMsgBus, SERVICE_NAME, SERVICE_PATH, sSessionId)) { AllJoyn.InterfaceDescription alljoynTestIntf = sMsgBus.GetInterface(INTERFACE_NAME); if(alljoynTestIntf == null) { //throw new Exception("Client Failed to get test interface."); return ""; } else { remoteObj.AddInterface(alljoynTestIntf); AllJoyn.Message reply = new AllJoyn.Message(sMsgBus); AllJoyn.MsgArgs inputs = new AllJoyn.MsgArgs(2); inputs[0] = "Hello "; inputs[1] = "World!"; AllJoyn.QStatus status = remoteObj.MethodCallSynch(SERVICE_NAME, "cat", inputs, reply, 5000, 0); if(status) { //Debug.Log(SERVICE_NAME + ".cat(path=" + SERVICE_PATH + ") returned \"" + (string)reply[0] + "\""); return (string)reply[0]; } else { Debug.Log("MethodCall on " + SERVICE_NAME + ".cat failed"); return ""; } } } }