From 545ed8411d3d1d0922465c5567a9a34b2012b94f Mon Sep 17 00:00:00 2001 From: Edward Wright Date: Thu, 6 Jun 2019 22:40:48 -0400 Subject: [PATCH] auto-connect work in progress --- SimplySerial/SimplySerial - Shortcut.lnk | Bin 0 -> 1742 bytes SimplySerial/SimplySerial.cs | 6 ++++-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 SimplySerial/SimplySerial - Shortcut.lnk diff --git a/SimplySerial/SimplySerial - Shortcut.lnk b/SimplySerial/SimplySerial - Shortcut.lnk new file mode 100644 index 0000000000000000000000000000000000000000..38ae985f12180d99d756889da0fc4f538de946c1 GIT binary patch literal 1742 zcmb_cTS$~a6h7Jo?P9yRrAZet3?tWeTeVFrj9u5wd;SUrKjr5COB=iGwyT&Bg%3Vh zNe^A9NRh~VDM&~SQWNY3MQl-0K@ru9b|dJaD5CGoZtE&qFU|1HoHKLgJ7;FjOfeBf z>7vmR4U3j+M=6FhkjHAJ{<}+_MrA6RqNL?dqYgib6}_0md{odr+>S)+XjS>^vOw~9 zj#G2tSq!Z+7}}T7dP|NRHkuF)kWnbM(hAa2m0$JwNugMpO`nI>mt+`uJOdUVM&_Z7 z2`|hEN*$F{MSfDrhn6T0?H*_@R1B19X^F< zOUQG6i9Ug6*z?PiacJiPk)`L|Y03wCBRSw3OKIs8PRY~Yt5qjBnePwh{Z{5njwFQ4 zoDzAc0gScS1#^~9inBuXdi<0diZYV%m0(;w4PynEykOG%S(-n!{?!A~ewg#V zIk~yl16;g-7MKN$4m`-^2SP|}k+*U%i{#+N%i^x&I)}erRg|VIW40_g-CkFdr23o= z*Cd4jI|RvFVjT6$}{BIT6T=m z0&s9|j#S$Qip`cAKjTlVIpcol#Q1DB;Na2$2^VMtvO?d0o;Hf_!GzE^LC!|iQzquK zAZ-*i6FRTr-i(?_1_2&3pl)CXDCYqV!tf=v|8qf-rt3>|&9RR6mpNtl%Mw8>L_gCB zvCR@-5es?T96Tj{T;67Q8w;S=@Csab4aqnc4K|%dlx*!Zsg||0%x#o0ws^ literal 0 HcmV?d00001 diff --git a/SimplySerial/SimplySerial.cs b/SimplySerial/SimplySerial.cs index cf8b388..12640f5 100644 --- a/SimplySerial/SimplySerial.cs +++ b/SimplySerial/SimplySerial.cs @@ -153,7 +153,7 @@ namespace SimplySerial Output(e.GetType() + " occurred while attempting to read/write to/from " + port.name + "."); serialPort.Dispose(); Thread.Sleep(1000); - continue; + break; } } } while (autoConnect > AutoConnect.NONE); @@ -249,6 +249,7 @@ namespace SimplySerial if (!argument[1].StartsWith("COM")) newPort = "COM" + argument[1]; port.name = newPort; + autoConnect = AutoConnect.ONE; } // validate baud rate, terminate on error @@ -700,7 +701,8 @@ namespace SimplySerial // 'l' triggers the 'list available ports' output and supersedes all other command-line arguments aside from 'help' // 'q' enables the 'quiet' option, which needs to be enabled before something that would normally generate console output // 'n' enables the 'nowait' option, which needs to be enabled before anything that would trigger an artificial delay - foreach (char c in "?hlqn") + // 'c' is the 'comport' setting, which needs to be processed before 'autoconnect' + foreach (char c in "?hlqnc") { if (x[0] == c) return (-1);