From 4e9c5ae1db57ab4c3329dc7e0d1ad9b94e3d94bb Mon Sep 17 00:00:00 2001
From: Jan Breuer <jan.breuer@jaybee.cz>
Date: 周三, 13 3月 2013 01:43:43 +0800
Subject: [PATCH] Divide parser core functions

---
 examples/common/scpi-def.c |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/examples/common/scpi-def.c b/examples/common/scpi-def.c
index 0b9bfbd..16711c3 100644
--- a/examples/common/scpi-def.c
+++ b/examples/common/scpi-def.c
@@ -47,15 +47,19 @@
 
     // read first parameter if present
     if (SCPI_ParamNumber(context, &param1, false)) {
-        SCPI_NumberToStr(context, &param1, bf, 15);
-        fprintf(stderr, "\tP1=%s\r\n", bf);
     }
 
     // read second paraeter if present
     if (SCPI_ParamNumber(context, &param2, false)) {
-        SCPI_NumberToStr(context, &param2, bf, 15);
-        fprintf(stderr, "\tP2=%s\r\n", bf);
     }
+
+    
+    SCPI_NumberToStr(context, &param1, bf, 15);
+    fprintf(stderr, "\tP1=%s\r\n", bf);
+
+    
+    SCPI_NumberToStr(context, &param2, bf, 15);
+    fprintf(stderr, "\tP2=%s\r\n", bf);
 
     SCPI_ResultDouble(context, 0);
     
@@ -108,6 +112,8 @@
     {.pattern = "MEASure:FRESistance?", .callback = SCPI_StubQ,},
     {.pattern = "MEASure:FREQuency?", .callback = SCPI_StubQ,},
     {.pattern = "MEASure:PERiod?", .callback = SCPI_StubQ,},
+    
+    {.pattern = "SYSTem:COMMunication:TCPIP:CONTROL?", .callback = SCPI_SystemCommTcpipControlQ,},
 
     SCPI_CMD_LIST_END
 };
@@ -117,7 +123,8 @@
     .error = SCPI_Error,
     .reset = SCPI_Reset,
     .test = SCPI_Test,
-    .srq = SCPI_Srq,
+    .control = SCPI_Control,
+    .flush = SCPI_Flush,
 };
 
 #define SCPI_INPUT_BUFFER_LENGTH 256

--
Gitblit v1.9.1