Пример #1
0
        public static async Task WriteEepromValuesAsync(this ISerial serial, EepromV1 ee)
        {
            await serial.SendCommandAsync(@"$!", DefaultEpromTimeout);

            await serial.SendCommandsAsync(ee.ToGCode(), DefaultEpromTimeout);
        }
Пример #2
0
 /// <summary>
 /// Send command and wait until the command is transferred and we got a reply (no command pending)
 /// </summary>
 /// <param name="serial"></param>
 /// <param name="line">command line to send</param>
 /// <param name="waitForMilliseconds"></param>
 public static async Task <IEnumerable <SerialCommand> > SendCommandAsync(this ISerial serial, string line, int waitForMilliseconds = DefaultTimeout)
 {
     return(await serial.SendCommandsAsync(new[] { line }, waitForMilliseconds));
 }
Пример #3
0
 /// <summary>
 /// Send multiple command lines to the arduino. Wait until the commands are transferred and we got a reply (no command pending)
 /// </summary>
 /// <param name="serial"></param>
 /// <param name="commands"></param>
 public static IEnumerable <SerialCommand> SendCommands(this ISerial serial, IEnumerable <string> commands)
 {
     return(serial.SendCommandsAsync(commands, DefaultTimeout).ConfigureAwait(false).GetAwaiter().GetResult());
 }
Пример #4
0
 /// <summary>
 /// Send command and wait until the command is transferred and we got a reply (no command pending)
 /// </summary>
 /// <param name="serial"></param>
 /// <param name="line">command line to send</param>
 public static IEnumerable <SerialCommand> SendCommand(this ISerial serial, string line)
 {
     return(serial.SendCommandsAsync(new[] { line }, DefaultTimeout).ConfigureAwait(false).GetAwaiter().GetResult());
 }