DeviceLogKML.h
Go to the documentation of this file.
1 /*
2 MIT LICENSE
3 
4 Copyright (c) 2014-2020 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 DEVICE_LOG_KML_H
14 #define DEVICE_LOG_KML_H
15 
16 #include <stdio.h>
17 #include <string>
18 #include <vector>
19 
20 #include "DataKML.h"
21 #include "DeviceLog.h"
22 #include "com_manager.h"
23 
24 #if PLATFORM_IS_EVB_2
25 #include "ff.h"
26 #endif
27 
28 
29 struct sKmlLog
30 {
31  std::vector<sKmlLogData> data;
32 
33  std::string fileName;
34  uint32_t fileCount;
35  uint32_t fileDataSize; // Byte size of chunk data. Excludes chunk header.
36  uint32_t fileSize;
37 };
38 
39 
40 
41 class cDeviceLogKML : public cDeviceLog
42 {
43 public:
44  void InitDeviceForWriting(int pHandle, std::string timestamp, std::string directory, uint64_t maxDiskSpace, uint32_t maxFileSize) OVERRIDE;
45  bool CloseAllFiles() OVERRIDE;
46  bool CloseWriteFile(int kid, sKmlLog& log);
47  bool OpenWithSystemApp(void) OVERRIDE;
48  bool SaveData(p_data_hdr_t* dataHdr, const uint8_t* dataBuf) OVERRIDE;
49  p_data_t* ReadData() OVERRIDE;
50  void SetSerialNumber(uint32_t serialNumber) OVERRIDE;
51  std::string LogFileExtention() OVERRIDE { return std::string(".kml"); }
52 
53 private:
54  bool OpenNewSaveFile(int kid, sKmlLog &log) { (void)kid; (void)log; return true; }
55  p_data_t* ReadDataFromChunk();
56  bool ReadChunkFromFile();
57  bool WriteDateToFile(const p_data_hdr_t *dataHdr, const uint8_t *dataBuf);
58 
61 };
62 
63 #endif // DEVICE_LOG_KML_H
uint32_t fileDataSize
Definition: DeviceLogKML.h:35
uint32_t fileSize
Definition: DeviceLogKML.h:36
#define OVERRIDE
Definition: ISConstants.h:423
cDataKML m_kml
Definition: DeviceLogKML.h:59
std::vector< sKmlLogData > data
Definition: DeviceLogKML.h:31
std::string fileName
Definition: DeviceLogKML.h:33
uint32_t fileCount
Definition: DeviceLogKML.h:34
bool OpenNewSaveFile(int kid, sKmlLog &log)
Definition: DeviceLogKML.h:54
std::string LogFileExtention() OVERRIDE
Definition: DeviceLogKML.h:51


inertial_sense_ros
Author(s):
autogenerated on Sat Sep 19 2020 03:19:04