From d6f4a5106bebb23826c0867494ade7f4d7ebd1f3 Mon Sep 17 00:00:00 2001
From: Jan Breuer <jan.breuer@jaybee.cz>
Date: 周日, 18 1月 2015 19:40:33 +0800
Subject: [PATCH] Correct *TST? callback in header file

---
 examples/test-tcp/main.c |   25 +++++++++++++++++++++----
 1 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/examples/test-tcp/main.c b/examples/test-tcp/main.c
index 55dc792..596a4cf 100644
--- a/examples/test-tcp/main.c
+++ b/examples/test-tcp/main.c
@@ -56,6 +56,10 @@
     return 0;
 }
 
+scpi_result_t SCPI_Flush(scpi_t * context) {    
+    return SCPI_RES_OK;
+}
+
 int SCPI_Error(scpi_t * context, int_fast16_t err) {
     (void) context;
     // BEEP
@@ -63,13 +67,23 @@
     return 0;
 }
 
-scpi_result_t SCPI_Srq(scpi_t * context) {
-    scpi_reg_val_t stb = SCPI_RegGet(context, SCPI_REG_STB);
-    fprintf(stderr, "**SRQ: 0x%X (%d)\r\n", stb, stb);
+scpi_result_t SCPI_Control(scpi_t * context, scpi_ctrl_name_t ctrl, scpi_reg_val_t val) {
+    if (SCPI_CTRL_SRQ == ctrl) {
+        fprintf(stderr, "**SRQ: 0x%X (%d)\r\n", val, val);
+    } else {
+        fprintf(stderr, "**CTRL %02x: 0x%X (%d)\r\n", ctrl, val, val);
+    }
     return SCPI_RES_OK;
 }
 
-scpi_result_t SCPI_Test(scpi_t * context) {
+/**
+ * Callback for *TST? command
+ * 
+ * It returns directly the result of the test
+ * @param context
+ * @return 0 means "test was OK", other values means, that some error bits are set
+ */
+int32_t SCPI_Test(scpi_t * context) {
     fprintf(stderr, "**Test\r\n");
     return SCPI_RES_OK;
 }
@@ -79,6 +93,9 @@
     return SCPI_RES_OK;
 }
 
+scpi_result_t SCPI_SystemCommTcpipControlQ(scpi_t * context) {
+    return SCPI_RES_ERR;
+}
 
 static int createServer(int port) {
     int fd;

--
Gitblit v1.9.1