Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Apr 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile Get info from the "str"

    --

    Hello.

    I have this function and I need to know what there is in the "str"
    -------------
    function sendPut(str, content) {
    var xhr = new XMLHttpRequest();
    xhr.open("PUT", "http://" + ipPort + "/" + str);
    xhr.send(content);
    }
    --------
    I haver tried
    document.writeln( str );
    and
    document.getElementById
    in different ways but not got any "str" data on my website.

    Anybody know ??

    MagI

    --

  • #2
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,026
    Thanks
    36
    Thanked 494 Times in 488 Posts

  • #3
    New to the CF scene
    Join Date
    Apr 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile

    --
    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
    --


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •