mirror of
https://github.com/mik3y/usb-serial-for-android
synced 2025-06-08 00:16:13 +00:00
reduce non covered code
move HexDump class from library to example remove unused UsbSerialRuntimeException
This commit is contained in:
parent
ac1fe40793
commit
37059b1a27
@ -49,7 +49,6 @@ import android.widget.TwoLineListItem;
|
|||||||
import com.hoho.android.usbserial.driver.UsbSerialDriver;
|
import com.hoho.android.usbserial.driver.UsbSerialDriver;
|
||||||
import com.hoho.android.usbserial.driver.UsbSerialPort;
|
import com.hoho.android.usbserial.driver.UsbSerialPort;
|
||||||
import com.hoho.android.usbserial.driver.UsbSerialProber;
|
import com.hoho.android.usbserial.driver.UsbSerialProber;
|
||||||
import com.hoho.android.usbserial.util.HexDump;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -134,9 +133,7 @@ public class DeviceListActivity extends Activity {
|
|||||||
final UsbSerialDriver driver = port.getDriver();
|
final UsbSerialDriver driver = port.getDriver();
|
||||||
final UsbDevice device = driver.getDevice();
|
final UsbDevice device = driver.getDevice();
|
||||||
|
|
||||||
final String title = String.format("Vendor %s Product %s",
|
final String title = String.format("Vendor %4X Product %4X", device.getVendorId(), device.getProductId());
|
||||||
HexDump.toHexString((short) device.getVendorId()),
|
|
||||||
HexDump.toHexString((short) device.getProductId()));
|
|
||||||
row.getText1().setText(title);
|
row.getText1().setText(title);
|
||||||
|
|
||||||
final String subtitle = driver.getClass().getSimpleName();
|
final String subtitle = driver.getClass().getSimpleName();
|
||||||
|
@ -1,46 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2011 Google Inc.
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
|
||||||
* USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.hoho.android.usbserial.driver;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generic unchecked exception for the usbserial package.
|
|
||||||
*
|
|
||||||
* @author mike wakerly (opensource@hoho.com)
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("serial")
|
|
||||||
public class UsbSerialRuntimeException extends RuntimeException {
|
|
||||||
|
|
||||||
public UsbSerialRuntimeException() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
public UsbSerialRuntimeException(String detailMessage, Throwable throwable) {
|
|
||||||
super(detailMessage, throwable);
|
|
||||||
}
|
|
||||||
|
|
||||||
public UsbSerialRuntimeException(String detailMessage) {
|
|
||||||
super(detailMessage);
|
|
||||||
}
|
|
||||||
|
|
||||||
public UsbSerialRuntimeException(Throwable throwable) {
|
|
||||||
super(throwable);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user