16 #include <sys/types.h> 77 for (uint32_t
id = 0;
id <
DID_COUNT;
id++)
108 uint32_t
id = dataHdr->
id;
132 int snOffset = offsetof(
dev_info_t, serialNumber);
135 if (start <= snOffset && (
int)(snOffset +
sizeof(uint32_t)) <= end)
148 dataBytes = UINT_MAX;
152 dataBytes =
sizeof(int32_t) + dataHdr->
size;
189 if (dataBytes == UINT_MAX)
195 if (!currentChunk->
PushBack((
unsigned char*)&(
m_dataSerNum),
sizeof(int32_t), (
unsigned char*)dataBuf, dataHdr->
size))
227 for (uint32_t
id = 0;
id <
DID_COUNT;
id++)
253 uint32_t foundId = UINT_MAX;
254 uint32_t minSerialNum = UINT_MAX;
259 for (uint32_t
id = 0;
id <
DID_COUNT;
id++)
278 if (foundId == UINT_MAX)
287 #if 0 // Error check for gap data serial number. Verify we didn't drop any data. 323 perror(
"Data is larger than max data set size");
394 if (nBytes < hdrSize || chunk->m_hdr.grpNum != 1)
bool CloseAllFiles() OVERRIDE
p_data_t * SerializeDataFromChunks()
void OnReadData(p_data_t *data)
virtual bool CloseAllFiles()
cSortedDataChunk * m_chunks[DID_COUNT]
GeneratorWrapper< std::vector< T > > chunk(size_t size, GeneratorWrapper< T > &&generator)
int32_t WriteToFile(cISLogFileBase *pFile, int groupNumber=0)
bool PushBack(uint8_t *d1, uint32_t d1Size, uint8_t *d2=NULL, uint32_t d2Size=0)
virtual bool SaveData(p_data_hdr_t *dataHdr, const uint8_t *dataBuf)
void CloseISLogFile(cISLogFileBase *&logFile)
bool SaveData(p_data_hdr_t *dataHdr, const uint8_t *dataBuf) OVERRIDE
cSortedDataChunk m_readChunk
int32_t ReadFromFile(cISLogFileBase *pFile)
virtual void InitDeviceForWriting(int pHandle, string timestamp, string directory, uint64_t maxDiskSpace, uint32_t maxFileSize)
uint8_t buf[MAX_P_DATA_BODY_SIZE]
bool ReadChunkFromFile(cSortedDataChunk *chunk)
void InitDeviceForReading() OVERRIDE
USBInterfaceDescriptor data
virtual void InitDeviceForReading()
p_data_t * ReadData() OVERRIDE
void SetSerialNumber(uint32_t serialNumber) OVERRIDE
void InitDeviceForWriting(int pHandle, std::string timestamp, std::string directory, uint64_t maxDiskSpace, uint32_t maxFileSize) OVERRIDE
bool ReadAllChunksFromFile()
uint8_t buf[MAX_DATASET_SIZE]
bool PopFront(uint32_t size)
char copyDataPToStructP2(void *sptr, const p_data_hdr_t *dataHdr, const uint8_t *dataBuf, const unsigned int maxsize)