Only notify to ListenThread if a messafe fron IN endpoint is received

pull/4/head
Felipe Herranz 2014-04-10 12:36:54 +02:00
rodzic b40a51dd50
commit d6c029c3ac
4 zmienionych plików z 6 dodań i 4 usunięć

Plik binarny nie jest wyświetlany.

Wyświetl plik

@ -78,16 +78,18 @@ public abstract class UsbSerialDevice implements UsbSerialInterface
Log.i(CLASS_ID, "Received data length: " + String.valueOf(data.length));
serialBuffer.clearReadBuffer();
onReceivedData(data);
synchronized(objectMonitor)
{
objectMonitor.notify();
}
}else // Write
{
int pos = serialBuffer.getWriteBuffer().position();
Log.i(CLASS_ID, "Send data length: " + String.valueOf(pos + 1));
serialBuffer.clearWriteBuffer();
}
synchronized(objectMonitor)
{
objectMonitor.notify();
}
}
}