Обновление

This commit is contained in:
cfif 2026-04-28 15:09:22 +03:00
parent 11ebc0346f
commit fed81a25a1
2 changed files with 16 additions and 6 deletions

View File

@ -651,7 +651,7 @@ int blf_close(BLFContext *ctx) {
/* Обновляем поля заголовка файла */ /* Обновляем поля заголовка файла */
ctx->header.fileSize = (uint64_t)endPos; ctx->header.fileSize = (uint64_t)endPos;
ctx->header.uncompressedFileSize = (uint64_t)endPos; ctx->header.uncompressedFileSize = (uint64_t)endPos;
ctx->header.objectCount = ctx->objectCount; ctx->header.objectCount = ctx->objectCount; // 9
/* Перезаписываем заголовок */ /* Перезаписываем заголовок */
if (blf_file_seek(ctx, ctx->headerPos) != 0) { if (blf_file_seek(ctx, ctx->headerPos) != 0) {

View File

@ -53,7 +53,7 @@ int main() {
.flags = CAN_MSG_FLAGS(CAN_DIR_RX, 0), .flags = CAN_MSG_FLAGS(CAN_DIR_RX, 0),
.dlc = 8, .dlc = 8,
.data = {0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8}, .data = {0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8},
.timestamp = 68000, .timestamp = 0,
// frameLength и bitCount не используются в старом формате // frameLength и bitCount не используются в старом формате
//.frameLength = 216000, // 216 мкс = 108 бит * 2000 нс //.frameLength = 216000, // 216 мкс = 108 бит * 2000 нс
//.bitCount = 108 // классическое значение для 8 байт данных //.bitCount = 108 // классическое значение для 8 байт данных
@ -62,10 +62,10 @@ int main() {
int j = 0; int j = 0;
int k = 0; int k = 0;
for (uint32_t i = 0; i < 10000; ++i) { for (uint32_t i = 1; i < 10; ++i) {
// Заполняем данные // Заполняем данные
/*
canMsg.data[0] = j; canMsg.data[0] = j;
canMsg.data[1] = j / 2; canMsg.data[1] = j / 2;
canMsg.data[2] = j / 3; canMsg.data[2] = j / 3;
@ -74,13 +74,22 @@ int main() {
canMsg.data[5] = j / 6; canMsg.data[5] = j / 6;
canMsg.data[6] = j / 7; canMsg.data[6] = j / 7;
canMsg.data[7] = j / 8; canMsg.data[7] = j / 8;
*/
canMsg.timestamp += 1; canMsg.data[0] = i;
canMsg.data[1] = i;
canMsg.data[2] = i;
canMsg.data[3] = i;
canMsg.data[4] = i;
canMsg.data[5] = i;
canMsg.data[6] = i;
canMsg.data[7] = i;
if (blf_add_can_message_struct(&ctx, &canMsg) != 0) { if (blf_add_can_message_struct(&ctx, &canMsg) != 0) {
return 1; return 1;
} }
canMsg.timestamp += 1100;
++k; ++k;
if (k > 100) { if (k > 100) {
@ -93,6 +102,7 @@ int main() {
} }
// Завершаем контейнер // Завершаем контейнер
if (blf_end_container(&ctx) != 0) { if (blf_end_container(&ctx) != 0) {
BLF_ERROR_PRINTF("Failed to end container\n"); BLF_ERROR_PRINTF("Failed to end container\n");