Shop OBEX P1 Docs P2 Docs Learn Events
eb500 and eb500_test give odd error — Parallax Forums

eb500 and eb500_test give odd error

Don FrenchDon French Posts: 126
edited 2007-07-26 16:38 in General Discussion
I am using virtually unmodified versions of eb500 and eb500_test that I downloaded from the yahoo site and I get a NPE on the 'return true' line of the response( ) method of eb500.

This happens on the first call to eb500.response( ) from this line in eb500_test:

while (!eb.response()) ;

The first command sent to the device, the connect command, appears in the Messages window but nothing else is sent there.

Any ideas on this one, Peter? I guess I don't have to post the code this time because you already have it.

Comments

  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-07-26 05:02
    What stands NPE for?
    regards peter
  • Don FrenchDon French Posts: 126
    edited 2007-07-26 12:02
    NPE = Null Pointer Exception
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-07-26 12:21
    Don,
    I just downloaded the eb500_test program to a javelin with nothing attached to it.
    I got a IndexOutOfBounds error. So I changed the response() method to make sure
    the receive buffer·index is never·too large.
    Try the attached eb500.java
    Note on the eb500_test.java: All possible commands are listed in main() but obviously
    that is not the way to test it. I did that to verify that all commands got assembled
    properly before transmitting.
    The way to test a command is
    ··· eb.sendCommand(eb.Connect,addr);
    ··· while (!eb.response()) ;
    ··· eb.print();
    so every command must be followed by a call to response().
    eb.print() then simply prints the response.

    regards peter
  • Don FrenchDon French Posts: 126
    edited 2007-07-26 16:19
    Thanks, Peter. This version seems to work fine!
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-07-26 16:38
    Then I will upload this new version to the Yahoo Group as well.

    regards peter
    ·
Sign In or Register to comment.