ISLogFileFatFs.h
Go to the documentation of this file.
1 /*
2 MIT LICENSE
3 
4 Copyright 2014-2019 Inertial Sense, Inc. - http://inertialsense.com
5 
6 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions :
7 
8 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9 
10 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT, IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
11 */
12 
13 #ifndef IS_FAT_FS_LOG_FILE_H_
14 #define IS_FAT_FS_LOG_FILE_H_
15 
16 #include "ISLogFileBase.h"
17 #include "ff.h"
18 #include <cstdarg>
19 
21 {
22 public:
24  cISLogFileFatFs(const std::string& filePath, const char* mode);
25  cISLogFileFatFs(const char* filePath, const char* mode);
27 
28  bool open(const char* filePath, const char* mode) OVERRIDE;
29  bool close() OVERRIDE;
30  bool flush() OVERRIDE;
31  bool good() OVERRIDE;
32  bool isOpened() OVERRIDE;
33 
34  int putch(char ch) OVERRIDE;
35  int puts(const char* str) OVERRIDE;
36  std::size_t write(const void* bytes, std::size_t len) OVERRIDE;
37  int lprintf(const char* format, ...) OVERRIDE;
38  int vprintf(const char* format, va_list args) OVERRIDE;
39 
40  int getch() OVERRIDE;
41  std::size_t read(void* bytes, std::size_t len) OVERRIDE;
42 
43 private:
45  bool m_opened;
46  std::uint32_t m_lastSync;
47  CONST_EXPRESSION std::uint32_t SYNC_FREQ_MS = 1000; // sync every second
48 };
49 
50 
51 #endif //IS_FAT_FS_LOG_FILE_H_
bool good() OVERRIDE
bool open(const char *filePath, const char *mode) OVERRIDE
#define OVERRIDE
Definition: ISConstants.h:423
std::uint32_t m_lastSync
#define CONST_EXPRESSION
Definition: ISConstants.h:411
int putch(char ch) OVERRIDE
std::size_t read(void *bytes, std::size_t len) OVERRIDE
bool isOpened() OVERRIDE
std::size_t write(const void *bytes, std::size_t len) OVERRIDE
CONST_EXPRESSION std::uint32_t SYNC_FREQ_MS
int puts(const char *str) OVERRIDE
Definition: ff.h:114
bool flush() OVERRIDE
int vprintf(const char *format, va_list args) OVERRIDE
int lprintf(const char *format,...) OVERRIDE
bool close() OVERRIDE
int getch() OVERRIDE


inertial_sense_ros
Author(s):
autogenerated on Sun Feb 28 2021 03:17:57