From c49b34ae42b691518a1100346d7c749e35bc3ba3 Mon Sep 17 00:00:00 2001
From: Jan Breuer <jan.breuer@jaybee.cz>
Date: 周三, 22 4月 2015 02:22:07 +0800
Subject: [PATCH] Make public SCPI_LongToStr, SCPI_DoubleToStr

---
 examples/common/scpi-def.c |   21 ++++++++++++++++++---
 1 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/examples/common/scpi-def.c b/examples/common/scpi-def.c
index 562b67b..dbb869b 100644
--- a/examples/common/scpi-def.c
+++ b/examples/common/scpi-def.c
@@ -149,7 +149,7 @@
     }
     
     SCPI_ChoiceToName(trigger_source, param, &name);
-    fprintf(stderr, "\tP1=%s (%d)\r\n", name, param);
+    fprintf(stderr, "\tP1=%s (%ld)\r\n", name, (long int)param);
     
     SCPI_ResultInt(context, param);
 
@@ -186,6 +186,21 @@
     return SCPI_RES_OK;
 }
 
+/**
+ * Reimplement IEEE488.2 *TST?
+ *
+ * Result should be 0 if everything is ok
+ * Result should be 1 if something goes wrong
+ *
+ * Return SCPI_RES_OK
+ */
+scpi_result_t My_CoreTstQ(scpi_t * context) {
+
+    SCPI_ResultInt(context, 0);
+
+    return SCPI_RES_OK;
+}
+
 static const scpi_command_t scpi_commands[] = {
     /* IEEE Mandated Commands (SCPI std V1999.0 4.1.1) */
     { .pattern = "*CLS", .callback = SCPI_CoreCls,},
@@ -199,7 +214,7 @@
     { .pattern = "*SRE", .callback = SCPI_CoreSre,},
     { .pattern = "*SRE?", .callback = SCPI_CoreSreQ,},
     { .pattern = "*STB?", .callback = SCPI_CoreStbQ,},
-    { .pattern = "*TST?", .callback = SCPI_CoreTstQ,},
+    { .pattern = "*TST?", .callback = My_CoreTstQ,},
     { .pattern = "*WAI", .callback = SCPI_CoreWai,},
 
     /* Required SCPI commands (SCPI std V1999.0 4.2.1) */
@@ -249,7 +264,6 @@
     .control = SCPI_Control,
     .flush = SCPI_Flush,
     .reset = SCPI_Reset,
-    .test = SCPI_Test,
 };
 
 #define SCPI_INPUT_BUFFER_LENGTH 256
@@ -269,3 +283,4 @@
     .units = scpi_units_def,
     .idn = {"MANUFACTURE", "INSTR2013", NULL, "01-02"},
 };
+

--
Gitblit v1.9.1