HOME Forums Gateways EZSrve EZSrve XML Port?

Viewing 10 posts - 16 through 25 (of 25 total)
  • Author
    Posts
  • Anonymous
    Inactive
    Post count: 23

    Paul:

    To be more correct, it’s “RESTART” rather than “RESET” that I do, and then the Java code won’t get a response until after I run the Utility Suite connect/disconnect.

    grif091:

    I tried moving the BufferedReader creation to before the println (that sends the request). No change.

    David

    Anonymous
    Inactive
    Post count: 1001

    I found that the SHN Utility creates a separate thread for reading from EZSrve, before it writes the GetRevision string. This thread handles all input from EZSrve. Not suggesting this is a requirement, just passing on the differences. Except for the obvious of one being VB and the other Java, I don’t see anything other than the GetRevision command being written to EZSrve. In response to requests from the various GUI objects, commands for listing macros or timers, for example are written but that is far into the Utility logic.

    Perhaps reading a full line (readline ?) rather than a single byte would work better. Really just grabbing at straws. My Java books are at a different house so I am doing this from a distant memory.

    Anonymous
    Inactive
    Post count: 408

    Here is another try. If this doesn’t work, send me an email, hopefully with an IP address and if you can open port 8002 for a time. I have tried this code below on several security setups, and it should work fine.


    try {
    Socket EZSrveSocket = new Socket("192.168.0.107", 8002);

    PrintStream out = new PrintStream(EZSrveSocket.getOutputStream());
    DataInputStream in = new DataInputStream( EZSrveSocket.getInputStream());

    out.print("GetRevision");

    long endTime = System.currentTimeMillis()+5000;

    System.out.println("Received:");
    while (System.currentTimeMillis()<endTime) {
    System.out.println(in.readLine()); // Read one line and output it
    }
    in.close();
    }
    catch(Exception e) {
    System.out.println("Failure:" + e);
    }
    Anonymous
    Inactive
    Post count: 23

    Yes, that last one works, even immediately after a RESTART (without having to use the Utility Suite first). It does produce a deprecation warning at compile time, but it’s a huge step in the right direction. Now to figure out what the real difference is..

    David

    Anonymous
    Inactive
    Post count: 408

    Beyond just cleaning up an element or two, the only real substantive difference is the use of DataInputStream. To make sure that is the change, alter the code back to BufferedReader and see if the problem returns.

    Anonymous
    Inactive
    Post count: 23

    Paul:

    I’ve concluded that using DataInputStream vs. BufferedReader makes no difference.

    What DOES make a difference is the case of the “C” in Command (vs. command).

    Specifically, if after a restart of my EZSrve, I send:

    GetRevision

    it works every time.

    If, after a restart, I send:

    GetRevision

    It will fail every time.

    I even sent the upper-case Command two more times (total of three) after a restart, and I get no reponse. Then sent the lower-case command once, and it worked. Then sent the upper-case Command again, and it worked.

    David

    Anonymous
    Inactive
    Post count: 1001

    Now there is one for the books. What in theory should have been a failure all the time works some of the time. Pulled the following from the XML syntax rules…


    XML Tags are Case Sensitive
    XML elements are defined using XML tags.

    XML tags are case sensitive. With XML, the tag is different from the tag .

    Opening and closing tags must be written with the same case:



    All the EZSrve XML Samples I looked at show in lower case. Now the question is not why failed, but why it worked later on. Amazing!!

    Anonymous
    Inactive
    Post count: 23

    But… the EZSrve “Quick-Start Guide” that came with the unit shows “Command” (with upper-case C) in the little box at the bottom right of page 1.

    David

    Anonymous
    Inactive
    Post count: 1001

    Good catch. With more than 150 examples between the XML Samples files and the EZSrve/EZBridge Reference Manual showing , I would take the Quick Start Guide chart to be a typo. However, I don’t speak for SHN so we will have to wait for Paul to tell us if the example in the Quick Start Guide is controlling. If is to be a synonym for , then EZSrve should support all Tags starting with caps as synonyms. Supporting some tags as lower case only and some with leading caps or lower case would just be confusing.

    Anonymous
    Inactive
    Post count: 23

    Speaking of details of the messages, is the “EZBridge Manual.pdf” revision 1.4 dated 6/12/07 the most current? How up-to-date is it?

    David

Viewing 10 posts - 16 through 25 (of 25 total)
  • You must be logged in to reply to this topic.