/// <summary> /// Updates an integer value configuration parameter to a robot in setup mode /// also sends movement test and the quit commands. /// </summary> /// <param name="botNumber">The robot to send the parameter to</param> /// <param name="parameter">The parameter to update</param> /// <param name="value">The new value</param> /// <param name="port">The port the robot is listening on</param> /// <returns>True on a successful response (OK) from the bot</returns> public static bool sendConfigParameter(int botNumber, configParameters parameter, int value, int port = 8080) { if (parameter == configParameters.robotName || parameter == configParameters.Z_threshold || parameter == configParameters.turn_drift_threshold || parameter == configParameters.turnFactor) { throw new ArgumentException("Must be a parameter that takes an integer value", "parameter"); } return(sendDataToRobot(botNumber, ((int)parameter).ToString() + ":" + value.ToString(), port) == "OK"); }
// <summary> /// Updates a string value configuration parameter to a robot in setup mode (only robotName) /// </summary> /// <param name="botNumber">The robot to send the parameter to</param> /// <param name="parameter">The parameter to update</param> /// <param name="value">The new value</param> /// <param name="port">The port the robot is listening on</param> /// <returns>True on a successful response (OK) from the bot</returns> public static bool sendConfigParameter(int botNumber, configParameters parameter, string value, int port = 8080) { if (parameter != configParameters.robotName) { throw new ArgumentException("Must be the robot name for a string value", "parameter"); } return(sendDataToRobot(botNumber, ((int)parameter).ToString() + ":" + value.ToString(), port) == "OK"); }