use of com.qualcomm.robotcore.hardware.usb.RobotUsbManager in project robotcode by OutoftheBoxFTC.
the class FtcEventLoopBase method getLynxUsbDeviceForFirmwareUpdate.
protected LynxUsbDeviceContainer getLynxUsbDeviceForFirmwareUpdate(SerialNumber serialNumber) {
// Is is it something that's already open?
for (LynxUsbDeviceImpl lynxUsbDevice : ftcEventLoopHandler.getExtantLynxDeviceImpls()) {
if (lynxUsbDevice.getSerialNumber().equals(serialNumber)) {
return new LynxUsbDeviceContainer(lynxUsbDevice);
}
}
// No, then open it
try {
RobotUsbManager robotUsbManager = HardwareDeviceManager.createUsbManager(AppUtil.getDefContext());
RobotUsbDevice robotUsbDevice = LynxUsbUtil.openUsbDevice(robotUsbManager, serialNumber);
return new LynxUsbDeviceContainer(robotUsbDevice);
} catch (RobotCoreException e) {
// ignored;
}
return null;
}
use of com.qualcomm.robotcore.hardware.usb.RobotUsbManager in project robotcode by OutoftheBoxFTC.
the class HardwareDeviceManager method createUsbManager.
public static RobotUsbManager createUsbManager(Context context) throws RobotCoreException {
RobotUsbManager usbManager = new RobotUsbManagerFtdi(context);
if (LynxConstants.isRevControlHub()) {
RobotUsbManagerCombining combiner = new RobotUsbManagerCombining();
combiner.addManager(usbManager);
combiner.addManager(new RobotUsbManagerTty(context));
usbManager = combiner;
}
return usbManager;
}
Aggregations