REO progress
This commit is contained in:
parent
be01ffb2a7
commit
8410ff1be2
|
@ -4,4 +4,9 @@ do
|
||||||
java -jar console/rusefi_console.jar network_connector
|
java -jar console/rusefi_console.jar network_connector
|
||||||
exit_status=$?
|
exit_status=$?
|
||||||
echo Exit code: ${exit_status}
|
echo Exit code: ${exit_status}
|
||||||
|
# in java code that's UPDATE_SOFTWARE_EXIT_CODE magic number
|
||||||
|
if [ $exit_status -eq 15 ]; then
|
||||||
|
echo Software update was requested
|
||||||
|
bin/update_bundle.sh
|
||||||
|
fi
|
||||||
done
|
done
|
|
@ -12,8 +12,8 @@ import java.util.Random;
|
||||||
public class SessionDetails {
|
public class SessionDetails {
|
||||||
public static final String VEHICLE_TOKEN = "vehicleToken";
|
public static final String VEHICLE_TOKEN = "vehicleToken";
|
||||||
public static final String AUTH_TOKEN = "authToken";
|
public static final String AUTH_TOKEN = "authToken";
|
||||||
|
public static final String CONNECTOR_VERSION = "connectorVersion";
|
||||||
private static final String CONTROLLER = "controller";
|
private static final String CONTROLLER = "controller";
|
||||||
private static final String CONNECTOR_VERSION = "connectorVersion";
|
|
||||||
private static final String HARDCODED_ONE_TIME_CODE = System.getProperty("ONE_TIME_CODE");
|
private static final String HARDCODED_ONE_TIME_CODE = System.getProperty("ONE_TIME_CODE");
|
||||||
|
|
||||||
private final ControllerInfo controllerInfo;
|
private final ControllerInfo controllerInfo;
|
||||||
|
@ -47,6 +47,10 @@ public class SessionDetails {
|
||||||
return authToken;
|
return authToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getConsoleVersion() {
|
||||||
|
return consoleVersion;
|
||||||
|
}
|
||||||
|
|
||||||
public String toJson() {
|
public String toJson() {
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
jsonObject.put(CONTROLLER, controllerInfo.toJson());
|
jsonObject.put(CONTROLLER, controllerInfo.toJson());
|
||||||
|
@ -88,6 +92,7 @@ public class SessionDetails {
|
||||||
return "SessionDetails{" +
|
return "SessionDetails{" +
|
||||||
"controllerInfo=" + controllerInfo +
|
"controllerInfo=" + controllerInfo +
|
||||||
", authToken='" + authToken + '\'' +
|
", authToken='" + authToken + '\'' +
|
||||||
|
", consoleVersion='" + consoleVersion + '\'' +
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -303,6 +303,8 @@ public class Backend implements Closeable {
|
||||||
int rpm = (int) client.getSensorsHolder().getValue(Sensor.RPM);
|
int rpm = (int) client.getSensorsHolder().getValue(Sensor.RPM);
|
||||||
double clt = client.getSensorsHolder().getValue(Sensor.CLT);
|
double clt = client.getSensorsHolder().getValue(Sensor.CLT);
|
||||||
UserDetails owner = client.getTwoKindSemaphore().getOwner();
|
UserDetails owner = client.getTwoKindSemaphore().getOwner();
|
||||||
|
SessionDetails sessionDetails = client.getSessionDetails();
|
||||||
|
ControllerInfo controllerInfo = sessionDetails.getControllerInfo();
|
||||||
JsonObjectBuilder objectBuilder = Json.createObjectBuilder()
|
JsonObjectBuilder objectBuilder = Json.createObjectBuilder()
|
||||||
.add(UserDetails.USER_ID, client.getUserDetails().getUserId())
|
.add(UserDetails.USER_ID, client.getUserDetails().getUserId())
|
||||||
.add(UserDetails.USERNAME, client.getUserDetails().getUserName())
|
.add(UserDetails.USERNAME, client.getUserDetails().getUserName())
|
||||||
|
@ -311,10 +313,11 @@ public class Backend implements Closeable {
|
||||||
.add(ProxyClient.IS_USED, client.getTwoKindSemaphore().isUsed())
|
.add(ProxyClient.IS_USED, client.getTwoKindSemaphore().isUsed())
|
||||||
.add(ControllerStateDetails.RPM, rpm)
|
.add(ControllerStateDetails.RPM, rpm)
|
||||||
.add(ControllerStateDetails.CLT, clt)
|
.add(ControllerStateDetails.CLT, clt)
|
||||||
.add(ControllerInfo.SIGNATURE, client.getSessionDetails().getControllerInfo().getSignature())
|
.add(ControllerInfo.SIGNATURE, controllerInfo.getSignature())
|
||||||
.add(ControllerInfo.VEHICLE_NAME, client.getSessionDetails().getControllerInfo().getVehicleName())
|
.add(ControllerInfo.VEHICLE_NAME, controllerInfo.getVehicleName())
|
||||||
.add(ControllerInfo.ENGINE_MAKE, client.getSessionDetails().getControllerInfo().getEngineMake())
|
.add(ControllerInfo.ENGINE_MAKE, controllerInfo.getEngineMake())
|
||||||
.add(ControllerInfo.ENGINE_CODE, client.getSessionDetails().getControllerInfo().getEngineCode());
|
.add(ControllerInfo.ENGINE_CODE, controllerInfo.getEngineCode())
|
||||||
|
.add(SessionDetails.CONNECTOR_VERSION, sessionDetails.getAuthToken());
|
||||||
objectBuilder = addStreamStats(objectBuilder, client.getStream());
|
objectBuilder = addStreamStats(objectBuilder, client.getStream());
|
||||||
if (owner != null) {
|
if (owner != null) {
|
||||||
objectBuilder = objectBuilder.add(ProxyClient.OWNER, owner.getUserName());
|
objectBuilder = objectBuilder.add(ProxyClient.OWNER, owner.getUserName());
|
||||||
|
|
Loading…
Reference in New Issue