Skip to content

Commit

Permalink
Merge branch 'lite' into update-to-4.3-lite
Browse files Browse the repository at this point in the history
# Conflicts:
#	library/build.gradle
  • Loading branch information
iamwood committed Nov 10, 2018
2 parents 49850ff + 72da7d0 commit c24fe99
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 630 deletions.
4 changes: 2 additions & 2 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ android {
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

versionCode 45
versionName "$ftc_version.0"
versionName "$ftc_version.0-lite"

ndk {
abiFilters "armeabi-v7a"
Expand All @@ -27,7 +27,7 @@ version = android.defaultConfig.versionName
project.archivesBaseName = 'ftc-common-repackaged'

dependencies {
implementation "com.github.modular-ftc:robotcore-repackaged:$ftc_version.0"
implementation "com.github.modular-ftc:robotcore-repackaged:$ftc_version.0-lite"
implementation "org.first.ftc:hardware:$ftc_version"
implementation "org.first.ftc:inspection:$ftc_version"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,13 @@ are permitted (subject to the limitations in the disclaimer below) provided that
import org.firstinspires.ftc.robotcore.internal.network.WifiDirectAgent;
import org.firstinspires.ftc.robotcore.internal.network.WifiDirectGroupName;
import org.firstinspires.ftc.robotcore.internal.network.WifiDirectPersistentGroupManager;
import org.firstinspires.ftc.robotcore.internal.opmode.OnBotJavaManager;
import org.firstinspires.ftc.robotcore.internal.opmode.RegisteredOpModes;
import org.firstinspires.ftc.robotcore.internal.stellaris.FlashLoaderManager;
import org.firstinspires.ftc.robotcore.internal.stellaris.FlashLoaderProtocolException;
import org.firstinspires.ftc.robotcore.internal.system.AppUtil;
import org.firstinspires.ftc.robotcore.internal.system.Assert;
import org.firstinspires.ftc.robotcore.internal.ui.ProgressParameters;
import org.firstinspires.ftc.robotcore.internal.ui.UILocation;
import org.firstinspires.ftc.robotcore.internal.webserver.WebServer;
import org.firstinspires.inspection.InspectionState;

import java.io.File;
Expand Down Expand Up @@ -398,19 +396,6 @@ protected void sendUIState()

protected void checkForChangedOpModes()
{
if (registeredOpModes.getOnBotJavaChanged())
{
OnBotJavaManager.lockBuildExclusiveWhile(new Runnable()
{
@Override public void run()
{
registeredOpModes.clearOnBotJavaChanged();
registeredOpModes.registerOnBotJavaOpModes();
}
});
sendUIState();
}

if (registeredOpModes.getBlocksOpModesChanged())
{
registeredOpModes.clearBlocksOpModesChanged(); // clear first so we err on side of registerring too often rather than too infrequently
Expand Down Expand Up @@ -1086,15 +1071,7 @@ protected void handleCommandStartProgrammingMode()
protected void handleCommandStartDriverStationProgramAndManage()
{
EventLoopManager eventLoopManager = ftcEventLoopHandler.getEventLoopManager();
if (eventLoopManager != null)
{
WebServer webServer = eventLoopManager.getWebServer();
String extra = webServer.getConnectionInformation().toJson();
RobotLog.vv(TAG, "sending p&m resp: %s", extra);
networkConnectionHandler.sendCommand(new Command(CommandList.CMD_START_DS_PROGRAM_AND_MANAGE_RESP, extra));
}
else
{
if (eventLoopManager == null) {
RobotLog.vv(TAG, "handleCommandStartDriverStationProgramAndManage() with null EventLoopManager; ignored");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
import org.firstinspires.ftc.robotcore.internal.network.PreferenceRemoterRC;
import org.firstinspires.ftc.robotcore.internal.network.WifiDirectAgent;
import org.firstinspires.ftc.robotcore.internal.system.PreferencesHelper;
import org.firstinspires.ftc.robotcore.internal.webserver.WebServer;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -109,8 +108,6 @@ public class FtcRobotControllerService extends Service implements NetworkConnect
private WifiDirectAgent wifiDirectAgent = WifiDirectAgent.getInstance();
private final Object wifiDirectCallbackLock = new Object();

private WebServer webServer;

//----------------------------------------------------------------------------------------------
// Initialization
//----------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -258,7 +255,6 @@ void waitForNetwork() throws InterruptedException {
}
// Wait until we're free and clear to go
waitForNetworkConnection();
webServer.start();
}

void startRobot() throws RobotCoreException {
Expand Down Expand Up @@ -334,10 +330,6 @@ public Robot getRobot() {
return this.robot;
}

public @NonNull WebServer getWebServer() {
return this.webServer;
}

@Override public void onCreate() {
super.onCreate();
RobotLog.vv(TAG, "onCreate()");
Expand Down Expand Up @@ -365,7 +357,6 @@ public IBinder onBind(Intent intent) {
FtcLynxFirmwareUpdateActivity.initializeDirectories();

NetworkType networkType = (NetworkType) intent.getSerializableExtra(NetworkConnectionFactory.NETWORK_CONNECTION_TYPE);
webServer = new WebServer(networkType);

networkConnection = NetworkConnectionFactory.getNetworkConnection(networkType, getBaseContext());
networkConnection.setCallback(this);
Expand Down Expand Up @@ -393,7 +384,6 @@ public boolean onUnbind(Intent intent) {
@Override public void onDestroy() {
super.onDestroy();
RobotLog.vv(TAG, "onDestroy()");
webServer.stop();
stopLEDS();
wifiDirectAgent.unregisterCallback(this);
}
Expand Down Expand Up @@ -499,11 +489,6 @@ public CallbackResult onNetworkConnectionEvent(NetworkConnection.NetworkEvent ev
break;
case CONNECTION_INFO_AVAILABLE:
RobotLog.ii(TAG, "Network Connection Passphrase: " + networkConnection.getPassphrase());
// Handling the case where we are changing networks and the web server has already been started.
if (webServer.wasStarted()) {
webServer.stop();
}
webServer.start();
break;
case ERROR:
RobotLog.ee(TAG, "Network Connection Error: " + networkConnection.getFailureReason());
Expand Down
Loading

0 comments on commit c24fe99

Please sign in to comment.