Created
March 25, 2025 08:31
-
-
Save tuna-f1sh/5e6398bf63a275dd36b7144eab5a1718 to your computer and use it in GitHub Desktop.
mdflib buildroot package
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| config BR2_PACKAGE_MDFLIB | |
| bool "mdflib" | |
| select BR2_PACKAGE_ZLIB | |
| select BR2_PACKAGE_EXPAT | |
| help | |
| Implementation of the ASAM MDF data file. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/mdflib/CMakeLists.txt b/mdflib/CMakeLists.txt | |
| index 462fc7e..e54a380 100644 | |
| --- a/mdflib/CMakeLists.txt | |
| +++ b/mdflib/CMakeLists.txt | |
| @@ -154,6 +154,7 @@ endif() | |
| set(MDF_PUBLIC_HEADERS | |
| ../include/mdf/cryptoutil.h | |
| + ../include/mdf/canmessage.h | |
| ../include/mdf/etag.h | |
| ../include/mdf/iattachment.h | |
| ../include/mdf/iblock.h | |
| @@ -170,6 +171,8 @@ set(MDF_PUBLIC_HEADERS | |
| ../include/mdf/imetadata.h | |
| ../include/mdf/isampleobserver.h | |
| ../include/mdf/isourceinformation.h | |
| + ../include/mdf/itimestamp.h | |
| + ../include/mdf/imdftimestamp.h | |
| ../include/mdf/mdffactory.h | |
| ../include/mdf/mdffile.h | |
| ../include/mdf/mdfhelper.h |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ################################################################################ | |
| # mdflib package | |
| ################################################################################ | |
| MDFLIB_VERSION = v2.3.0 | |
| MDFLIB_SITE = https://github.com/ihedvall/mdflib.git | |
| MDFLIB_SITE_METHOD = git | |
| MDFLIB_SITE_REVISION = v2.3.0 | |
| MDFLIB_INSTALL_STAGING = YES | |
| MDFLIB_LICENSE = GPL-3.0-or-later | |
| MDFLIB_LICENSE_FILES = LICENSE | |
| MDFLIB_DEPENDENCIES = zlib expat | |
| MDFLIB_CONF_OPTS += \ | |
| -DCMAKE_CXX_FLAGS="-std=c++17 -include cstdint" \ | |
| -DZLIB_INCLUDE_DIR=$(HOST_DIR)/include \ | |
| -DZLIB_LIBRARY=$(STAGING_DIR)/usr/lib/libz.so \ | |
| -DEXPAT_INCLUDE_DIR=$(HOST_DIR)/include \ | |
| -DEXPAT_LIBRARY=$(STAGING_DIR)/usr/lib/libexpat.so | |
| MDFLIB_CONF_OPTS += \ | |
| -DBUILD_SHARED_LIBS=OFF \ | |
| -DMDF_BUILD_SHARED_LIB=OFF | |
| # The standard CMake Buildroot infrastructure: | |
| $(eval $(cmake-package)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/mdflib/src/mdfwriter.cpp b/mdflib/src/mdfwriter.cpp | |
| index e192518..fb8af4f 100644 | |
| --- a/mdflib/src/mdfwriter.cpp | |
| +++ b/mdflib/src/mdfwriter.cpp | |
| @@ -431,6 +431,9 @@ void MdfWriter::CreateCanConfig(IDataGroup& dg_block) const { | |
| if (cg_data_frame != nullptr) { | |
| cg_data_frame->PathSeparator('.'); | |
| cg_data_frame->Flags(CgFlag::PlainBusEvent | CgFlag::BusEvent); | |
| + auto* source_info = cg_data_frame->CreateSourceInformation(); | |
| + source_info->Type(SourceType::Bus); | |
| + source_info->Bus(BusType::Can); | |
| CreateTimeChannel(*cg_data_frame,"t"); | |
| CreateCanDataFrameChannel(*cg_data_frame); | |
| cn_data_byte = cg_data_frame->GetChannel("CAN_DataFrame.DataBytes"); | |
| @@ -450,6 +453,9 @@ void MdfWriter::CreateCanConfig(IDataGroup& dg_block) const { | |
| if (cg_remote_frame != nullptr) { | |
| cg_remote_frame->PathSeparator('.'); | |
| cg_remote_frame->Flags(CgFlag::PlainBusEvent | CgFlag::BusEvent); | |
| + auto* source_info = cg_remote_frame->CreateSourceInformation(); | |
| + source_info->Type(SourceType::Bus); | |
| + source_info->Bus(BusType::Can); | |
| CreateTimeChannel(*cg_remote_frame,"t"); | |
| CreateCanRemoteFrameChannel(*cg_remote_frame); | |
| } | |
| @@ -459,6 +465,9 @@ void MdfWriter::CreateCanConfig(IDataGroup& dg_block) const { | |
| if (cg_error_frame != nullptr) { | |
| cg_error_frame->PathSeparator('.'); | |
| cg_error_frame->Flags(CgFlag::PlainBusEvent | CgFlag::BusEvent); | |
| + auto* source_info = cg_error_frame->CreateSourceInformation(); | |
| + source_info->Type(SourceType::Bus); | |
| + source_info->Bus(BusType::Can); | |
| CreateTimeChannel(*cg_error_frame,"t"); | |
| CreateCanErrorFrameChannel(*cg_error_frame); | |
| cn_error_byte = cg_error_frame->GetChannel("CAN_ErrorFrame.DataBytes"); | |
| @@ -477,6 +486,9 @@ void MdfWriter::CreateCanConfig(IDataGroup& dg_block) const { | |
| if (cg_overload_frame != nullptr) { | |
| cg_overload_frame->PathSeparator('.'); | |
| cg_overload_frame->Flags(CgFlag::PlainBusEvent | CgFlag::BusEvent); | |
| + auto* source_info = cg_overload_frame->CreateSourceInformation(); | |
| + source_info->Type(SourceType::Bus); | |
| + source_info->Bus(BusType::Can); | |
| CreateTimeChannel(*cg_overload_frame,"t"); | |
| CreateCanOverloadFrameChannel(*cg_overload_frame); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment