remote firmware request
This commit is contained in:
parent
926e9701e3
commit
d034a12998
|
@ -4,9 +4,16 @@ do
|
|||
java -jar console/rusefi_console.jar network_connector
|
||||
exit_status=$?
|
||||
echo Exit code: ${exit_status}
|
||||
# in java code that's UPDATE_SOFTWARE_EXIT_CODE magic number
|
||||
# in java code that's UPDATE_SBC_EXIT_CODE magic number
|
||||
if [ $exit_status -eq 15 ]; then
|
||||
echo Software update was requested
|
||||
bin/update_bundle.sh
|
||||
fi
|
||||
# in java code that's UPDATE_FIRMWARE_EXIT_CODE magic number
|
||||
if [ $exit_status -eq 16 ]; then
|
||||
echo Software update was requested
|
||||
bin/update_bundle.sh
|
||||
# todo: we need to start validating that SBC software matches board type, maybe update bundle type based on existing controller?
|
||||
bin/dfu_switch_and_program.sh
|
||||
fi
|
||||
done
|
|
@ -136,7 +136,7 @@ public class NetworkConnector implements Closeable {
|
|||
if (connectorCommand == NetworkConnector.UPDATE_CONNECTOR_SOFTWARE) {
|
||||
context.onConnectorSoftwareUpdateRequest();
|
||||
} else if (connectorCommand == NetworkConnector.UPDATE_FIRMWARE) {
|
||||
|
||||
context.onFirmwareUpdateRequest();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -9,7 +9,8 @@ import static com.devexperts.logging.Logging.getLogging;
|
|||
|
||||
public class NetworkConnectorContext {
|
||||
private static final Logging log = getLogging(NetworkConnectorContext.class);
|
||||
private static final int UPDATE_SOFTWARE_EXIT_CODE = 15;
|
||||
private static final int UPDATE_SBC_EXIT_CODE = 15;
|
||||
private static final int UPDATE_FIRMWARE_EXIT_CODE = 16;
|
||||
|
||||
public int reconnectDelay() {
|
||||
return 15; // this one is seconds
|
||||
|
@ -34,6 +35,11 @@ public class NetworkConnectorContext {
|
|||
|
||||
public void onConnectorSoftwareUpdateRequest() {
|
||||
log.info("onConnectorSoftwareUpdateRequest");
|
||||
System.exit(UPDATE_SOFTWARE_EXIT_CODE);
|
||||
System.exit(UPDATE_SBC_EXIT_CODE);
|
||||
}
|
||||
|
||||
public void onFirmwareUpdateRequest() {
|
||||
log.info("onFirmwareUpdateRequest");
|
||||
System.exit(UPDATE_FIRMWARE_EXIT_CODE);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue