1st release (without comment)

Files at this revision

API Documentation at this revision

Comitter:
nsrwsurasak
Date:
Mon Sep 26 08:26:13 2016 +0000
Parent:
11:2e1543c03b22
Commit message:
Change error type refer requirement.

Changed in this revision

RMS_UART.cpp Show annotated file Show diff for this revision Revisions of this file
RMS_UART.h Show annotated file Show diff for this revision Revisions of this file
--- a/RMS_UART.cpp	Tue Sep 20 23:55:52 2016 +0000
+++ b/RMS_UART.cpp	Mon Sep 26 08:26:13 2016 +0000
@@ -26,7 +26,6 @@
 
 char FileName[MSG2FILENAME];                    // Command Buffer 
 FileRequest_CMD_Type reqFileCmdType = REQ_NONE; // An Events Request and management
-Error_Code_Type gErrorCode = EC_SUCCESS;        // An Error definition
 bool MsgContentManagement = false;              // Command and Contents buffer management
 bool SystemStandBy = false;                     // Mini-RMS system standby flag
 bool OverBufSize   = false;                     // Content buffer size overload
@@ -153,18 +152,6 @@
         UART_File_event = true;
         
     }
-    /* Command type is check error ($ce) */
-    else if(strstr(Msg_RxBuf,CMD_CHECK_ERROR))
-    {
-        /* Send an Error definition */
-        serial_device.printf("%d",gErrorCode);
-        
-        /* Clear an error to EC_SUCCESS */
-        gErrorCode = EC_SUCCESS;
-        
-        /* Clear command index and buffer */
-        ClearCmdIndexAndBuf();
-    }
     /* RMS sent "LK" acknowledge */
     else if(strstr(Msg_RxBuf,RMS_STATUS_LIST_OK))
     {
@@ -329,11 +316,8 @@
  */
 void GetCmdError()
 {   
-    /* Error is command not found */
-    gErrorCode = EC_CMD_ERROR;
-    
     /* Send error status "ER" */
-    serial_device.printf(FLAG_STATUS_ERROR);
+    serial_device.printf(EC_CMD_ERROR);
     
     /* Clear command index and buffer */
     ClearCmdIndexAndBuf();
--- a/RMS_UART.h	Tue Sep 20 23:55:52 2016 +0000
+++ b/RMS_UART.h	Mon Sep 26 08:26:13 2016 +0000
@@ -24,7 +24,6 @@
 #define CMD_SYS_RESTART         "rs"
 #define CMD_SYS_PAUSE           "sp"
 #define CMD_HELP                "-h"
-#define CMD_CHECK_ERROR         "ce"
 
 #define FOUND_CSV_FILE          ".csv"
 #define FOUND_XML_FILE          ".xml"
@@ -39,6 +38,11 @@
 #define RMS_STATUS_LIST_OK      "LK"
 #define RMS_STATUS_READ_OK      "RK"
 
+#define EC_CMD_ERROR            "E1"
+#define EC_FILE_NOT_FOUND       "E2"
+#define EC_WRITE_ERROR          "E3"
+#define EC_FILE_TOO_LARGE       "E4"
+
 #define BPS_9600                9600
 
 /** 
@@ -54,25 +58,12 @@
     REQ_READ_CHECK              /** Read Check Type : Check available file as in SD card */
 } FileRequest_CMD_Type;
 
-/** 
-  * @brief  Error type definition  
-  */ 
-typedef enum {
-    EC_SUCCESS          = 0,    /** SUCCESS Type        : Do not have an error */
-    EC_CMD_ERROR        = 1,    /** CMD_ERROR Type      : Command not found */
-    EC_FILE_NOT_FOUND   = 2,    /** FILE_NOT_FOUND Type : File not available as in SD card */
-    EC_WRITE_ERROR      = 3,    /** WRITE_ERROR Type    : Do not write the file */
-    EC_FILE_TOO_LARGE   = 4     /** FILE_TOO_LARGE Type : Content is too large over buffer size */
-} Error_Code_Type;
-
 /* ###############  Declare functions extern ################## */
 extern Serial serial_device;
 extern FileRequest_CMD_Type reqFileCmdType;
 extern char FileName[MSG2FILENAME];
 extern char Content_RxBuf[CONTENT_BUF_SIZE + 1];
 extern bool MsgContentManagement;
-extern Error_Code_Type gErrorCode;
-
 
 /* ###############  Function Prototype  ################## */
 /**