Search in sources :

Example 16 with Command

use of com.qualcomm.robotcore.robocol.Command in project robotcode by OutoftheBoxFTC.

the class FtcLynxFirmwareUpdateActivity method getLynxModulesForFirmwareUpdate.

protected List<USBAccessibleLynxModule> getLynxModulesForFirmwareUpdate() {
    CommandList.USBAccessibleLynxModulesRequest request = new CommandList.USBAccessibleLynxModulesRequest();
    CommandList.USBAccessibleLynxModulesResp result = new CommandList.USBAccessibleLynxModulesResp();
    // Send the command
    availableLynxModules.clear();
    request.includeModuleNumbers = false;
    sendOrInject(new Command(CommandList.CMD_GET_USB_ACCESSIBLE_LYNX_MODULES, request.serialize()));
    // Wait, but only a while, for  the result
    result = awaitResponse(availableLynxModules, result);
    RobotLog.vv(TAG, "found %d lynx modules", result.modules.size());
    return result.modules;
}
Also used : Command(com.qualcomm.robotcore.robocol.Command)

Example 17 with Command

use of com.qualcomm.robotcore.robocol.Command in project robotcode by OutoftheBoxFTC.

the class FtcLynxFirmwareUpdateActivity method getCandidateLynxFirmwareImages.

// ----------------------------------------------------------------------------------------------
// Utility
// ----------------------------------------------------------------------------------------------
protected CommandList.LynxFirmwareImagesResp getCandidateLynxFirmwareImages() {
    CommandList.LynxFirmwareImagesResp result = new CommandList.LynxFirmwareImagesResp();
    availableLynxImages.clear();
    sendOrInject(new Command(CommandList.CMD_GET_CANDIDATE_LYNX_FIRMWARE_IMAGES));
    result = awaitResponse(availableLynxImages, result);
    RobotLog.vv(TAG, "found %d lynx firmware images", result.firmwareImages.size());
    return result;
}
Also used : Command(com.qualcomm.robotcore.robocol.Command)

Example 18 with Command

use of com.qualcomm.robotcore.robocol.Command in project robotcode by OutoftheBoxFTC.

the class FtcLynxModuleAddressUpdateActivity method getUSBAccessibleLynxModules.

protected List<USBAccessibleLynxModule> getUSBAccessibleLynxModules() {
    CommandList.USBAccessibleLynxModulesRequest request = new CommandList.USBAccessibleLynxModulesRequest();
    CommandList.USBAccessibleLynxModulesResp result = new CommandList.USBAccessibleLynxModulesResp();
    // Send the command
    availableLynxModules.clear();
    request.includeModuleNumbers = true;
    sendOrInject(new Command(CommandList.CMD_GET_USB_ACCESSIBLE_LYNX_MODULES, request.serialize()));
    // Wait, but only a while, for  the result
    result = awaitResponse(availableLynxModules, result);
    RobotLog.vv(TAG, "found %d lynx modules", result.modules.size());
    return result.modules;
}
Also used : Command(com.qualcomm.robotcore.robocol.Command)

Example 19 with Command

use of com.qualcomm.robotcore.robocol.Command in project robotcode by OutoftheBoxFTC.

the class FtcWifiDirectRememberedGroupsActivity method requestRememberedGroups.

protected void requestRememberedGroups() {
    RobotLog.vv(TAG, "requestRememberedGroups()");
    networkConnectionHandler.sendCommand(new Command(CommandList.CMD_REQUEST_REMEMBERED_GROUPS));
}
Also used : Command(com.qualcomm.robotcore.robocol.Command)

Example 20 with Command

use of com.qualcomm.robotcore.robocol.Command in project robotcode by OutoftheBoxFTC.

the class FtcWifiDirectRememberedGroupsActivity method onClearRememberedGroupsClicked.

// ----------------------------------------------------------------------------------------------
// Actions
// ----------------------------------------------------------------------------------------------
public void onClearRememberedGroupsClicked(View view) {
    RobotLog.vv(TAG, "onClearRememberedGroupsClicked()");
    if (!remoteConfigure) {
        persistentGroupManager.deleteAllPersistentGroups();
        AppUtil.getInstance().showToast(UILocation.BOTH, getString(R.string.toastWifiP2pRememberedGroupsCleared));
        loadLocalGroups();
    } else {
        networkConnectionHandler.sendCommand(new Command(CommandList.CMD_CLEAR_REMEMBERED_GROUPS));
    }
}
Also used : Command(com.qualcomm.robotcore.robocol.Command)

Aggregations

Command (com.qualcomm.robotcore.robocol.Command)25 RobotConfigFile (com.qualcomm.ftccommon.configuration.RobotConfigFile)5 USBScanManager (com.qualcomm.ftccommon.configuration.USBScanManager)2 RobotCoreException (com.qualcomm.robotcore.exception.RobotCoreException)2 ThreadPool (com.qualcomm.robotcore.util.ThreadPool)2 File (java.io.File)2 ArrayList (java.util.ArrayList)2 ScannedDevices (com.qualcomm.ftccommon.configuration.ScannedDevices)1 LynxModuleMetaList (com.qualcomm.robotcore.hardware.LynxModuleMetaList)1 ControllerConfiguration (com.qualcomm.robotcore.hardware.configuration.ControllerConfiguration)1 ReadXMLFileHandler (com.qualcomm.robotcore.hardware.configuration.ReadXMLFileHandler)1 WriteXMLFileHandler (com.qualcomm.robotcore.hardware.configuration.WriteXMLFileHandler)1 ReadWriteFile (com.qualcomm.robotcore.util.ReadWriteFile)1 SerialNumber (com.qualcomm.robotcore.util.SerialNumber)1 FileFilter (java.io.FileFilter)1 IOException (java.io.IOException)1 CancellationException (java.util.concurrent.CancellationException)1 Pattern (java.util.regex.Pattern)1 CallbackResult (org.firstinspires.ftc.robotcore.internal.network.CallbackResult)1 RecvLoopRunnable (org.firstinspires.ftc.robotcore.internal.network.RecvLoopRunnable)1