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.
Dependencies: mbed MODSERIAL FATFileSystem
Diff: MbedLogger/MbedLogger.hpp
- Revision:
- 82:0981b9ada820
- Parent:
- 79:3688c3a0d7f4
- Child:
- 86:ba3a118b0080
--- a/MbedLogger/MbedLogger.hpp Thu Nov 08 22:30:32 2018 +0000
+++ b/MbedLogger/MbedLogger.hpp Fri Feb 15 16:00:17 2019 +0000
@@ -30,15 +30,22 @@
END_TX_1,
END_TX_2
};
+//struct for saving names of log and diag files
+//struct logFiles {
+// string diagFile;
+// string logFile;
+// };
+
class MbedLogger {
public:
MbedLogger(string file_system_input_string); //constructor
void createTestLog(); //test log function
+ // logFiles logFilesStruct;
void appendLogFile(int current_state, int option); //check if you have orphaned file pointers before this (file should not be open already)
-
+ void appendDiagFile(char *printf_string, int flushclose);
//save float array to file (append each time)
void saveDataToFile(int input_state, float *input);
@@ -118,6 +125,7 @@
void closeIncompleteFile();
void initializeLogFile();
+ void initializeDiagFile(int print_diag);
int fileTransmitState();
@@ -134,6 +142,7 @@
void receiveMissionDataWithTicker();
void closeLogFile(); //this sets pointer to null and checks if it is closed otherwise
+ void closeDiagFile();
void specifyFileForTransmit(string input_string);
void transmitFileFromDirectory(int file_number);
@@ -160,6 +169,7 @@
int getLogSize(); //used in state machine
string _heading_string;
+ string _diag_heading_string;
void continuouslyTransmitData();
@@ -189,7 +199,8 @@
char _file_name[256]; //file name placeholder
char _line_buffer[256]; //line buffer used to read file line by line
- FILE *_fp; //the file pointer
+ FILE *_fp; //the log file pointer
+ FILE *_fp2; // the diag file pointer
vector <int> _data_packet;
@@ -229,6 +240,7 @@
string _file_system_string;
string _full_file_path_string;
+ string _full_diagfile_path_string;
bool _file_transmission_complete; //was volatile screwing up the state of this?