Results 1 to 4 of 4

Thread: ajax_sendevent with an additional payload

  1. #1
    Join Date
    Mar 2010
    Location
    Sydney, Australia
    Posts
    50

    Default ajax_sendevent with an additional payload

    I've built a WedApp on an Android tablet to trigger Girder Events using ajax_sendevent.lhtml. The App works well triggering Girder Events and Macro's but doesn't really address volume changes well.

    The javascript that applies to a Volume Slider is;

    function handler_Z4VolSlider_onStop(value){
    var value_str = escape("Z4Vol" + value);
    $.get("http://192.168.123.123/ajax_sendevent.lhtml?event="+ (value_str) +"&device="+escape("251"));
    }

    Currently I need to have an Event for each level of volume (say 0-50) and I have 6 zones; there must be a better way!

    Can ajax_sendevent pass an additional variable back to Girder - ie in addition to the "Event" being triggered and the "Device", can I send (value) in the above example? Is there a simple modification to ajax_sendevent required to do this?

    What I'm looking to do is use that variable in a script to send a volume setting to my Multizone amplifier. The script currently opens an IP socket and writes to that socket to adjust volume (stopped at 20 in this example);

    local socket = gip.Open('192.168.456.456',9621)
    if socket then
    socket:Write ('EVENT C[1].Z[4]!KeyPress Volume 20\r')
    end

  2. #2
    Join Date
    Oct 2005
    Posts
    307

    Default

    Look for my modified sendevent that allows payloads or the websocket I developed for constant 2 way communication between Girder and a browser.

  3. #3
    Join Date
    Mar 2010
    Location
    Sydney, Australia
    Posts
    50

    Default

    Thanks

    I can find the thread where you refer to the modified files (http://www.promixis.com/forums/showthread.php?20521) but the files are not attached;

    " The example file SendEvent.html from the included webpage only sends the event and device. To get it to pass additional info you have to edit SendEvent.html and girder.js to include more variables..."

    Can I ask that you send me your modified SendEvent.html and girder.js please?

  4. #4
    Join Date
    Oct 2005
    Posts
    307

Posting Permissions

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