xMsg

xMsg

xmsg = motebus.xMsg();

xMsg contains 4 functions

The open function sets the current user as available

xmsg.open("ALIAS","PASSWORD","UNIQUE","CALLBACK");
"ALIAS" expects a string of the ID published on the network
"PASSWORD" expects a password string, can be left blank
"UNIQUE" expects a string of "true" or "false", permission for duplicated ALIAS ID
"CALLBACK" expects a defined function for callback action

The send function sends the message to the previously defined target

xmsg.send("TARGET","BODY","FILES","PRIO","TIMEOUT1","TIMEOUT2","CALLBACK");
"TARGET" expects a string of MMA, which contains "APPNAME"@"IP"
"BODY" expects a string of the message
"FILES" expects a string of the file path
"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
"CALLBACK" expects a defined function for callback action

The reply function is used to reply to the received message

xmsg.reply("HEAD","BODY","FILES","PRIO","TIMEOUT1","TIMEOUT2","CALLBACK");
"HEAD" expects a string of MMA, which contains "APPNAME"@"IP"
"BODY" expects a string of the message
"FILES" expects a string of the file path
"PRIO" expects an Integer to indicate the priority of request
"TIMEOUT1" expects an Integer to indicate the maximum sending time
"TIMEOUT2" expects an Integer to indicate the maximum reply waiting time
"CALLBACK" expects a defined function for callback action

The extract function is for saving the file received to the PATH you defined.

xmsg.extract("MESSAGE_ID","PATH","CALLBACK");
"MESSAGE_ID" expects a string of the senders DDN
"PATH" expects a string of the stored file path
"CALLBACK" expects a defined function for callback action