1st release (without comment)

Committer:
nsrwsurasak
Date:
Thu Sep 15 08:58:30 2016 +0000
Revision:
2:38567b4310a4
Parent:
1:5e6c5fbd48d6
Child:
3:ff36fb2cefb0
Fix bug

Who changed what in which revision?

UserRevisionLine numberNew contents of line
nsrwsurasak 1:5e6c5fbd48d6 1 /**
nsrwsurasak 1:5e6c5fbd48d6 2 ******************************************************************************
nsrwsurasak 1:5e6c5fbd48d6 3 * @file RMS_UART.cpp
nsrwsurasak 1:5e6c5fbd48d6 4 * @author Surasak N
nsrwsurasak 1:5e6c5fbd48d6 5 * @version V1
nsrwsurasak 1:5e6c5fbd48d6 6 * @date 15/09/2016
nsrwsurasak 1:5e6c5fbd48d6 7 * @brief Command for Mini-RMS <> RMS via UART
nsrwsurasak 1:5e6c5fbd48d6 8 ******************************************************************************/
nsrwsurasak 1:5e6c5fbd48d6 9
nsrwsurasak 0:bc10ea82aec3 10 #ifndef RMS_UART_H
nsrwsurasak 0:bc10ea82aec3 11 #define RMS_UART_H
nsrwsurasak 0:bc10ea82aec3 12
nsrwsurasak 0:bc10ea82aec3 13 #define EXT_SERIAL 1
nsrwsurasak 0:bc10ea82aec3 14 #define MSG_BUF_SIZE 25
nsrwsurasak 0:bc10ea82aec3 15 #define MSG2CMD 2
nsrwsurasak 0:bc10ea82aec3 16 #define MSG2FILENAME (MSG_BUF_SIZE - MSG2CMD)
nsrwsurasak 1:5e6c5fbd48d6 17 #define CONTENT_BUF_SIZE 1000
nsrwsurasak 1:5e6c5fbd48d6 18
nsrwsurasak 1:5e6c5fbd48d6 19 #define CMD_END_OF_CONTENT "*end*"
nsrwsurasak 1:5e6c5fbd48d6 20 #define CMD_LISTFILE "ls"
nsrwsurasak 1:5e6c5fbd48d6 21 #define CMD_READFILE "rd"
nsrwsurasak 1:5e6c5fbd48d6 22 #define CMD_WRITEFILE "ed"
nsrwsurasak 1:5e6c5fbd48d6 23 #define CMD_DELETEFILE "df"
nsrwsurasak 1:5e6c5fbd48d6 24 #define CMD_SYS_RESTART "rs"
nsrwsurasak 1:5e6c5fbd48d6 25
nsrwsurasak 1:5e6c5fbd48d6 26 #define FOUND_CSV_FILE ".csv"
nsrwsurasak 1:5e6c5fbd48d6 27 #define FOUND_XML_FILE ".xml"
nsrwsurasak 1:5e6c5fbd48d6 28 #define FOUND_LOG_FILE ".log"
nsrwsurasak 0:bc10ea82aec3 29
nsrwsurasak 0:bc10ea82aec3 30 #define BPS_9600 9600
nsrwsurasak 1:5e6c5fbd48d6 31
nsrwsurasak 1:5e6c5fbd48d6 32 /**
nsrwsurasak 1:5e6c5fbd48d6 33 * @brief Command request definition
nsrwsurasak 1:5e6c5fbd48d6 34 */
nsrwsurasak 1:5e6c5fbd48d6 35 typedef enum {
nsrwsurasak 1:5e6c5fbd48d6 36 REQ_NONE, /** None Type : UART do nothing */
nsrwsurasak 1:5e6c5fbd48d6 37 REQ_LISTDIR, /** Connect Type : List files as in directory */
nsrwsurasak 1:5e6c5fbd48d6 38 REQ_READ, /** Read Type : Read file as file name */
nsrwsurasak 1:5e6c5fbd48d6 39 REQ_WRITE, /** Write Type : Create/Write as file name and contens */
nsrwsurasak 1:5e6c5fbd48d6 40 REQ_DELETE /** Delete Type : Delete file as file name */
nsrwsurasak 1:5e6c5fbd48d6 41 } FileRequest_CMD_Type;
nsrwsurasak 0:bc10ea82aec3 42
nsrwsurasak 1:5e6c5fbd48d6 43 /* ############### Declare functions extern ################## */
nsrwsurasak 1:5e6c5fbd48d6 44 extern Serial serial_device;
nsrwsurasak 1:5e6c5fbd48d6 45 extern FileRequest_CMD_Type reqFileCmdType;
nsrwsurasak 1:5e6c5fbd48d6 46 extern char FileName[MSG2FILENAME];
nsrwsurasak 1:5e6c5fbd48d6 47 extern char Content_RxBuf[CONTENT_BUF_SIZE + 1];
nsrwsurasak 2:38567b4310a4 48 extern bool MsgContentManagement;
nsrwsurasak 1:5e6c5fbd48d6 49
nsrwsurasak 1:5e6c5fbd48d6 50 /* ############### Function Prototype ################## */
nsrwsurasak 1:5e6c5fbd48d6 51 /**
nsrwsurasak 1:5e6c5fbd48d6 52 * @note The detail as RMS_UART.cpp
nsrwsurasak 1:5e6c5fbd48d6 53 */
nsrwsurasak 1:5e6c5fbd48d6 54 void Init_SerialDevice();
nsrwsurasak 0:bc10ea82aec3 55 void RxMsgInterruptCallback();
nsrwsurasak 0:bc10ea82aec3 56 void DoTheMsgCmd();
nsrwsurasak 0:bc10ea82aec3 57 void DoTheContent();
nsrwsurasak 0:bc10ea82aec3 58 void GetListFileCmd();
nsrwsurasak 0:bc10ea82aec3 59 void CheckReadEditCmd();
nsrwsurasak 0:bc10ea82aec3 60 void GetFileName();
nsrwsurasak 0:bc10ea82aec3 61 void SendContentToFile();
nsrwsurasak 0:bc10ea82aec3 62 void GetCmdError();
nsrwsurasak 0:bc10ea82aec3 63 void ClearCmdIndexAndBuf();
nsrwsurasak 0:bc10ea82aec3 64 void ClearContentIndexAndBuf();
nsrwsurasak 1:5e6c5fbd48d6 65 void CheckContentMsg();
nsrwsurasak 2:38567b4310a4 66 void ClearFileNameBuf();
nsrwsurasak 1:5e6c5fbd48d6 67 void CheckCmdType();
nsrwsurasak 1:5e6c5fbd48d6 68 void ClearFileNameBuf();
nsrwsurasak 0:bc10ea82aec3 69
nsrwsurasak 1:5e6c5fbd48d6 70 #endif /* End of RMS_UART_H */