--
Hi.
I got this suggestion.
Code:
function sendPut(str, content) {
alert('Contents of "str": '+str);
var xhr = new XMLHttpRequest();
xhr.open("PUT", "http://" + ipPort + "/" + str);
xhr.send(content);
}
The code "alert('Contents of "str": '+str);" worked almost.
It alert "command.php" from the "sendAction" function.
The command.php have this wiki.
http://code.google.com/p/cellbots/so...mentation.wiki
But I need to know what is in the "str"
It is supposed to be a mailbox message using message wrapping and have this kind of structure
----------------
* Byte 0: 0x80 (direct command with no response from the NXT)
* Byte 1: 0x09 (message command type)
* Byte 2: 0x01 (Mailbox number, 0-9)
* Byte 3: Message Size (including null terminating character)
* Byte 4-N: Message data, where N = Message size + 3 and ends with a null terminating character
-----------------
http://goo.gl/PiqRI
You can read about the message wrapping in PDF Appendix 3 / page 9.
It is a working android code by google and it is called "Cellbots"
http://www.cellbots.com/
http://goo.gl/qKs4p
Here is the code
http://code.google.com/p/cellbots/so...ava%2Fcellbots
And here is the index.html code with my function.
http://code.google.com/p/cellbots/so...ets/index.html
Thanks for your input but this is a hard one.
Is it possible to get the data out of the command.php ?
Regards Magnus
--