Search:

Type: Posts; User: Norm

Search: Search took 0.14 seconds.

  1. Replies
    21
    Views
    1,444

    Re: Help with serial read-in

    mmInputStream.read(packetBytes);
    // vs
    int nbrRead = mmInputStream.read(packetBytes);
    The code doesn't capture and print out the value returned by the read() method.
    Does the read() read any...
  2. Replies
    21
    Views
    1,444

    Re: Help with serial read-in

    Another help for debugging would be to save and print the value returned by the read() method.

    The debug output you posted shows that a byte with value 0 was in the buffer after the read. I don't...
  3. Replies
    21
    Views
    1,444

    Re: Help with serial read-in

    Please post the code and what is printed by the println() in and around the loop.
    Be sure to use the Arrays class's toString() method, not just the array name like here:
    03-13 13:22:15.522:...
  4. Replies
    21
    Views
    1,444

    Re: Help with serial read-in

    readBuffer = new byte[0];
    Is an empty array which would print as []
  5. Replies
    21
    Views
    1,444

    Re: Help with serial read-in

    That String is the value returned from the default toString() method of a byte array. To format the contents of an array for printing use the Arrays class's toString() method:...
  6. Replies
    21
    Views
    1,444

    Re: Help with serial read-in

    The code is using an index of 1 with an array of length 1 at line 177. Max index for an array of length 1 is 0

    The debug output printed by your println()s should show the length of the array and...
  7. Replies
    21
    Views
    1,444

    Re: Help with serial read-in

    The code needs some println() statements to print out the values of the variables it is working with so you can see what the computer sees when the code executes.
  8. Replies
    21
    Views
    1,444

    Re: Help with serial read-in

    The code at line 174 used an index with a value of 1 with an array with only 1 element (max index would be 0)
  9. Replies
    21
    Views
    1,444

    Re: Help with serial read-in

    There is a button with the Logcat that saves its contents to where it can be copied.
  10. Replies
    21
    Views
    1,444

    Re: Help with serial read-in

    Please copy the contents of the logcat and paste it here showing the exception.
Results 1 to 10 of 10