drivers-samples: GPS driver sample buffer overflow

I am trying the sample for the GPS driver with a raspberry pi 3 and the Ultimate GPS V3 breakout board.

The GPS board is connected following this schematics: screen shot 2016-12-26 at 1 15 11 pm

When launching the sample app, I get the following error:

12-26 21:11:50.561 1299-1299/com.example.androidthings.driversamples E/AndroidRuntime: FATAL EXCEPTION: main
                                                                                       Process: com.example.androidthings.driversamples, PID: 1299
                                                                                       java.nio.BufferOverflowException
                                                                                           at java.nio.Buffer.nextPutIndex(Buffer.java:508)
                                                                                           at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:142)
                                                                                           at com.google.android.things.contrib.driver.gps.NmeaGpsModule.processBuffer(NmeaGpsModule.java:178)
                                                                                           at com.google.android.things.contrib.driver.gps.NmeaGpsModule.readUartBuffer(NmeaGpsModule.java:160)
                                                                                           at com.google.android.things.contrib.driver.gps.NmeaGpsModule.access$000(NmeaGpsModule.java:35)
                                                                                           at com.google.android.things.contrib.driver.gps.NmeaGpsModule$1.onUartDeviceDataAvailable(NmeaGpsModule.java:139)
                                                                                           at com.google.android.things.pio.UartDevice$UartDeviceCallbackDispatch.dispatchInterruptEvent(UartDevice.java:507)
                                                                                           at com.google.android.things.pio.CallbackDispatch.onFileDescriptorEvents(CallbackDispatch.java:127)
                                                                                           at android.os.MessageQueue.dispatchEvents(MessageQueue.java:282)
                                                                                           at android.os.MessageQueue.nativePollOnce(Native Method)
                                                                                           at android.os.MessageQueue.next(MessageQueue.java:323)
                                                                                           at android.os.Looper.loop(Looper.java:136)
                                                                                           at android.app.ActivityThread.main(ActivityThread.java:6077)
                                                                                           at java.lang.reflect.Method.invoke(Native Method)
                                                                                           at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
                                                                                           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 19 (8 by maintainers)

Most upvoted comments

Change merged in androidthings/contrib-drivers#30 that should fix this. We can close the bug when the driver+sample are updated.