mirror of
https://github.com/mik3y/usb-serial-for-android
synced 2025-06-08 00:16:13 +00:00
fixed some warnings
This commit is contained in:
parent
b6e9dbe40f
commit
f1d73c04dc
4
.idea/misc.xml
generated
4
.idea/misc.xml
generated
@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="NullableNotNullManager">
|
<component name="NullableNotNullManager">
|
||||||
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
|
<option name="myDefaultNullable" value="androidx.annotation.Nullable" />
|
||||||
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
|
<option name="myDefaultNotNull" value="androidx.annotation.NonNull" />
|
||||||
<option name="myNullables">
|
<option name="myNullables">
|
||||||
<value>
|
<value>
|
||||||
<list size="12">
|
<list size="12">
|
||||||
|
@ -5,6 +5,8 @@ import android.content.Context;
|
|||||||
import android.hardware.usb.UsbDevice;
|
import android.hardware.usb.UsbDevice;
|
||||||
import android.hardware.usb.UsbManager;
|
import android.hardware.usb.UsbManager;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.fragment.app.ListFragment;
|
import androidx.fragment.app.ListFragment;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
@ -25,7 +27,7 @@ import java.util.Locale;
|
|||||||
|
|
||||||
public class DevicesFragment extends ListFragment {
|
public class DevicesFragment extends ListFragment {
|
||||||
|
|
||||||
class ListItem {
|
static class ListItem {
|
||||||
UsbDevice device;
|
UsbDevice device;
|
||||||
int port;
|
int port;
|
||||||
UsbSerialDriver driver;
|
UsbSerialDriver driver;
|
||||||
@ -37,7 +39,7 @@ public class DevicesFragment extends ListFragment {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private ArrayList<ListItem> listItems = new ArrayList<>();
|
private final ArrayList<ListItem> listItems = new ArrayList<>();
|
||||||
private ArrayAdapter<ListItem> listAdapter;
|
private ArrayAdapter<ListItem> listAdapter;
|
||||||
private int baudRate = 19200;
|
private int baudRate = 19200;
|
||||||
private boolean withIoManager = true;
|
private boolean withIoManager = true;
|
||||||
@ -47,8 +49,9 @@ public class DevicesFragment extends ListFragment {
|
|||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setHasOptionsMenu(true);
|
setHasOptionsMenu(true);
|
||||||
listAdapter = new ArrayAdapter<ListItem>(getActivity(), 0, listItems) {
|
listAdapter = new ArrayAdapter<ListItem>(getActivity(), 0, listItems) {
|
||||||
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public View getView(int position, View view, ViewGroup parent) {
|
public View getView(int position, View view, @NonNull ViewGroup parent) {
|
||||||
ListItem item = listItems.get(position);
|
ListItem item = listItems.get(position);
|
||||||
if (view == null)
|
if (view == null)
|
||||||
view = getActivity().getLayoutInflater().inflate(R.layout.device_list_item, parent, false);
|
view = getActivity().getLayoutInflater().inflate(R.layout.device_list_item, parent, false);
|
||||||
@ -78,7 +81,7 @@ public class DevicesFragment extends ListFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
public void onCreateOptionsMenu(@NonNull Menu menu, MenuInflater inflater) {
|
||||||
inflater.inflate(R.menu.menu_devices, menu);
|
inflater.inflate(R.menu.menu_devices, menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -142,7 +145,7 @@ public class DevicesFragment extends ListFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onListItemClick(ListView l, View v, int position, long id) {
|
public void onListItemClick(@NonNull ListView l, @NonNull View v, int position, long id) {
|
||||||
ListItem item = listItems.get(position-1);
|
ListItem item = listItems.get(position-1);
|
||||||
if(item.driver == null) {
|
if(item.driver == null) {
|
||||||
Toast.makeText(getActivity(), "no driver", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "no driver", Toast.LENGTH_SHORT).show();
|
||||||
|
@ -34,7 +34,7 @@ public class MainActivity extends AppCompatActivity implements FragmentManager.O
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onNewIntent(Intent intent) {
|
protected void onNewIntent(Intent intent) {
|
||||||
if(intent.getAction().equals("android.hardware.usb.action.USB_DEVICE_ATTACHED")) {
|
if("android.hardware.usb.action.USB_DEVICE_ATTACHED".equals(intent.getAction())) {
|
||||||
TerminalFragment terminal = (TerminalFragment)getSupportFragmentManager().findFragmentByTag("terminal");
|
TerminalFragment terminal = (TerminalFragment)getSupportFragmentManager().findFragmentByTag("terminal");
|
||||||
if (terminal != null)
|
if (terminal != null)
|
||||||
terminal.status("USB device detected");
|
terminal.status("USB device detected");
|
||||||
|
@ -42,7 +42,7 @@ import java.util.concurrent.Executors;
|
|||||||
|
|
||||||
public class TerminalFragment extends Fragment implements SerialInputOutputManager.Listener {
|
public class TerminalFragment extends Fragment implements SerialInputOutputManager.Listener {
|
||||||
|
|
||||||
private enum UsbPermission { Unknown, Requested, Granted, Denied };
|
private enum UsbPermission { Unknown, Requested, Granted, Denied }
|
||||||
|
|
||||||
private static final String INTENT_ACTION_GRANT_USB = BuildConfig.APPLICATION_ID + ".GRANT_USB";
|
private static final String INTENT_ACTION_GRANT_USB = BuildConfig.APPLICATION_ID + ".GRANT_USB";
|
||||||
private static final int WRITE_WAIT_MILLIS = 2000;
|
private static final int WRITE_WAIT_MILLIS = 2000;
|
||||||
@ -51,8 +51,8 @@ public class TerminalFragment extends Fragment implements SerialInputOutputManag
|
|||||||
private int deviceId, portNum, baudRate;
|
private int deviceId, portNum, baudRate;
|
||||||
private boolean withIoManager;
|
private boolean withIoManager;
|
||||||
|
|
||||||
private BroadcastReceiver broadcastReceiver;
|
private final BroadcastReceiver broadcastReceiver;
|
||||||
private Handler mainLooper;
|
private final Handler mainLooper;
|
||||||
private TextView receiveText;
|
private TextView receiveText;
|
||||||
private ControlLines controlLines;
|
private ControlLines controlLines;
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ public class TerminalFragment extends Fragment implements SerialInputOutputManag
|
|||||||
broadcastReceiver = new BroadcastReceiver() {
|
broadcastReceiver = new BroadcastReceiver() {
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
if(intent.getAction().equals(INTENT_ACTION_GRANT_USB)) {
|
if(INTENT_ACTION_GRANT_USB.equals(intent.getAction())) {
|
||||||
usbPermission = intent.getBooleanExtra(UsbManager.EXTRA_PERMISSION_GRANTED, false)
|
usbPermission = intent.getBooleanExtra(UsbManager.EXTRA_PERMISSION_GRANTED, false)
|
||||||
? UsbPermission.Granted : UsbPermission.Denied;
|
? UsbPermission.Granted : UsbPermission.Denied;
|
||||||
connect();
|
connect();
|
||||||
@ -258,10 +258,10 @@ public class TerminalFragment extends Fragment implements SerialInputOutputManag
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
byte[] data = (str + '\n').getBytes();
|
byte[] data = (str + '\n').getBytes();
|
||||||
SpannableStringBuilder spn = new SpannableStringBuilder();
|
SpannableStringBuilder spn = new SpannableStringBuilder();
|
||||||
spn.append("send " + data.length + " bytes\n");
|
spn.append("send " + data.length + " bytes\n");
|
||||||
spn.append(HexDump.dumpHexString(data)+"\n");
|
spn.append(HexDump.dumpHexString(data)).append("\n");
|
||||||
spn.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.colorSendText)), 0, spn.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
spn.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.colorSendText)), 0, spn.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||||
receiveText.append(spn);
|
receiveText.append(spn);
|
||||||
usbSerialPort.write(data, WRITE_WAIT_MILLIS);
|
usbSerialPort.write(data, WRITE_WAIT_MILLIS);
|
||||||
@ -291,7 +291,7 @@ public class TerminalFragment extends Fragment implements SerialInputOutputManag
|
|||||||
SpannableStringBuilder spn = new SpannableStringBuilder();
|
SpannableStringBuilder spn = new SpannableStringBuilder();
|
||||||
spn.append("receive " + data.length + " bytes\n");
|
spn.append("receive " + data.length + " bytes\n");
|
||||||
if(data.length > 0)
|
if(data.length > 0)
|
||||||
spn.append(HexDump.dumpHexString(data)+"\n");
|
spn.append(HexDump.dumpHexString(data)).append("\n");
|
||||||
receiveText.append(spn);
|
receiveText.append(spn);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -304,8 +304,8 @@ public class TerminalFragment extends Fragment implements SerialInputOutputManag
|
|||||||
class ControlLines {
|
class ControlLines {
|
||||||
private static final int refreshInterval = 200; // msec
|
private static final int refreshInterval = 200; // msec
|
||||||
|
|
||||||
private Runnable runnable;
|
private final Runnable runnable;
|
||||||
private ToggleButton rtsBtn, ctsBtn, dtrBtn, dsrBtn, cdBtn, riBtn;
|
private final ToggleButton rtsBtn, ctsBtn, dtrBtn, dsrBtn, cdBtn, riBtn;
|
||||||
|
|
||||||
ControlLines(View view) {
|
ControlLines(View view) {
|
||||||
runnable = this::run; // w/o explicit Runnable, a new lambda would be created on each postDelayed, which would not be found again by removeCallbacks
|
runnable = this::run; // w/o explicit Runnable, a new lambda would be created on each postDelayed, which would not be found again by removeCallbacks
|
||||||
|
@ -22,7 +22,7 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation "androidx.annotation:annotation:1.1.0"
|
implementation "androidx.annotation:annotation:1.2.0"
|
||||||
testImplementation 'junit:junit:4.13.2'
|
testImplementation 'junit:junit:4.13.2'
|
||||||
testImplementation 'org.mockito:mockito-core:1.10.19'
|
testImplementation 'org.mockito:mockito-core:1.10.19'
|
||||||
androidTestImplementation 'com.android.support.test:runner:1.0.2'
|
androidTestImplementation 'com.android.support.test:runner:1.0.2'
|
||||||
|
@ -142,7 +142,7 @@ public class DeviceTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static class TestBuffer {
|
private static class TestBuffer {
|
||||||
private byte[] buf;
|
private final byte[] buf;
|
||||||
private int len;
|
private int len;
|
||||||
|
|
||||||
private TestBuffer(int length) {
|
private TestBuffer(int length) {
|
||||||
@ -937,7 +937,7 @@ public class DeviceTest {
|
|||||||
int purgeTimeout = 250;
|
int purgeTimeout = 250;
|
||||||
TestBuffer tbuf;
|
TestBuffer tbuf;
|
||||||
long begin;
|
long begin;
|
||||||
int duration1, duration2, retries, i, timeout;
|
int duration1, duration2, retries, i;
|
||||||
retries = purge ? 10 : 1;
|
retries = purge ? 10 : 1;
|
||||||
tbuf = new TestBuffer(writeBufferSize);
|
tbuf = new TestBuffer(writeBufferSize);
|
||||||
|
|
||||||
@ -1260,7 +1260,7 @@ public class DeviceTest {
|
|||||||
usb.setParameters(2400, 8, 1, UsbSerialPort.PARITY_NONE);
|
usb.setParameters(2400, 8, 1, UsbSerialPort.PARITY_NONE);
|
||||||
telnet.setParameters(2400, 8, 1, UsbSerialPort.PARITY_NONE);
|
telnet.setParameters(2400, 8, 1, UsbSerialPort.PARITY_NONE);
|
||||||
byte[] buf = new byte[64];
|
byte[] buf = new byte[64];
|
||||||
for(int i=0; i<buf.length; i++) buf[i]='a';
|
Arrays.fill(buf, (byte) 'a');
|
||||||
StringBuilder data = new StringBuilder();
|
StringBuilder data = new StringBuilder();
|
||||||
|
|
||||||
usb.write(buf);
|
usb.write(buf);
|
||||||
@ -1449,17 +1449,14 @@ public class DeviceTest {
|
|||||||
public void readTimeout() throws Exception {
|
public void readTimeout() throws Exception {
|
||||||
final Boolean[] closed = {Boolean.FALSE};
|
final Boolean[] closed = {Boolean.FALSE};
|
||||||
|
|
||||||
Runnable closeThread = new Runnable() {
|
Runnable closeThread = () -> {
|
||||||
@Override
|
try {
|
||||||
public void run() {
|
Thread.sleep(100);
|
||||||
try {
|
} catch (InterruptedException e) {
|
||||||
Thread.sleep(100);
|
e.printStackTrace();
|
||||||
} catch (InterruptedException e) {
|
}
|
||||||
e.printStackTrace();
|
usb.close();
|
||||||
}
|
closed[0] = true;
|
||||||
usb.close();
|
|
||||||
closed[0] = true;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
usb.open(EnumSet.of(UsbWrapper.OpenCloseFlags.NO_IOMANAGER_THREAD));
|
usb.open(EnumSet.of(UsbWrapper.OpenCloseFlags.NO_IOMANAGER_THREAD));
|
||||||
|
@ -287,7 +287,7 @@ public class CdcAcmSerialDriver implements UsbSerialDriver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Map<Integer, int[]> getSupportedDevices() {
|
public static Map<Integer, int[]> getSupportedDevices() {
|
||||||
final Map<Integer, int[]> supportedDevices = new LinkedHashMap<Integer, int[]>();
|
final Map<Integer, int[]> supportedDevices = new LinkedHashMap<>();
|
||||||
supportedDevices.put(UsbId.VENDOR_ARDUINO,
|
supportedDevices.put(UsbId.VENDOR_ARDUINO,
|
||||||
new int[] {
|
new int[] {
|
||||||
UsbId.ARDUINO_UNO,
|
UsbId.ARDUINO_UNO,
|
||||||
|
@ -363,7 +363,7 @@ public class Ch34xSerialDriver implements UsbSerialDriver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Map<Integer, int[]> getSupportedDevices() {
|
public static Map<Integer, int[]> getSupportedDevices() {
|
||||||
final Map<Integer, int[]> supportedDevices = new LinkedHashMap<Integer, int[]>();
|
final Map<Integer, int[]> supportedDevices = new LinkedHashMap<>();
|
||||||
supportedDevices.put(UsbId.VENDOR_QINHENG, new int[]{
|
supportedDevices.put(UsbId.VENDOR_QINHENG, new int[]{
|
||||||
UsbId.QINHENG_CH340,
|
UsbId.QINHENG_CH340,
|
||||||
UsbId.QINHENG_CH341A,
|
UsbId.QINHENG_CH341A,
|
||||||
|
@ -322,7 +322,7 @@ public class Cp21xxSerialDriver implements UsbSerialDriver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Map<Integer, int[]> getSupportedDevices() {
|
public static Map<Integer, int[]> getSupportedDevices() {
|
||||||
final Map<Integer, int[]> supportedDevices = new LinkedHashMap<Integer, int[]>();
|
final Map<Integer, int[]> supportedDevices = new LinkedHashMap<>();
|
||||||
supportedDevices.put(UsbId.VENDOR_SILABS,
|
supportedDevices.put(UsbId.VENDOR_SILABS,
|
||||||
new int[] {
|
new int[] {
|
||||||
UsbId.SILABS_CP2102, // same ID for CP2101, CP2103, CP2104, CP2109
|
UsbId.SILABS_CP2102, // same ID for CP2101, CP2103, CP2104, CP2109
|
||||||
|
@ -415,7 +415,7 @@ public class FtdiSerialDriver implements UsbSerialDriver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Map<Integer, int[]> getSupportedDevices() {
|
public static Map<Integer, int[]> getSupportedDevices() {
|
||||||
final Map<Integer, int[]> supportedDevices = new LinkedHashMap<Integer, int[]>();
|
final Map<Integer, int[]> supportedDevices = new LinkedHashMap<>();
|
||||||
supportedDevices.put(UsbId.VENDOR_FTDI,
|
supportedDevices.put(UsbId.VENDOR_FTDI,
|
||||||
new int[] {
|
new int[] {
|
||||||
UsbId.FTDI_FT232R,
|
UsbId.FTDI_FT232R,
|
||||||
|
@ -21,7 +21,7 @@ import java.util.Map;
|
|||||||
public class ProbeTable {
|
public class ProbeTable {
|
||||||
|
|
||||||
private final Map<Pair<Integer, Integer>, Class<? extends UsbSerialDriver>> mProbeTable =
|
private final Map<Pair<Integer, Integer>, Class<? extends UsbSerialDriver>> mProbeTable =
|
||||||
new LinkedHashMap<Pair<Integer,Integer>, Class<? extends UsbSerialDriver>>();
|
new LinkedHashMap<>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds or updates a (vendor, product) pair in the table.
|
* Adds or updates a (vendor, product) pair in the table.
|
||||||
|
@ -35,7 +35,7 @@ public class ProlificSerialDriver implements UsbSerialDriver {
|
|||||||
28800, 38400, 57600, 115200, 128000, 134400, 161280, 201600, 230400, 268800,
|
28800, 38400, 57600, 115200, 128000, 134400, 161280, 201600, 230400, 268800,
|
||||||
403200, 460800, 614400, 806400, 921600, 1228800, 2457600, 3000000, 6000000
|
403200, 460800, 614400, 806400, 921600, 1228800, 2457600, 3000000, 6000000
|
||||||
};
|
};
|
||||||
private enum DeviceType { DEVICE_TYPE_01, DEVICE_TYPE_HX};
|
private enum DeviceType { DEVICE_TYPE_01, DEVICE_TYPE_HX}
|
||||||
|
|
||||||
private final UsbDevice mDevice;
|
private final UsbDevice mDevice;
|
||||||
private final UsbSerialPort mPort;
|
private final UsbSerialPort mPort;
|
||||||
@ -502,7 +502,7 @@ public class ProlificSerialDriver implements UsbSerialDriver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Map<Integer, int[]> getSupportedDevices() {
|
public static Map<Integer, int[]> getSupportedDevices() {
|
||||||
final Map<Integer, int[]> supportedDevices = new LinkedHashMap<Integer, int[]>();
|
final Map<Integer, int[]> supportedDevices = new LinkedHashMap<>();
|
||||||
supportedDevices.put(UsbId.VENDOR_PROLIFIC,
|
supportedDevices.put(UsbId.VENDOR_PROLIFIC,
|
||||||
new int[] { UsbId.PROLIFIC_PL2303, });
|
new int[] { UsbId.PROLIFIC_PL2303, });
|
||||||
return supportedDevices;
|
return supportedDevices;
|
||||||
|
@ -46,11 +46,11 @@ public class UsbSerialProber {
|
|||||||
* not require permission from the Android USB system, since it does not
|
* not require permission from the Android USB system, since it does not
|
||||||
* open any of the devices.
|
* open any of the devices.
|
||||||
*
|
*
|
||||||
* @param usbManager
|
* @param usbManager usb manager
|
||||||
* @return a list, possibly empty, of all compatible drivers
|
* @return a list, possibly empty, of all compatible drivers
|
||||||
*/
|
*/
|
||||||
public List<UsbSerialDriver> findAllDrivers(final UsbManager usbManager) {
|
public List<UsbSerialDriver> findAllDrivers(final UsbManager usbManager) {
|
||||||
final List<UsbSerialDriver> result = new ArrayList<UsbSerialDriver>();
|
final List<UsbSerialDriver> result = new ArrayList<>();
|
||||||
|
|
||||||
for (final UsbDevice usbDevice : usbManager.getDeviceList().values()) {
|
for (final UsbDevice usbDevice : usbManager.getDeviceList().values()) {
|
||||||
final UsbSerialDriver driver = probeDevice(usbDevice);
|
final UsbSerialDriver driver = probeDevice(usbDevice);
|
||||||
|
@ -52,12 +52,12 @@ public class SerialInputOutputManager implements Runnable {
|
|||||||
/**
|
/**
|
||||||
* Called when new incoming data is available.
|
* Called when new incoming data is available.
|
||||||
*/
|
*/
|
||||||
public void onNewData(byte[] data);
|
void onNewData(byte[] data);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when {@link SerialInputOutputManager#run()} aborts due to an error.
|
* Called when {@link SerialInputOutputManager#run()} aborts due to an error.
|
||||||
*/
|
*/
|
||||||
public void onRunError(Exception e);
|
void onRunError(Exception e);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SerialInputOutputManager(UsbSerialPort serialPort) {
|
public SerialInputOutputManager(UsbSerialPort serialPort) {
|
||||||
@ -200,7 +200,7 @@ public class SerialInputOutputManager implements Runnable {
|
|||||||
|
|
||||||
private void step() throws IOException {
|
private void step() throws IOException {
|
||||||
// Handle incoming data.
|
// Handle incoming data.
|
||||||
byte[] buffer = null;
|
byte[] buffer;
|
||||||
synchronized (mReadBufferLock) {
|
synchronized (mReadBufferLock) {
|
||||||
buffer = mReadBuffer.array();
|
buffer = mReadBuffer.array();
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ public class FtdiSerialDriverTest {
|
|||||||
len = port.readFilter(buf, 0);
|
len = port.readFilter(buf, 0);
|
||||||
assertEquals(len, 0);
|
assertEquals(len, 0);
|
||||||
|
|
||||||
assertThrows(IOException.class, () -> {port.readFilter(buf, 1);});
|
assertThrows(IOException.class, () -> port.readFilter(buf, 1));
|
||||||
|
|
||||||
initBuf(buf);
|
initBuf(buf);
|
||||||
len = port.readFilter(buf, 2);
|
len = port.readFilter(buf, 2);
|
||||||
@ -69,7 +69,7 @@ public class FtdiSerialDriverTest {
|
|||||||
assertEquals(len, 62);
|
assertEquals(len, 62);
|
||||||
assertTrue(testBuf(buf, len));
|
assertTrue(testBuf(buf, len));
|
||||||
|
|
||||||
assertThrows(IOException.class, () -> {port.readFilter(buf, 65);});
|
assertThrows(IOException.class, () -> port.readFilter(buf, 65));
|
||||||
|
|
||||||
initBuf(buf);
|
initBuf(buf);
|
||||||
len = port.readFilter(buf, 66);
|
len = port.readFilter(buf, 66);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user