An MV message which is transferred between devices is a string (char *), which is in JSON format.
See http://en.wikipedia.org/wiki/JSON for details on JSON. JSON allows to specify values of following complex types (in addition to primitive types such as numbers and strings)
array (ordered list of values):
[ 1 2 3 ]
object (unordered list of key-value pairs):
{ "key1" : "value1", "key2", "value2" }
An MV message is an JSON object, which contains at least two keys: tag, src, and arg
"tag" represents the type of the message sent
"src" represents the name of the device which sent this message
"arg" represents the payload associated the given message tag; the fields of the "arg" may differ depending on the message tag.
"arg" contains at least three keys: "name", "funarg", "retid"
"name" is the name of the function provided by the device which the message is sent to.
"funarg" is the argument for this function call request -- since value of "funarg" key van be an arbitrarily-complex JSON value
"retid" is a token used by the caller to associate the return value to its original caller. Note that unlike sequential programs, there can be multiple function calls alive at the time time -- some calls may be invoking the same function
Actually, one message tag FUNC_CALL may be enough.
However, let's we have only support one tag FUNC_CALL. Then we would require second-leve tag which specifies "which function" to call. After all, we would need all above tags.