xRPC

Last updated 22 days ago

xRPC

xrpc = motebus.xRPC();

xRPC contains two functions

The publish function will publish the app which contains your functions on the motebus network.

xrpc.publish("APPNAME","MODULE");
"APPNAME" expects a string of the appname being defined in your program
"MODULE" expects a string of the function defined inside the appname, multi functions are possible.

The call function will call the function that has been published

xrpc.call("TARGET","FUNCTION","ARGUMENTS","PRIO","TIMEOUT1","TIMEOUT2");
"TARGET" expects a string of MMA, which contains "APPNAME"@"IP"
"FUNCTION" expects a string as the function name in App
"ARGUMENT" expects a list in dictionary format such as {"A":"12","B":"25"}
"PRIO" expects an Integer to indicate the priority of the request
"TIMEOUT1" expects an Integer to indicate the maximum sending time
"TIMEOUT2" expects an Integer to indicate the maximum reply waiting time

‚Äč