Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
FileManager.h@2:18e004a47f52, 2016-05-10 (annotated)
- Committer:
- Lucyjungz
- Date:
- Tue May 10 11:09:47 2016 +0000
- Revision:
- 2:18e004a47f52
- Parent:
- 1:1f1f2b99756b
- Child:
- 3:6e08d0bba1bb
Bug fix
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Lucyjungz | 1:1f1f2b99756b | 1 | #define DEVICE_NAME "sd" |
Lucyjungz | 1:1f1f2b99756b | 2 | |
Lucyjungz | 1:1f1f2b99756b | 3 | // DEVICE_NAME must be put in between "/" for file name |
nsrwsurasak | 0:a27e0d3581d1 | 4 | #define SETUP_FILE_NAME "/sd/RMS_Tester.xml" |
Lucyjungz | 2:18e004a47f52 | 5 | #define GPS_LOG_FILE_NAME "/sd/YYYY-MM-DD.gps.csv " |
Lucyjungz | 1:1f1f2b99756b | 6 | #define RTL_LOG_FILE_NAME "/sd/YYYY-MM-DD.rtl.csv" |
nsrwsurasak | 0:a27e0d3581d1 | 7 | #define VARIABLE_FILE_NAME "/sd/20160216185627_upload.xml" |
nsrwsurasak | 0:a27e0d3581d1 | 8 | #define MINIRMS_LOG_FILE_NAME "/sd/miniRMS.log" |
nsrwsurasak | 0:a27e0d3581d1 | 9 | |
nsrwsurasak | 0:a27e0d3581d1 | 10 | #define GPS_TAG "<Gps>" |
nsrwsurasak | 0:a27e0d3581d1 | 11 | #define DATA_TAG "<Data>" |
nsrwsurasak | 0:a27e0d3581d1 | 12 | #define UPDATE_INTERVAL_TAG "<Update_Interval>" |
nsrwsurasak | 0:a27e0d3581d1 | 13 | #define VAR_NAME_TAG "<varName>" |
nsrwsurasak | 0:a27e0d3581d1 | 14 | #define VAR_ADDR_TAG "<varAddress>" |
nsrwsurasak | 0:a27e0d3581d1 | 15 | #define XMLTEXT_SIZE 20 |
nsrwsurasak | 0:a27e0d3581d1 | 16 | |
nsrwsurasak | 0:a27e0d3581d1 | 17 | #define VAR_NAME_MAX_SIZE 20 |
nsrwsurasak | 0:a27e0d3581d1 | 18 | #define VAR_ADDR_MAX_SIZE 10 |
nsrwsurasak | 0:a27e0d3581d1 | 19 | #define MAX_VAR 50 |
nsrwsurasak | 0:a27e0d3581d1 | 20 | |
Lucyjungz | 1:1f1f2b99756b | 21 | #define RMS_HEADER_TIME "Time" |
Lucyjungz | 1:1f1f2b99756b | 22 | |
nsrwsurasak | 0:a27e0d3581d1 | 23 | typedef enum { |
nsrwsurasak | 0:a27e0d3581d1 | 24 | STATE_FINDING, /** Finding */ |
nsrwsurasak | 0:a27e0d3581d1 | 25 | STATE_FOUND_DATA, /** Found Data tag */ |
nsrwsurasak | 0:a27e0d3581d1 | 26 | STATE_FOUND_DATA_INTERVAL, /**< Found update internal of tag*/ |
nsrwsurasak | 0:a27e0d3581d1 | 27 | STATE_FOUND_GPS, /** Found GPS tag */ |
nsrwsurasak | 0:a27e0d3581d1 | 28 | STATE_FOUND_GPS_INTERVAL, /** Found update internal of GPS*/ |
nsrwsurasak | 0:a27e0d3581d1 | 29 | } ReadingFileState; |
nsrwsurasak | 0:a27e0d3581d1 | 30 | |
nsrwsurasak | 0:a27e0d3581d1 | 31 | |
nsrwsurasak | 0:a27e0d3581d1 | 32 | typedef struct { |
nsrwsurasak | 0:a27e0d3581d1 | 33 | char varName[VAR_NAME_MAX_SIZE]; |
nsrwsurasak | 0:a27e0d3581d1 | 34 | char varAddress[VAR_ADDR_MAX_SIZE+1]; |
nsrwsurasak | 0:a27e0d3581d1 | 35 | } Variable_Data_TypeDef; |
nsrwsurasak | 0:a27e0d3581d1 | 36 | |
nsrwsurasak | 0:a27e0d3581d1 | 37 | void readSetupFile(); |
nsrwsurasak | 0:a27e0d3581d1 | 38 | void delete_file(char filename[]); |
nsrwsurasak | 0:a27e0d3581d1 | 39 | int GPSInterval(); |
nsrwsurasak | 0:a27e0d3581d1 | 40 | int DataInterval(); |
Lucyjungz | 1:1f1f2b99756b | 41 | void logGPSData(time_t timestamp ,char lat[], char longti[]); |
nsrwsurasak | 0:a27e0d3581d1 | 42 | void logSystemData(float gps_interval); |
nsrwsurasak | 0:a27e0d3581d1 | 43 | Variable_Data_TypeDef * readVarFile(); |
nsrwsurasak | 0:a27e0d3581d1 | 44 | int getAmountVarList(); |
nsrwsurasak | 0:a27e0d3581d1 | 45 | Variable_Data_TypeDef * getVarList(); |
Lucyjungz | 1:1f1f2b99756b | 46 | void logRMSData(time_t timestamp ,float * var, int size); |
Lucyjungz | 1:1f1f2b99756b | 47 | void logRMSHeader(time_t timestamp); |
Lucyjungz | 1:1f1f2b99756b | 48 | bool is_file_exist(char filename[]); |