From 36f2d7dab1e65507841067073dd66d72b2dc663c Mon Sep 17 00:00:00 2001
From: Jan Breuer <jan.breuer@jaybee.cz>
Date: 周二, 04 12月 2012 17:24:30 +0800
Subject: [PATCH] Correct type refactoryng in README

---
 test-parser.c |   22 +++++++++-------------
 1 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/test-parser.c b/test-parser.c
index 2bc38dc..66ca530 100644
--- a/test-parser.c
+++ b/test-parser.c
@@ -38,14 +38,8 @@
 #include <stdlib.h>
 #include <string.h>
 #include "scpi/scpi.h"
-#include "scpi/scpi_ieee488.h"
-#include "scpi/scpi_error.h"
-#include "scpi/scpi_constants.h"
-#include "scpi/scpi_minimal.h"
-#include "scpi/scpi_utils.h"
-#include "scpi/scpi_units.h"
 
-int DMM_MeasureVoltageDcQ(scpi_context_t * context) {
+scpi_result_t DMM_MeasureVoltageDcQ(scpi_t * context) {
     scpi_number_t param1, param2;
     char bf[15];
     fprintf(stderr, "meas:volt:dc\r\n"); // debug command name   
@@ -63,7 +57,8 @@
     }
 
     SCPI_ResultDouble(context, 0);
-    return 0;
+    
+    return SCPI_RES_OK;
 }
 
 scpi_command_t scpi_commands[] = {
@@ -85,6 +80,7 @@
     /* Required SCPI commands (SCPI std V1999.0 4.2.1) */
     {.pattern = "SYSTem:ERRor?", .callback = SCPI_SystemErrorNextQ,},
     {.pattern = "SYSTem:ERRor:NEXT?", .callback = SCPI_SystemErrorNextQ,},
+    {.pattern = "SYSTem:ERRor:COUNt?", .callback = SCPI_SystemErrorCountQ,},
     {.pattern = "SYSTem:VERSion?", .callback = SCPI_SystemVersionQ,},
 
     //{.pattern = "STATus:OPERation?", .callback = scpi_stub_callback,},
@@ -115,12 +111,12 @@
     SCPI_CMD_LIST_END
 };
 
-size_t SCPI_Write(scpi_context_t * context, const char * data, size_t len) {
+size_t SCPI_Write(scpi_t * context, const char * data, size_t len) {
     (void) context;
     return fwrite(data, 1, len, stdout);
 }
 
-int SCPI_Error(scpi_context_t * context, int_fast16_t err) {
+int SCPI_Error(scpi_t * context, int_fast16_t err) {
     (void) context;
 
     fprintf(stderr, "**ERROR: %d, \"%s\"\r\n", (int32_t) err, SCPI_ErrorTranslate(err));
@@ -143,7 +139,7 @@
     //    .data = (char[SCPI_BUFFER_LENGTH]){},
 };
 
-scpi_context_t scpi_context;
+scpi_t scpi_context;
 
 /*
  * 
@@ -187,8 +183,8 @@
     // interactive demo
     //char smbuffer[10];
     //while (1) {
-    //    fgets(smbuffer, 10, stdin);
-    //    SCPI_Input(&scpi_context, smbuffer, strlen(smbuffer));
+    //     fgets(smbuffer, 10, stdin);
+    //     SCPI_Input(&scpi_context, smbuffer, strlen(smbuffer));
     //}
 
 

--
Gitblit v1.9.1