function sendPut(str, content) { |
var xhr = new XMLHttpRequest(); |
xhr.open("PUT", "http://" + ipPort + "/" + str); |
xhr.send(content); |
To send messages to the software on the Lego NXT you need to pair and connect a bluetooth device with your NXT, then wrap the message in a mailbox message. The demo software uses mailbox '1' which is index 0. Essentially, you use the following format: |
* 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 |
Should be easy to do. But you will have to turn on web service on the phone and the phone as to send you ip address. I would set up ip connection directly and control over socket.
> --
> --
> You received this message because you are subscribed to the Cellbots.com Google
> Group.
> To post to this group, send email to cell...@googlegroups.com
> To unsubscribe from this group, send email to
> cellbots+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/cellbots?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups "Cellbots" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to cellbots+u...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>