DeviceLogSerial.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_SERIAL_H
14 #define DEVICE_LOG_SERIAL_H
15 
16 #include <stdio.h>
17 #include <string>
18 #include <vector>
19 
20 #include "DataChunk.h"
21 #include "DeviceLog.h"
22 #include "com_manager.h"
23 
24 
25 
26 
28 {
29 public:
31 
32  void InitDeviceForWriting(int pHandle, std::string timestamp, std::string directory, uint64_t maxDiskSpace, uint32_t maxFilesize) OVERRIDE;
33  bool CloseAllFiles() OVERRIDE;
34  bool SaveData(p_data_hdr_t* dataHdr, const uint8_t* dataBuf) OVERRIDE;
36  void SetSerialNumber(uint32_t serialNumber) OVERRIDE;
37  std::string LogFileExtention() OVERRIDE { return std::string(".dat"); }
38  void Flush() OVERRIDE;
39 
41 
42 private:
44  bool ReadChunkFromFile();
45  bool WriteChunkToFile();
46 };
47 
48 #endif // DEVICE_LOG_SERIAL_H
p_data_t * ReadDataFromChunk()
void InitDeviceForWriting(int pHandle, std::string timestamp, std::string directory, uint64_t maxDiskSpace, uint32_t maxFilesize) OVERRIDE
std::string LogFileExtention() OVERRIDE
#define OVERRIDE
Definition: ISConstants.h:423
cDataChunk m_chunk
bool CloseAllFiles() OVERRIDE
void Flush() OVERRIDE
void SetSerialNumber(uint32_t serialNumber) OVERRIDE
p_data_t * ReadData() OVERRIDE
bool SaveData(p_data_hdr_t *dataHdr, const uint8_t *dataBuf) OVERRIDE


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