16 #include <sys/types.h> 59 while ((c = (
char)m_pFile->getch()) >= 0)
61 if (c ==
'{' && pc !=
'\\')
65 else if (c ==
'}' && pc !=
'\\')
70 m_jsonString.append(1, c);
77 m_jsonString.append(1, c);
82 return (m_jsonString.size() != 0);
90 bool needsComma =
true;
96 if (!OpenNewSaveFile())
104 memcpy(&m_devInfo, dataBuf,
sizeof(
dev_info_t));
108 int nBytes = m_json.WriteDataToFile(m_pFile, *dataHdr, dataBuf, (needsComma ?
",\n" :
NULLPTR));
109 if (!m_pFile->good())
117 if (m_logSize >= m_maxFileSize)
133 if (!OpenNextReadFile())
151 while (!GetNextItemForFile() && OpenNextReadFile()) {}
152 if (m_json.StringJSONToData(m_jsonString, m_dataBuffer.hdr, m_dataBuffer.buf,
_ARRAY_BYTE_COUNT(m_dataBuffer.buf)))
156 memcpy(&m_devInfo, m_dataBuffer.buf,
sizeof(
dev_info_t));
158 return &m_dataBuffer;
166 m_devInfo.serialNumber = serialNumber;
void OnReadData(p_data_t *data)
virtual bool CloseAllFiles()
bool CloseAllFiles() OVERRIDE
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
p_data_t * ReadData() OVERRIDE
bool GetNextItemForFile()
#define _ARRAY_BYTE_COUNT(a)
USBInterfaceDescriptor data
p_data_t * ReadDataFromFile()
void SetSerialNumber(uint32_t serialNumber) OVERRIDE