Flying Sea Glider / Mbed 2 deprecated 2019_13sep_jcw_nosd

Dependencies:   mbed MODSERIAL FATFileSystem

Committer:
tnhnrl
Date:
Wed Dec 20 13:52:50 2017 +0000
Revision:
32:f2f8ae34aadc
Child:
34:9b66c5188051
revA

Who changed what in which revision?

UserRevisionLine numberNew contents of line
tnhnrl 32:f2f8ae34aadc 1 #ifndef MBEDLOGGER_HPP
tnhnrl 32:f2f8ae34aadc 2 #define MBEDLOGGER_HPP
tnhnrl 32:f2f8ae34aadc 3
tnhnrl 32:f2f8ae34aadc 4 #include "mbed.h"
tnhnrl 32:f2f8ae34aadc 5 #include <string>
tnhnrl 32:f2f8ae34aadc 6 using namespace std;
tnhnrl 32:f2f8ae34aadc 7
tnhnrl 32:f2f8ae34aadc 8 #include "DirectoryList.h"
tnhnrl 32:f2f8ae34aadc 9
tnhnrl 32:f2f8ae34aadc 10 class MbedLogger {
tnhnrl 32:f2f8ae34aadc 11 public:
tnhnrl 32:f2f8ae34aadc 12 MbedLogger(); //constructor
tnhnrl 32:f2f8ae34aadc 13 void createTestLog(); //test log function
tnhnrl 32:f2f8ae34aadc 14
tnhnrl 32:f2f8ae34aadc 15 //one log file type for now
tnhnrl 32:f2f8ae34aadc 16 void createFile();
tnhnrl 32:f2f8ae34aadc 17
tnhnrl 32:f2f8ae34aadc 18 //save float array to file (append each time)
tnhnrl 32:f2f8ae34aadc 19 void saveArrayToFile(float *input);
tnhnrl 32:f2f8ae34aadc 20
tnhnrl 32:f2f8ae34aadc 21 //save the sequence title to file (append each time)
tnhnrl 32:f2f8ae34aadc 22 void saveSequenceStringToFile(string str_input);
tnhnrl 32:f2f8ae34aadc 23
tnhnrl 32:f2f8ae34aadc 24 //print the data to the serial terminal
tnhnrl 32:f2f8ae34aadc 25 void printFromLogFile();
tnhnrl 32:f2f8ae34aadc 26
tnhnrl 32:f2f8ae34aadc 27 //print the directory to the screen
tnhnrl 32:f2f8ae34aadc 28 void printMbedDirectory();
tnhnrl 32:f2f8ae34aadc 29
tnhnrl 32:f2f8ae34aadc 30 //close the current file stream [before creating a new one]
tnhnrl 32:f2f8ae34aadc 31 void closeFile();
tnhnrl 32:f2f8ae34aadc 32
tnhnrl 32:f2f8ae34aadc 33 private:
tnhnrl 32:f2f8ae34aadc 34 int _f; //file name number
tnhnrl 32:f2f8ae34aadc 35 char _file_name[128]; //file name placeholder
tnhnrl 32:f2f8ae34aadc 36 int _file_number;
tnhnrl 32:f2f8ae34aadc 37
tnhnrl 32:f2f8ae34aadc 38 FILE *_fp; //the file is a class member variable
tnhnrl 32:f2f8ae34aadc 39 };
tnhnrl 32:f2f8ae34aadc 40
tnhnrl 32:f2f8ae34aadc 41 #endif