Skip to content

Commit c418796

Browse files
committed
Fix #1279
1 parent 7e6a16c commit c418796

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexUsbTransport.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ public void run() { //FIXME probably check to see what the BT does
249249
if(!stateProgress){//We are trying to weed through the bad packet info until we get something
250250
//Log.w(TAG, "Packet State Machine did not move forward from state - "+ psm.getState()+". PSM being Reset.");
251251
psm.reset();
252-
buffer = new byte[READ_BUFFER_SIZE];
252+
continue; //Move to the next iteration of the loop
253253
}
254254

255255
if(psm.getState() == SdlPsm.FINISHED_STATE){
@@ -259,9 +259,11 @@ public void run() { //FIXME probably check to see what the BT does
259259
packet.setTransportRecord(getTransportRecord());
260260
handler.obtainMessage(SdlRouterService.MESSAGE_READ, packet).sendToTarget();
261261
}
262-
//We put a trace statement in the message read so we can avoid all the extra bytes
262+
//Reset the PSM now that we have a finished packet.
263+
//We will continue to loop through the data to see if any other packet
264+
//is present.
263265
psm.reset();
264-
buffer = new byte[READ_BUFFER_SIZE]; //FIXME just do an array copy and send off
266+
continue; //Move to the next iteration of the loop
265267
}
266268
}
267269
} catch (IOException e) {

0 commit comments

Comments
 (0)