androidthings / contrib-drivers

Open source peripheral drivers
Apache License 2.0
559 stars 174 forks source link

ArrayIndexOutOfBoundsException #113

Closed icetum15 closed 6 years ago

icetum15 commented 6 years ago

Sensor: GPS / ATGM332D-5N Board: raspberry pi 3 model B System: things 1.0.0

When I call OnNmeaMessageListener will occur error, Please check it, Thanks :)

01-01 00:44:31.922 2257-2257/com.test.anfu.gpsthings D/vndksupport: Loading /vendor/lib/hw/android.hardware.graphics.mapper@2.0-impl.so from current namespace instead of sphal namespace. 01-01 00:44:32.700 2257-2257/? V/apple: NMEA: GNGGA,123338.288,,,,,0,00,25.5,,,,,, 01-01 00:44:32.724 2257-2257/? V/apple: NMEA: GNGLL,,,,,123338.288,V,M 01-01 00:44:32.775 2257-2257/? V/apple: NMEA: GPGSA,A,1,,,,,,,,,,,,,25.5,25.5,25.5 01-01 00:44:32.815 2257-2257/? V/apple: NMEA: BDGSA,A,1,,,,,,,,,,,,,25.5,25.5,25.5 01-01 00:44:32.883 2257-2257/? D/AndroidRuntime: Shutting down VM

--------- beginning of crash 01-01 00:44:32.897 2257-2257/? E/AndroidRuntime: FATAL EXCEPTION: main Process: com.test.anfu.gpsthings, PID: 2257 java.lang.ArrayIndexOutOfBoundsException: length=19; index=19 at com.google.android.things.contrib.driver.gps.NmeaParser.handleSatelliteData(NmeaParser.java:198) at com.google.android.things.contrib.driver.gps.NmeaParser.processMessageFrame(NmeaParser.java:101) at com.google.android.things.contrib.driver.gps.NmeaGpsModule.handleFrameEnd(NmeaGpsModule.java:200) at com.google.android.things.contrib.driver.gps.NmeaGpsModule.processBuffer(NmeaGpsModule.java:169) at com.google.android.things.contrib.driver.gps.NmeaGpsModule.readUartBuffer(NmeaGpsModule.java:154) 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:132) at com.google.android.things.pio.UartDeviceImpl$UartDeviceCallbackDispatch.dispatchInterruptEvent(UartDeviceImpl.java:250) at com.google.android.things.pio.CallbackDispatch.onFileDescriptorEvents(CallbackDispatch.java:149) at android.os.MessageQueue.dispatchEvents(MessageQueue.java:284) at android.os.MessageQueue.nativePollOnce(Native Method) at android.os.MessageQueue.next(MessageQueue.java:325) at android.os.Looper.loop(Looper.java:142) at android.app.ActivityThread.main(ActivityThread.java:6494) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) 01-01 00:44:32.928 2257-2257/? I/Process: Sending signal. PID: 2257 SIG: 9

devunwired commented 6 years ago

Please verify that you are using the latest v1.1 of the driver:

dependencies {
    implementation 'com.google.android.things.contrib:driver-gps:1.1'
}
icetum15 commented 6 years ago

Thanks,It's ok when I use the latest version.