public abstract class FtcEventLoopBase
extends java.lang.Object
FtcEventLoopBase
is an abstract base that handles defines core event processing
logic that's available whether or not a Robot is currently extant or notModifier and Type | Field and Description |
---|---|
protected Activity |
activityContext |
protected java.util.concurrent.atomic.AtomicBoolean |
firmwareUpdateInProgress |
protected FtcEventLoopHandler |
ftcEventLoopHandler |
protected NetworkConnectionHandler |
networkConnectionHandler |
protected RegisteredOpModes |
registeredOpModes |
protected RobotConfigFileManager |
robotCfgFileMgr |
protected boolean |
runningOnDriverStation |
static java.lang.String |
TAG |
protected USBScanManager |
usbScanManager |
protected OpModeRegister |
userOpmodeRegister |
Modifier | Constructor and Description |
---|---|
protected |
FtcEventLoopBase(HardwareFactory hardwareFactory,
OpModeRegister userOpmodeRegister,
UpdateUI.Callback callback,
Activity activityContext) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkForChangedOpModes() |
protected boolean |
enterFirmwareUpdateMode(RobotUsbDevice robotUsbDevice) |
protected LynxUsbDevice |
getLynxUsbDeviceForFirmwareUpdate(SerialNumber serialNumber) |
protected java.util.List<USBAccessibleLynxModule> |
getUSBAccessibleLynxDevices(boolean forFirmwareUpdate) |
protected void |
handleCommandActivateConfiguration(java.lang.String data) |
protected void |
handleCommandClearRememberedGroups()
Clear the list of remembered groups
|
protected void |
handleCommandDeleteConfiguration(java.lang.String fileInfo) |
protected void |
handleCommandDisconnectWifiDirect() |
protected void |
handleCommandDiscoverLynxModules(java.lang.String extra) |
protected void |
handleCommandDismissAllDialogs(Command command) |
protected void |
handleCommandDismissDialog(Command command) |
protected void |
handleCommandDismissProgress(Command command) |
protected void |
handleCommandGetCandidateLynxFirmwareImages(Command commandRequest) |
protected void |
handleCommandGetUSBAccessibleLynxModules(Command commandRequest) |
protected void |
handleCommandLynxChangeModuleAddresses(Command commandRequest) |
protected void |
handleCommandLynxFirmwareUpdate(Command commandRequest)
Update the firmware of the device indicated in the command.
|
protected void |
handleCommandRequestAboutInfo(Command command) |
protected void |
handleCommandRequestConfigurations()
Serialize the entire list of config file metadata and send to the driver station
|
protected void |
handleCommandRequestConfigurationTemplates()
Serialize the entire list of config file metadata and send to the driver station
|
protected void |
handleCommandRequestInspectionReport()
Return an inspection report of this (robot controller) device back to the caller
|
protected void |
handleCommandRequestParticularConfiguration(java.lang.String data) |
protected void |
handleCommandRequestRememberedGroups()
Serialize the list of remembered Wifi Direct groups and send it to the driver station
|
protected void |
handleCommandRestartRobot() |
protected void |
handleCommandSaveConfiguration(java.lang.String fileInfo) |
protected void |
handleCommandScan(java.lang.String extra) |
protected void |
handleCommandShowDialog(Command command) |
protected void |
handleCommandShowProgress(Command command) |
protected void |
handleCommandShowToast(Command command) |
protected void |
handleCommandStartDriverStationProgramAndManage() |
protected CallbackResult |
handleCommandVisuallyConfirmWifiBandSwitch(Command command) |
protected CallbackResult |
handleCommandVisuallyConfirmWifiReset() |
protected CallbackResult |
handleCommandVisuallyIdentify(Command command) |
void |
init(EventLoopManager eventLoopManager) |
CallbackResult |
processCommand(Command command) |
protected void |
sendUIState() |
protected USBScanManager |
startUsbScanMangerIfNecessary() |
protected void |
talkToParentLynxModule(DeviceManager deviceManager,
LynxUsbDevice lynxUsbDevice,
int moduleAddress,
Consumer<LynxModule> consumer) |
void |
teardown() |
protected boolean |
updateFirmwareOnce(LynxUsbDevice lynxUsbDevice,
byte[] firmwareImage,
SerialNumber serialNumber,
Consumer<ProgressParameters> fractionCompleteFeedback) |
protected LynxFirmwareUpdateResp |
updateLynxFirmware(SerialNumber serialNumber,
com.qualcomm.ftccommon.CommandList.FWImage image,
java.lang.String requestId)
Updates the firmware of the Expansion Hub in the indicated USB-attached device
to be the indicated firmware.
|
public static final java.lang.String TAG
protected NetworkConnectionHandler networkConnectionHandler
protected Activity activityContext
protected RobotConfigFileManager robotCfgFileMgr
protected FtcEventLoopHandler ftcEventLoopHandler
protected boolean runningOnDriverStation
protected USBScanManager usbScanManager
protected final OpModeRegister userOpmodeRegister
protected final java.util.concurrent.atomic.AtomicBoolean firmwareUpdateInProgress
protected final RegisteredOpModes registeredOpModes
protected FtcEventLoopBase(HardwareFactory hardwareFactory, OpModeRegister userOpmodeRegister, UpdateUI.Callback callback, Activity activityContext)
protected USBScanManager startUsbScanMangerIfNecessary()
public void teardown() throws RobotCoreException, java.lang.InterruptedException
RobotCoreException
java.lang.InterruptedException
public CallbackResult processCommand(Command command) throws java.lang.InterruptedException, RobotCoreException
java.lang.InterruptedException
RobotCoreException
protected void handleCommandActivateConfiguration(java.lang.String data)
protected void sendUIState()
protected void checkForChangedOpModes()
public void init(EventLoopManager eventLoopManager) throws RobotCoreException, java.lang.InterruptedException
RobotCoreException
java.lang.InterruptedException
protected void handleCommandRestartRobot()
protected void handleCommandRequestParticularConfiguration(java.lang.String data)
protected void handleCommandDeleteConfiguration(java.lang.String fileInfo)
protected void handleCommandSaveConfiguration(java.lang.String fileInfo)
protected void handleCommandRequestConfigurations()
protected void handleCommandRequestRememberedGroups()
protected void handleCommandClearRememberedGroups()
protected void handleCommandScan(java.lang.String extra) throws RobotCoreException, java.lang.InterruptedException
RobotCoreException
java.lang.InterruptedException
FtcConfigurationActivity.doUSBScanAndUpdateUI()
protected void handleCommandDiscoverLynxModules(java.lang.String extra) throws RobotCoreException
RobotCoreException
protected void handleCommandLynxFirmwareUpdate(Command commandRequest)
protected LynxFirmwareUpdateResp updateLynxFirmware(SerialNumber serialNumber, com.qualcomm.ftccommon.CommandList.FWImage image, java.lang.String requestId)
protected boolean updateFirmwareOnce(LynxUsbDevice lynxUsbDevice, byte[] firmwareImage, SerialNumber serialNumber, Consumer<ProgressParameters> fractionCompleteFeedback)
protected boolean enterFirmwareUpdateMode(RobotUsbDevice robotUsbDevice)
protected void handleCommandGetUSBAccessibleLynxModules(Command commandRequest)
protected LynxUsbDevice getLynxUsbDeviceForFirmwareUpdate(SerialNumber serialNumber)
protected java.util.List<USBAccessibleLynxModule> getUSBAccessibleLynxDevices(boolean forFirmwareUpdate) throws RobotCoreException
RobotCoreException
protected void handleCommandLynxChangeModuleAddresses(Command commandRequest)
protected void talkToParentLynxModule(DeviceManager deviceManager, LynxUsbDevice lynxUsbDevice, int moduleAddress, Consumer<LynxModule> consumer) throws RobotCoreException, java.lang.InterruptedException, LynxNackException
RobotCoreException
java.lang.InterruptedException
LynxNackException
protected void handleCommandGetCandidateLynxFirmwareImages(Command commandRequest)
protected void handleCommandRequestConfigurationTemplates()
protected void handleCommandStartDriverStationProgramAndManage()
protected void handleCommandShowDialog(Command command)
protected void handleCommandDismissDialog(Command command)
protected void handleCommandDismissAllDialogs(Command command)
protected void handleCommandShowProgress(Command command)
protected void handleCommandDismissProgress(Command command)
protected void handleCommandShowToast(Command command)
protected void handleCommandRequestInspectionReport()
protected void handleCommandRequestAboutInfo(Command command)
protected void handleCommandDisconnectWifiDirect()
protected CallbackResult handleCommandVisuallyIdentify(Command command)
protected CallbackResult handleCommandVisuallyConfirmWifiReset()
protected CallbackResult handleCommandVisuallyConfirmWifiBandSwitch(Command command)