Skip to content

Commit

Permalink
Support non-AT+ prefixed commands like ATE in auto mode
Browse files Browse the repository at this point in the history
  • Loading branch information
deviousasti committed Aug 19, 2020
1 parent ec53a51 commit 0605785
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/AtCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Text.RegularExpressions;
using System.Windows;

namespace AtTerm
Expand Down Expand Up @@ -55,6 +56,7 @@ public static string MTKCheckSum(string cmd)
public static string Qualify(string commandText)
{
return String.IsNullOrWhiteSpace(commandText) ? "AT" :
Regex.IsMatch(commandText, @"AT\w*") ? commandText :
commandText.StartsWith(">") ? commandText.Substring(1) :
commandText.StartsWith("$") ? $"{commandText}*{MTKCheckSum(commandText)}" :
commandText.StartsWith("AT+") ? commandText :
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/Commands.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
AT+CFUN=<fun>,<fun>
AT+CMGR
ATE<fun>
ATE0
AT+QPOWD=<fun>
AT+QGNSSC=<fun>
AT+QIACT
Expand Down

0 comments on commit 0605785

Please sign in to comment.