From 834faf3b0a91d6af089258d9917fbc86a92699a1 Mon Sep 17 00:00:00 2001
From: Jan Breuer <jan.breuer@jaybee.cz>
Date: 周日, 18 1月 2015 16:39:11 +0800
Subject: [PATCH] Resolve #18 *TST? should return 0 as OK

---
 examples/test-LwIP-netconn/scpi_server.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/examples/test-LwIP-netconn/scpi_server.c b/examples/test-LwIP-netconn/scpi_server.c
index ccf5bc0..afbfd7a 100644
--- a/examples/test-LwIP-netconn/scpi_server.c
+++ b/examples/test-LwIP-netconn/scpi_server.c
@@ -53,6 +53,7 @@
 #define CONTROL_PORT 5026
 
 #define SCPI_THREAD_PRIO (tskIDLE_PRIORITY + 2)
+#define SCPI_THREAD_STACKSIZE (512)
 
 #define SCPI_MSG_TIMEOUT                0
 #define SCPI_MSG_TEST                   1
@@ -73,12 +74,12 @@
     //fd_set fds;
 } user_data_t;
 
-struct _queue_event_t __attribute__ ((__packed__))
+struct _queue_event_t
 {
     uint8_t cmd;
     uint8_t param1;
     int16_t param2;
-};
+} __attribute__ ((__packed__));
 typedef struct _queue_event_t queue_event_t;
 
 
@@ -145,10 +146,13 @@
     return SCPI_RES_OK;
 }
 
+/**
+ * Return 0 as OK and other number as error
+ */
 scpi_result_t SCPI_Test(scpi_t * context) {
     (void) context;
     iprintf("**Test\r\n");
-    return SCPI_RES_OK;
+    return 0;
 }
 
 scpi_result_t SCPI_Reset(scpi_t * context) {
@@ -410,5 +414,5 @@
 }
 
 void scpi_server_init(void) {
-    sys_thread_new("SCPI", scpi_server_thread, NULL, 2 * DEFAULT_THREAD_STACKSIZE, SCPI_THREAD_PRIO);
+    sys_thread_new("SCPI", scpi_server_thread, NULL, SCPI_THREAD_STACKSIZE, SCPI_THREAD_PRIO);
 }
\ No newline at end of file

--
Gitblit v1.9.1