Esempio n. 1
0
 /// <summary>
 /// Sends message to Sumo
 /// </summary>
 /// <param name="message">message to send</param>
 /// <returns>response from Sumo</returns>
 public TraciResponseMessage SendMessage(TraciRequestMessage message)
 {
     try
     {
         _sumoClient.Client.Send(message.GetMessage());
         return(GetResponse());
     }
     catch (Exception ex)
     {
         throw new SumoControllerException("Error Sending Message to Sumo", ex);
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Create simulation step message
 /// </summary>
 /// <returns>simulation step message</returns>
 private TraciRequestMessage CreateSimStepMessage()
 {
     try
     {
         TraciRequestMessage traciMessage = new TraciRequestMessage();
         List <byte>         body         = TraciDataHelper.CreateTraciIntBytes(0);
         traciMessage.AddCommand(TraciConstants.Command.CMD_SIMSTEP, body);
         return(traciMessage);
     }
     catch (Exception ex)
     {
         throw new SumoControllerException("Error createing simulation step message", ex);
     }
 }