Commit b8f4a7c6 authored by Lars Wischhof's avatar Lars Wischhof
Browse files

Merge branch 'lw_fix_set_order' into 'master'

fix/workaround: ignore TraCI SET_ORDER command (required for latest Artery releases)

See merge request !222
parents bfb68256 82924486
Pipeline #1120081 passed with stages
in 127 minutes and 13 seconds
......@@ -23,6 +23,7 @@ public class CommandExecutor {
this.remoteManager = remoteManager;
cmdMap = new HashMap<>();
cmdMap.put(TraCICmd.GET_VERSION.id, ControlCommandHandler.instance::process_getVersion);
cmdMap.put(TraCICmd.SET_ORDER.id, ControlCommandHandler.instance::process_setOrder);
cmdMap.put(TraCICmd.LOAD.id, ControlCommandHandler.instance::process_load);
cmdMap.put(TraCICmd.SIM_STEP.id, ControlCommandHandler.instance::process_simStep);
cmdMap.put(TraCICmd.GET_STATE.id, ControlCommandHandler.instance::process_getState);
......
......@@ -159,6 +159,17 @@ public class ControlCommandHandler extends CommandHandler<ControlVar> {
return cmd;
}
public TraCICommand process_setOrder(TraCICommand rawCmd, RemoteManager remoteManager) {
//Note: Currently we do not allow multiple clients to be connected to one vadere instance,
// therefore we simply ignore the SET_ORDER command
logger.warn("SET_ORDER command received - ignored since vadere handles only one client connection");
// remoteManager.setOrder(...) // currently not implemented
return rawCmd;
}
public TraCICommand process_load_file(TraCICommand rawCmd, RemoteManager remoteManager) {
if (VadereServer.currentVersion.greaterOrEqual(TraCIVersion.V20_0_2)) {
......
......@@ -78,6 +78,8 @@ public abstract class TraCICommand {
return new TraCISendFileCommand(cmdBuffer);
case LOAD:
return new TraCILoadCommand(cmdBuffer);
case SET_ORDER:
return new TraCISetOrderCommand(cmdBuffer);
default:
throw new TraCIExceptionInternal(String.format("Should not be reached. Only TraCI control commands expected: 0x%02X", cmd.id));
}
......
package org.vadere.manager.traci.commands.control;
import org.vadere.manager.traci.TraCICmd;
import org.vadere.manager.traci.commands.TraCICommand;
import org.vadere.manager.traci.reader.TraCICommandBuffer;
import org.vadere.manager.traci.writer.TraCIPacket;
public class TraCISetOrderCommand extends TraCICommand {
public TraCISetOrderCommand(TraCICommandBuffer cmdBuffer) {
super(TraCICmd.SET_ORDER);
}
@Override
public TraCIPacket buildResponsePacket() {
if (NOK_response != null)
return NOK_response;
else
return TraCIPacket.create(11).add_OK_StatusResponse(TraCICmd.SET_ORDER);
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment