kopia lustrzana https://github.com/felHR85/UsbSerial
Minor issue
rodzic
ee262cebef
commit
ec7be9af0e
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
|
@ -38,6 +38,7 @@ public class BLED112SerialDevice extends UsbSerialDevice
|
||||||
};
|
};
|
||||||
|
|
||||||
private static final int BLED112_DEFAULT_CONTROL_LINE = 0x0003;
|
private static final int BLED112_DEFAULT_CONTROL_LINE = 0x0003;
|
||||||
|
private static final int BLED112_DISCONNECT_CONTROL_LINE = 0x0002;
|
||||||
|
|
||||||
private UsbInterface mInterface;
|
private UsbInterface mInterface;
|
||||||
private UsbEndpoint inEndpoint;
|
private UsbEndpoint inEndpoint;
|
||||||
|
@ -109,6 +110,7 @@ public class BLED112SerialDevice extends UsbSerialDevice
|
||||||
@Override
|
@Override
|
||||||
public void close()
|
public void close()
|
||||||
{
|
{
|
||||||
|
setControlCommand(BLED112_SET_CONTROL_LINE_STATE, BLED112_DISCONNECT_CONTROL_LINE , null);
|
||||||
killWorkingThread();
|
killWorkingThread();
|
||||||
connection.close();
|
connection.close();
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,7 +77,6 @@ public abstract class UsbSerialDevice implements UsbSerialInterface
|
||||||
&& request.getEndpoint().getDirection() == UsbConstants.USB_DIR_IN)
|
&& request.getEndpoint().getDirection() == UsbConstants.USB_DIR_IN)
|
||||||
{
|
{
|
||||||
byte[] data = serialBuffer.getDataReceived();
|
byte[] data = serialBuffer.getDataReceived();
|
||||||
Log.i(CLASS_ID, "Received data length: " + String.valueOf(data.length));
|
|
||||||
serialBuffer.clearReadBuffer();
|
serialBuffer.clearReadBuffer();
|
||||||
onReceivedData(data);
|
onReceivedData(data);
|
||||||
requestIN.queue(serialBuffer.getReadBuffer(), SerialBuffer.DEFAULT_READ_BUFFER_SIZE);
|
requestIN.queue(serialBuffer.getReadBuffer(), SerialBuffer.DEFAULT_READ_BUFFER_SIZE);
|
||||||
|
|
Ładowanie…
Reference in New Issue