25 BufferLogger& bufferLogger
27 m_bufferLogger(bufferLogger),
51 const char *
const logFilePrefix,
52 const char *
const logFileSuffix,
60 this->m_prefix = logFilePrefix;
61 this->m_suffix = logFileSuffix;
62 this->m_maxSize = maxFileSize;
63 this->m_sizeOfSize = sizeOfSize;
66 FW_ASSERT(m_maxSize > sizeOfSize, static_cast<FwAssertArgType>(m_maxSize));
69 void BufferLogger::File ::
75 this->closeAndEmitEvent();
77 this->m_baseName = baseName;
78 this->m_fileCounter = 0;
82 void BufferLogger::File ::
91 this->m_bytesWritten + this->m_sizeOfSize + size;
92 if (projectedByteCount > this->m_maxSize) {
93 this->closeAndEmitEvent();
102 (void) this->writeBuffer(data, size);
106 void BufferLogger::File ::
112 this->m_bufferLogger.log_DIAGNOSTIC_BL_LogFileClosed(logStringArg);
120 void BufferLogger::File ::
126 if ((this->m_baseName.toChar()[0] ==
'\0') ||
128 (this->m_maxSize <= this->m_sizeOfSize)) {
129 this->m_bufferLogger.log_WARNING_HI_BL_NoLogFileOpenInitError();
133 if (this->m_fileCounter == 0) {
136 this->m_prefix.toChar(),
137 this->m_baseName.toChar(),
138 this->m_suffix.toChar()
144 this->m_prefix.toChar(),
145 this->m_baseName.toChar(),
147 this->m_suffix.toChar()
152 this->m_name.toChar(),
156 this->m_fileCounter++;
158 this->m_bytesWritten = 0;
164 this->m_bufferLogger.log_WARNING_HI_BL_LogFileOpenError(status,
string);
168 bool BufferLogger::File ::
170 const U8 *
const data,
174 bool status = this->writeSize(size);
176 status = this->writeBytes(data, size);
181 bool BufferLogger::File ::
187 for (
U8 i = 0; i < this->m_sizeOfSize; ++i) {
188 sizeBuffer[this->m_sizeOfSize - i - 1] = sizeRegister & 0xFF;
191 const bool status = this->writeBytes(
198 bool BufferLogger::File ::
200 const void *
const data,
205 const Os::File::Status fileStatus = this->m_osFile.write(reinterpret_cast<const U8*>(data), size);
207 if (fileStatus ==
Os::File::OP_OK && static_cast<FwSizeType>(size) == length) {
208 this->m_bytesWritten += length;
214 this->m_bufferLogger.log_WARNING_HI_BL_LogFileWriteError(fileStatus, static_cast<U32>(size), static_cast<U32>(length),
string);
220 void BufferLogger::File ::
227 const Fw::StringBase &hashFileName = validatedFile.getHashFileName();
229 this->m_bufferLogger.log_WARNING_HI_BL_LogFileValidationError(
236 bool BufferLogger::File ::
257 void BufferLogger::File ::
262 this->m_osFile.close();
264 this->writeHashFile();
PlatformSizeType FwSizeType
The validation of the file passed.
Os::ValidateFile::Status createHashFile()
void init()
Initialize the OS Abstraction Layer (OSAL)
uint8_t U8
8-bit unsigned integer
Operation was successful.
Defines a file class to validate files or generate a file validator file.
RateGroupDivider component implementation.
virtual const CHAR * toChar() const =0