summaryrefslogtreecommitdiff
path: root/parser.c
diff options
context:
space:
mode:
authorMichael J. Chudobiak <mjc@avtechpulse.com>2012-11-13 15:13:34 -0500
committerMichael J. Chudobiak <mjc@avtechpulse.com>2012-11-13 15:13:34 -0500
commit9e168483a2b2b451388d6e474c85ec080b7ffcbb (patch)
tree38347cdddda423c8da63f9c585d823edd1cc483f /parser.c
parent8d092ef3e8d7c0dd8c4be63391d39dc274ca4abe (diff)
warn if command received during self-cal
Diffstat (limited to 'parser.c')
-rw-r--r--parser.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/parser.c b/parser.c
index 58866f8..48d4825 100644
--- a/parser.c
+++ b/parser.c
@@ -628,9 +628,6 @@ static gchar* filter_input (gchar *raw_in)
void Parser_main (char *raw_in, int interactive_terminal, void(*cbfunc)(gpointer, gchar *), gpointer user_data)
{
- static GStaticMutex mutex = G_STATIC_MUTEX_INIT;
- g_static_mutex_lock (&mutex);
-
int in_pos; /* this identifies the single character of in being processed */
int command_depth; /* how many command words have been parsed */
int old_command_depth; /* save this if in case of a compound message */
@@ -648,6 +645,21 @@ void Parser_main (char *raw_in, int interactive_terminal, void(*cbfunc)(gpointer
/* the message is a compound one */
+ // Commands cause error if calibration in progress.
+ if (globals.Sys.cal_in_progress) {
+ gchar *error_msg = NULL;
+ queue_error_from_parser(&error_msg, Cal_In_Progress);
+ if (interactive_terminal) {
+ (*cbfunc)(user_data, error_msg);
+ }
+ g_free (error_msg);
+ return;
+ }
+
+
+ static GStaticMutex mutex = G_STATIC_MUTEX_INIT;
+ g_static_mutex_lock (&mutex);
+
int is_query;
int command_type; /* combination of is_query, parameter_found, and units_found */