summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root@avtech.domain.avtechpulse.com>1999-12-31 19:37:14 -0500
committerroot <root@avtech.domain.avtechpulse.com>1999-12-31 19:37:14 -0500
commit8f433cde879a40fc96f295bfa35e5869781adc5d (patch)
treee497e9118c5cca14806718aa2e74446d5a07d7bd
parent047fcb18ded8438d5763ad537c64a2c110052a11 (diff)
gpib queries should work fully now
-rw-r--r--gpib.c5
-rw-r--r--gpib.h4
-rw-r--r--instr-daemon.c2
-rw-r--r--parser.c6
4 files changed, 10 insertions, 7 deletions
diff --git a/gpib.c b/gpib.c
index 9ebefa1..2277b7a 100644
--- a/gpib.c
+++ b/gpib.c
@@ -771,8 +771,11 @@ static void TNT_Holdoff_off()
}
-int GPIB_send_query_response(char *in_string)
+int GPIB_send_query_response(gpointer *ignore_this, char *in_string)
{
+ g_assert (ignore_this == NULL);
+ g_assert (in_string != NULL);
+
if (!globals.HWDetect.gpib) {
return OK;
}
diff --git a/gpib.h b/gpib.h
index cf00b34..2da0cc1 100644
--- a/gpib.h
+++ b/gpib.h
@@ -1,5 +1,7 @@
/* define macros */
+#include <glib.h>
+
void GPIB_Set_Execution_Error(void);
void GPIB_Set_Command_Error(void);
void GPIB_Set_Query_Error(void);
@@ -10,7 +12,7 @@ int GPIB_check_for_device_clear_signal(void);
int GPIB_check_for_device_clear_signal(void);
int GPIB_check_for_messages(char *gpib_buf);
int GPIB_handle_new_input(char *gpib_buf);
-int GPIB_send_query_response(char *out_buffer);
+int GPIB_send_query_response(gpointer *ignore_this, char *in_string);
void GPIB_check_remote_status (int *is_remote, int *is_lockout);
unsigned char GPIB_response_already_pending ();
void GPIB_go_to_local ();
diff --git a/instr-daemon.c b/instr-daemon.c
index 2534d73..4c56ceb 100644
--- a/instr-daemon.c
+++ b/instr-daemon.c
@@ -345,7 +345,7 @@ static gboolean periodic_poll (void)
GPIB_check_for_device_clear_signal();
if (GPIB_check_for_messages(globals.Registers.gpib_buffer)) {
if (GPIB_handle_new_input(globals.Registers.gpib_buffer)) {
- Parser_main(globals.Registers.gpib_buffer, 1, GPIB_send_query_response, NULL);
+ Parser_main(globals.Registers.gpib_buffer, 0, GPIB_send_query_response, NULL);
}
}
GPIB_check_for_device_clear_signal();
diff --git a/parser.c b/parser.c
index c88bbf5..b42fbf6 100644
--- a/parser.c
+++ b/parser.c
@@ -1064,10 +1064,8 @@ void Parser_main (char *raw_in, int interactive_terminal, void(*cbfunc)(gpointer
if (interactive_terminal) {
(*cbfunc)(user_data, error_response);
}
- } else {
- if (interactive_terminal) {
- (*cbfunc)(user_data, response);
- }
+ } else if (response != NULL) {
+ (*cbfunc)(user_data, response);
}
g_free (units);