From 38b9cc8db6c0278cbf1ea895a3cd03b505c4a35b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20B=C3=B6rschig?= Date: Wed, 14 Jan 2026 16:54:13 +0100 Subject: [PATCH 1/4] flexray: add second keyslot to config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marius Börschig --- SilKit/include/silkit/capi/Flexray.h | 12 ++-- .../silkit/capi/InterfaceIdentifiers.h | 2 +- .../detail/impl/HourglassConversions.hpp | 4 ++ .../services/flexray/FlexrayController.hpp | 2 + .../services/flexray/FlexrayDatatypes.hpp | 17 +++--- SilKit/source/capi/CapiFlexray.cpp | 57 +++++++++++-------- .../source/services/flexray/FlexraySerdes.cpp | 7 ++- 7 files changed, 62 insertions(+), 39 deletions(-) diff --git a/SilKit/include/silkit/capi/Flexray.h b/SilKit/include/silkit/capi/Flexray.h index 038cf5c27..48f84daa5 100644 --- a/SilKit/include/silkit/capi/Flexray.h +++ b/SilKit/include/silkit/capi/Flexray.h @@ -216,12 +216,6 @@ struct SilKit_FlexrayNodeParameters //! Maximum permissible rate correction value (range 3-3846 MicroTicks). SilKit_FlexrayMicroTick pRateCorrectionOut; - ////! Not used by network simulator - // pSecondKeySlotID - - ////! Not used by network simulator - // pTwoKeySlotMode - //! Channel used by the node to send a wakeup pattern (values FlexrayChannel::A, FlexrayChannel::B). SilKit_FlexrayChannel pWakeupChannel; @@ -242,6 +236,12 @@ struct SilKit_FlexrayNodeParameters //! Number of samples per MicroTick (values 1 or 2). uint8_t pSamplesPerMicrotick; + + //! Second Key Slot ID of the key slot (range 0-1023, value 0 means that there is no key slot). + uint16_t pSecondKeySlotID; + + //! Second Key slot is used for startup with a single cold start node (range 0, 1). + uint8_t pTwoKeySlotMode; }; typedef struct SilKit_FlexrayNodeParameters SilKit_FlexrayNodeParameters; diff --git a/SilKit/include/silkit/capi/InterfaceIdentifiers.h b/SilKit/include/silkit/capi/InterfaceIdentifiers.h index 609b2870a..7490bd666 100644 --- a/SilKit/include/silkit/capi/InterfaceIdentifiers.h +++ b/SilKit/include/silkit/capi/InterfaceIdentifiers.h @@ -137,7 +137,7 @@ typedef struct #define SilKit_FlexrayWakeupEvent_VERSION 1 #define SilKit_FlexrayControllerConfig_VERSION 1 #define SilKit_FlexrayClusterParameters_VERSION 1 -#define SilKit_FlexrayNodeParameters_VERSION 1 +#define SilKit_FlexrayNodeParameters_VERSION 2 #define SilKit_FlexrayHostCommand_VERSION 1 #define SilKit_FlexrayHeader_VERSION 1 #define SilKit_FlexrayFrame_VERSION 1 diff --git a/SilKit/include/silkit/detail/impl/HourglassConversions.hpp b/SilKit/include/silkit/detail/impl/HourglassConversions.hpp index b242e4225..980dde1a6 100644 --- a/SilKit/include/silkit/detail/impl/HourglassConversions.hpp +++ b/SilKit/include/silkit/detail/impl/HourglassConversions.hpp @@ -221,6 +221,8 @@ inline void assignCxxToC(const SilKit::Services::Flexray::FlexrayNodeParameters& cOut.pWakeupPattern = cxxIn.pWakeupPattern; cOut.pdMicrotick = static_cast(cxxIn.pdMicrotick); cOut.pSamplesPerMicrotick = cxxIn.pSamplesPerMicrotick; + cOut.pTwoKeySlotMode = cxxIn.pTwoKeySlotMode; + cOut.pSecondKeySlotID = cxxIn.pSecondKeySlotID; } inline void assignCxxToC(const SilKit::Services::Flexray::FlexrayTxBufferConfig& cxxIn, @@ -651,6 +653,8 @@ inline void assignCToCxx(const SilKit_FlexrayNodeParameters* cIn, cxxOut.pWakeupPattern = cIn->pWakeupPattern; cxxOut.pdMicrotick = (SilKit::Services::Flexray::FlexrayClockPeriod)cIn->pdMicrotick; cxxOut.pSamplesPerMicrotick = cIn->pSamplesPerMicrotick; + cxxOut.pTwoKeySlotMode = cIn->pTwoKeySlotMode; + cxxOut.pSecondKeySlotID = cIn->pSecondKeySlotID; } // ----------------------------------- diff --git a/SilKit/include/silkit/detail/impl/services/flexray/FlexrayController.hpp b/SilKit/include/silkit/detail/impl/services/flexray/FlexrayController.hpp index 06150cd29..89a73ad9c 100644 --- a/SilKit/include/silkit/detail/impl/services/flexray/FlexrayController.hpp +++ b/SilKit/include/silkit/detail/impl/services/flexray/FlexrayController.hpp @@ -567,6 +567,8 @@ void CxxToC(const SilKit::Services::Flexray::FlexrayNodeParameters& cxxFlexrayNo cFlexrayNodeParameters.pWakeupPattern = cxxFlexrayNodeParameters.pWakeupPattern; cFlexrayNodeParameters.pdMicrotick = static_cast(cxxFlexrayNodeParameters.pdMicrotick); cFlexrayNodeParameters.pSamplesPerMicrotick = cxxFlexrayNodeParameters.pSamplesPerMicrotick; + cFlexrayNodeParameters.pTwoKeySlotMode = cxxFlexrayNodeParameters.pTwoKeySlotMode; + cFlexrayNodeParameters.pSecondKeySlotID = cxxFlexrayNodeParameters.pSecondKeySlotID; } void CxxToC(const SilKit::Services::Flexray::FlexrayTxBufferConfig& cxxFlexrayTxBufferConfig, diff --git a/SilKit/include/silkit/services/flexray/FlexrayDatatypes.hpp b/SilKit/include/silkit/services/flexray/FlexrayDatatypes.hpp index 62846f3ca..fded32d21 100644 --- a/SilKit/include/silkit/services/flexray/FlexrayDatatypes.hpp +++ b/SilKit/include/silkit/services/flexray/FlexrayDatatypes.hpp @@ -211,13 +211,6 @@ struct FlexrayNodeParameters //! Maximum permissible rate correction value (range 3-3846 MicroTicks). FlexrayMicroTick pRateCorrectionOut; - - ////! Not used by network simulator - //pSecondKeySlotID - - ////! Not used by network simulator - //pTwoKeySlotMode - //! Channel used by the node to send a wakeup pattern (values FlexrayChannel::A, FlexrayChannel::B). FlexrayChannel pWakeupChannel; @@ -238,6 +231,12 @@ struct FlexrayNodeParameters //! Number of samples per MicroTick (values 1 or 2). uint8_t pSamplesPerMicrotick; + + //! Second Key Slot ID of the key slot (range 0-1023, value 0 means that there is no key slot). + uint16_t pSecondKeySlotID; + + //! Second Key slot is used for startup with a single cold start node (range 0, 1). + uint8_t pTwoKeySlotMode; }; //! Transmission mode for FlexRay Tx-Buffer @@ -537,7 +536,9 @@ inline bool operator==(const FlexrayNodeParameters& lhs, const FlexrayNodeParame && lhs.pOffsetCorrectionStart == rhs.pOffsetCorrectionStart && lhs.pRateCorrectionOut == rhs.pRateCorrectionOut && lhs.pWakeupChannel == rhs.pWakeupChannel && lhs.pWakeupPattern == rhs.pWakeupPattern && lhs.pdMicrotick == rhs.pdMicrotick - && lhs.pSamplesPerMicrotick == rhs.pSamplesPerMicrotick; + && lhs.pSamplesPerMicrotick == rhs.pSamplesPerMicrotick && lhs.pSecondKeySlotID == rhs.pSecondKeySlotID + && lhs.pTwoKeySlotMode == rhs.pTwoKeySlotMode + ; } inline bool operator==(const FlexrayTxBufferConfig& lhs, const FlexrayTxBufferConfig& rhs) diff --git a/SilKit/source/capi/CapiFlexray.cpp b/SilKit/source/capi/CapiFlexray.cpp index 568f34df8..d6b5dd328 100644 --- a/SilKit/source/capi/CapiFlexray.cpp +++ b/SilKit/source/capi/CapiFlexray.cpp @@ -54,29 +54,40 @@ void assign(SilKit::Services::Flexray::FlexrayClusterParameters& cppClusterParam void assign(SilKit::Services::Flexray::FlexrayNodeParameters& cppNodeParameters, const SilKit_FlexrayNodeParameters* nodeParameters) { - cppNodeParameters.pAllowHaltDueToClock = nodeParameters->pAllowHaltDueToClock; - cppNodeParameters.pAllowPassiveToActive = nodeParameters->pAllowPassiveToActive; - cppNodeParameters.pChannels = (SilKit::Services::Flexray::FlexrayChannel)nodeParameters->pChannels; - cppNodeParameters.pClusterDriftDamping = nodeParameters->pClusterDriftDamping; - cppNodeParameters.pdAcceptedStartupRange = nodeParameters->pdAcceptedStartupRange; - cppNodeParameters.pdListenTimeout = nodeParameters->pdListenTimeout; - cppNodeParameters.pKeySlotId = nodeParameters->pKeySlotId; - cppNodeParameters.pKeySlotOnlyEnabled = nodeParameters->pKeySlotOnlyEnabled; - cppNodeParameters.pKeySlotUsedForStartup = nodeParameters->pKeySlotUsedForStartup; - cppNodeParameters.pKeySlotUsedForSync = nodeParameters->pKeySlotUsedForSync; - cppNodeParameters.pLatestTx = nodeParameters->pLatestTx; - cppNodeParameters.pMacroInitialOffsetA = nodeParameters->pMacroInitialOffsetA; - cppNodeParameters.pMacroInitialOffsetB = nodeParameters->pMacroInitialOffsetB; - cppNodeParameters.pMicroInitialOffsetA = nodeParameters->pMicroInitialOffsetA; - cppNodeParameters.pMicroInitialOffsetB = nodeParameters->pMicroInitialOffsetB; - cppNodeParameters.pMicroPerCycle = nodeParameters->pMicroPerCycle; - cppNodeParameters.pOffsetCorrectionOut = nodeParameters->pOffsetCorrectionOut; - cppNodeParameters.pOffsetCorrectionStart = nodeParameters->pOffsetCorrectionStart; - cppNodeParameters.pRateCorrectionOut = nodeParameters->pRateCorrectionOut; - cppNodeParameters.pWakeupChannel = (SilKit::Services::Flexray::FlexrayChannel)nodeParameters->pWakeupChannel; - cppNodeParameters.pWakeupPattern = nodeParameters->pWakeupPattern; - cppNodeParameters.pdMicrotick = (SilKit::Services::Flexray::FlexrayClockPeriod)nodeParameters->pdMicrotick; - cppNodeParameters.pSamplesPerMicrotick = nodeParameters->pSamplesPerMicrotick; + const auto inputVersion = SK_ID_GET_VERSION(SilKit_Struct_GetId(*nodeParameters)); + + if (inputVersion == 1 || inputVersion == 2) + { + cppNodeParameters.pAllowHaltDueToClock = nodeParameters->pAllowHaltDueToClock; + cppNodeParameters.pAllowPassiveToActive = nodeParameters->pAllowPassiveToActive; + cppNodeParameters.pChannels = (SilKit::Services::Flexray::FlexrayChannel)nodeParameters->pChannels; + cppNodeParameters.pClusterDriftDamping = nodeParameters->pClusterDriftDamping; + cppNodeParameters.pdAcceptedStartupRange = nodeParameters->pdAcceptedStartupRange; + cppNodeParameters.pdListenTimeout = nodeParameters->pdListenTimeout; + cppNodeParameters.pKeySlotId = nodeParameters->pKeySlotId; + cppNodeParameters.pKeySlotOnlyEnabled = nodeParameters->pKeySlotOnlyEnabled; + cppNodeParameters.pKeySlotUsedForStartup = nodeParameters->pKeySlotUsedForStartup; + cppNodeParameters.pKeySlotUsedForSync = nodeParameters->pKeySlotUsedForSync; + cppNodeParameters.pLatestTx = nodeParameters->pLatestTx; + cppNodeParameters.pMacroInitialOffsetA = nodeParameters->pMacroInitialOffsetA; + cppNodeParameters.pMacroInitialOffsetB = nodeParameters->pMacroInitialOffsetB; + cppNodeParameters.pMicroInitialOffsetA = nodeParameters->pMicroInitialOffsetA; + cppNodeParameters.pMicroInitialOffsetB = nodeParameters->pMicroInitialOffsetB; + cppNodeParameters.pMicroPerCycle = nodeParameters->pMicroPerCycle; + cppNodeParameters.pOffsetCorrectionOut = nodeParameters->pOffsetCorrectionOut; + cppNodeParameters.pOffsetCorrectionStart = nodeParameters->pOffsetCorrectionStart; + cppNodeParameters.pRateCorrectionOut = nodeParameters->pRateCorrectionOut; + cppNodeParameters.pWakeupChannel = (SilKit::Services::Flexray::FlexrayChannel)nodeParameters->pWakeupChannel; + cppNodeParameters.pWakeupPattern = nodeParameters->pWakeupPattern; + cppNodeParameters.pdMicrotick = (SilKit::Services::Flexray::FlexrayClockPeriod)nodeParameters->pdMicrotick; + cppNodeParameters.pSamplesPerMicrotick = nodeParameters->pSamplesPerMicrotick; + } + + if ( inputVersion == 2) + { + cppNodeParameters.pTwoKeySlotMode = nodeParameters->pTwoKeySlotMode; + cppNodeParameters.pSecondKeySlotID = nodeParameters->pSecondKeySlotID; + } } void assign(SilKit::Services::Flexray::FlexrayControllerConfig& cppConfig, const SilKit_FlexrayControllerConfig* config) diff --git a/SilKit/source/services/flexray/FlexraySerdes.cpp b/SilKit/source/services/flexray/FlexraySerdes.cpp index 5456eabdb..e33ae069c 100644 --- a/SilKit/source/services/flexray/FlexraySerdes.cpp +++ b/SilKit/source/services/flexray/FlexraySerdes.cpp @@ -149,7 +149,8 @@ inline SilKit::Core::MessageBuffer& operator<<(SilKit::Core::MessageBuffer& buff << nodeParams.pMacroInitialOffsetB << nodeParams.pMicroInitialOffsetA << nodeParams.pMicroInitialOffsetB << nodeParams.pMicroPerCycle << nodeParams.pOffsetCorrectionOut << nodeParams.pOffsetCorrectionStart << nodeParams.pRateCorrectionOut << nodeParams.pWakeupChannel << nodeParams.pWakeupPattern - << nodeParams.pdMicrotick << nodeParams.pSamplesPerMicrotick; + << nodeParams.pdMicrotick << nodeParams.pSamplesPerMicrotick << nodeParams.pSecondKeySlotID + << nodeParams.pTwoKeySlotMode; return buffer; } @@ -163,6 +164,10 @@ inline SilKit::Core::MessageBuffer& operator>>(SilKit::Core::MessageBuffer& buff >> nodeParams.pMicroPerCycle >> nodeParams.pOffsetCorrectionOut >> nodeParams.pOffsetCorrectionStart >> nodeParams.pRateCorrectionOut >> nodeParams.pWakeupChannel >> nodeParams.pWakeupPattern >> nodeParams.pdMicrotick >> nodeParams.pSamplesPerMicrotick; + if (buffer.RemainingBytesLeft() > 0) + { + buffer >> nodeParams.pSecondKeySlotID >> nodeParams.pTwoKeySlotMode; + } return buffer; } From 8794b8115fe0a5bec076b7489610d2da8fecee28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20B=C3=B6rschig?= Date: Thu, 15 Jan 2026 10:53:50 +0100 Subject: [PATCH 2/4] fixup! flexray: add second keyslot to config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit camel case Signed-off-by: Marius Börschig --- SilKit/include/silkit/capi/Flexray.h | 2 +- SilKit/include/silkit/detail/impl/HourglassConversions.hpp | 4 ++-- .../silkit/detail/impl/services/flexray/FlexrayController.hpp | 2 +- SilKit/include/silkit/services/flexray/FlexrayDatatypes.hpp | 4 ++-- SilKit/source/capi/CapiFlexray.cpp | 2 +- SilKit/source/services/flexray/FlexraySerdes.cpp | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/SilKit/include/silkit/capi/Flexray.h b/SilKit/include/silkit/capi/Flexray.h index 48f84daa5..3de090be9 100644 --- a/SilKit/include/silkit/capi/Flexray.h +++ b/SilKit/include/silkit/capi/Flexray.h @@ -238,7 +238,7 @@ struct SilKit_FlexrayNodeParameters uint8_t pSamplesPerMicrotick; //! Second Key Slot ID of the key slot (range 0-1023, value 0 means that there is no key slot). - uint16_t pSecondKeySlotID; + uint16_t pSecondKeySlotId; //! Second Key slot is used for startup with a single cold start node (range 0, 1). uint8_t pTwoKeySlotMode; diff --git a/SilKit/include/silkit/detail/impl/HourglassConversions.hpp b/SilKit/include/silkit/detail/impl/HourglassConversions.hpp index 980dde1a6..a323d02e7 100644 --- a/SilKit/include/silkit/detail/impl/HourglassConversions.hpp +++ b/SilKit/include/silkit/detail/impl/HourglassConversions.hpp @@ -222,7 +222,7 @@ inline void assignCxxToC(const SilKit::Services::Flexray::FlexrayNodeParameters& cOut.pdMicrotick = static_cast(cxxIn.pdMicrotick); cOut.pSamplesPerMicrotick = cxxIn.pSamplesPerMicrotick; cOut.pTwoKeySlotMode = cxxIn.pTwoKeySlotMode; - cOut.pSecondKeySlotID = cxxIn.pSecondKeySlotID; + cOut.pSecondKeySlotId = cxxIn.pSecondKeySlotId; } inline void assignCxxToC(const SilKit::Services::Flexray::FlexrayTxBufferConfig& cxxIn, @@ -654,7 +654,7 @@ inline void assignCToCxx(const SilKit_FlexrayNodeParameters* cIn, cxxOut.pdMicrotick = (SilKit::Services::Flexray::FlexrayClockPeriod)cIn->pdMicrotick; cxxOut.pSamplesPerMicrotick = cIn->pSamplesPerMicrotick; cxxOut.pTwoKeySlotMode = cIn->pTwoKeySlotMode; - cxxOut.pSecondKeySlotID = cIn->pSecondKeySlotID; + cxxOut.pSecondKeySlotId = cIn->pSecondKeySlotId; } // ----------------------------------- diff --git a/SilKit/include/silkit/detail/impl/services/flexray/FlexrayController.hpp b/SilKit/include/silkit/detail/impl/services/flexray/FlexrayController.hpp index 89a73ad9c..6234b21fa 100644 --- a/SilKit/include/silkit/detail/impl/services/flexray/FlexrayController.hpp +++ b/SilKit/include/silkit/detail/impl/services/flexray/FlexrayController.hpp @@ -568,7 +568,7 @@ void CxxToC(const SilKit::Services::Flexray::FlexrayNodeParameters& cxxFlexrayNo cFlexrayNodeParameters.pdMicrotick = static_cast(cxxFlexrayNodeParameters.pdMicrotick); cFlexrayNodeParameters.pSamplesPerMicrotick = cxxFlexrayNodeParameters.pSamplesPerMicrotick; cFlexrayNodeParameters.pTwoKeySlotMode = cxxFlexrayNodeParameters.pTwoKeySlotMode; - cFlexrayNodeParameters.pSecondKeySlotID = cxxFlexrayNodeParameters.pSecondKeySlotID; + cFlexrayNodeParameters.pSecondKeySlotId = cxxFlexrayNodeParameters.pSecondKeySlotId; } void CxxToC(const SilKit::Services::Flexray::FlexrayTxBufferConfig& cxxFlexrayTxBufferConfig, diff --git a/SilKit/include/silkit/services/flexray/FlexrayDatatypes.hpp b/SilKit/include/silkit/services/flexray/FlexrayDatatypes.hpp index fded32d21..622d7d280 100644 --- a/SilKit/include/silkit/services/flexray/FlexrayDatatypes.hpp +++ b/SilKit/include/silkit/services/flexray/FlexrayDatatypes.hpp @@ -233,7 +233,7 @@ struct FlexrayNodeParameters uint8_t pSamplesPerMicrotick; //! Second Key Slot ID of the key slot (range 0-1023, value 0 means that there is no key slot). - uint16_t pSecondKeySlotID; + uint16_t pSecondKeySlotId; //! Second Key slot is used for startup with a single cold start node (range 0, 1). uint8_t pTwoKeySlotMode; @@ -536,7 +536,7 @@ inline bool operator==(const FlexrayNodeParameters& lhs, const FlexrayNodeParame && lhs.pOffsetCorrectionStart == rhs.pOffsetCorrectionStart && lhs.pRateCorrectionOut == rhs.pRateCorrectionOut && lhs.pWakeupChannel == rhs.pWakeupChannel && lhs.pWakeupPattern == rhs.pWakeupPattern && lhs.pdMicrotick == rhs.pdMicrotick - && lhs.pSamplesPerMicrotick == rhs.pSamplesPerMicrotick && lhs.pSecondKeySlotID == rhs.pSecondKeySlotID + && lhs.pSamplesPerMicrotick == rhs.pSamplesPerMicrotick && lhs.pSecondKeySlotId == rhs.pSecondKeySlotId && lhs.pTwoKeySlotMode == rhs.pTwoKeySlotMode ; } diff --git a/SilKit/source/capi/CapiFlexray.cpp b/SilKit/source/capi/CapiFlexray.cpp index d6b5dd328..16e3f425a 100644 --- a/SilKit/source/capi/CapiFlexray.cpp +++ b/SilKit/source/capi/CapiFlexray.cpp @@ -86,7 +86,7 @@ void assign(SilKit::Services::Flexray::FlexrayNodeParameters& cppNodeParameters, if ( inputVersion == 2) { cppNodeParameters.pTwoKeySlotMode = nodeParameters->pTwoKeySlotMode; - cppNodeParameters.pSecondKeySlotID = nodeParameters->pSecondKeySlotID; + cppNodeParameters.pSecondKeySlotId = nodeParameters->pSecondKeySlotId; } } diff --git a/SilKit/source/services/flexray/FlexraySerdes.cpp b/SilKit/source/services/flexray/FlexraySerdes.cpp index e33ae069c..f7a4ea15f 100644 --- a/SilKit/source/services/flexray/FlexraySerdes.cpp +++ b/SilKit/source/services/flexray/FlexraySerdes.cpp @@ -149,7 +149,7 @@ inline SilKit::Core::MessageBuffer& operator<<(SilKit::Core::MessageBuffer& buff << nodeParams.pMacroInitialOffsetB << nodeParams.pMicroInitialOffsetA << nodeParams.pMicroInitialOffsetB << nodeParams.pMicroPerCycle << nodeParams.pOffsetCorrectionOut << nodeParams.pOffsetCorrectionStart << nodeParams.pRateCorrectionOut << nodeParams.pWakeupChannel << nodeParams.pWakeupPattern - << nodeParams.pdMicrotick << nodeParams.pSamplesPerMicrotick << nodeParams.pSecondKeySlotID + << nodeParams.pdMicrotick << nodeParams.pSamplesPerMicrotick << nodeParams.pSecondKeySlotId << nodeParams.pTwoKeySlotMode; return buffer; } @@ -166,7 +166,7 @@ inline SilKit::Core::MessageBuffer& operator>>(SilKit::Core::MessageBuffer& buff >> nodeParams.pdMicrotick >> nodeParams.pSamplesPerMicrotick; if (buffer.RemainingBytesLeft() > 0) { - buffer >> nodeParams.pSecondKeySlotID >> nodeParams.pTwoKeySlotMode; + buffer >> nodeParams.pSecondKeySlotId >> nodeParams.pTwoKeySlotMode; } return buffer; } From df542bc844c85c74b794f2cd65205475b79bb2f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20B=C3=B6rschig?= Date: Thu, 15 Jan 2026 12:09:37 +0100 Subject: [PATCH 3/4] fixup! fixup! flexray: add second keyslot to config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit initialize structs Signed-off-by: Marius Börschig --- SilKit/source/services/flexray/Test_FlexrayController.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SilKit/source/services/flexray/Test_FlexrayController.cpp b/SilKit/source/services/flexray/Test_FlexrayController.cpp index 625345c55..5c08474b9 100644 --- a/SilKit/source/services/flexray/Test_FlexrayController.cpp +++ b/SilKit/source/services/flexray/Test_FlexrayController.cpp @@ -46,7 +46,7 @@ auto GetDummyConfig() -> SilKit::Config::FlexrayController auto MakeValidClusterParams() -> FlexrayClusterParameters { - FlexrayClusterParameters clusterParams; + FlexrayClusterParameters clusterParams{}; clusterParams.gColdstartAttempts = 2; clusterParams.gCycleCountMax = 7; clusterParams.gdActionPointOffset = 1; @@ -73,7 +73,7 @@ auto MakeValidClusterParams() -> FlexrayClusterParameters auto MakeValidNodeParams() -> FlexrayNodeParameters { - FlexrayNodeParameters nodeParams; + FlexrayNodeParameters nodeParams{}; nodeParams.pAllowHaltDueToClock = 0; nodeParams.pAllowPassiveToActive = 0; nodeParams.pChannels = FlexrayChannel::A; @@ -116,7 +116,7 @@ auto MakeValidTxBufferConfig() -> FlexrayTxBufferConfig auto GetDummyConfigWithValues() -> SilKit::Config::FlexrayController { - SilKit::Config::FlexrayController dummyConfig; + SilKit::Config::FlexrayController dummyConfig{}; dummyConfig.network = "testNetwork"; dummyConfig.name = "testController"; dummyConfig.clusterParameters = MakeValidClusterParams(); From c82c4c0774fce39b2df5b43fcad784bc0dd57ce6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20B=C3=B6rschig?= Date: Thu, 15 Jan 2026 12:47:52 +0100 Subject: [PATCH 4/4] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Daniel Edwards Signed-off-by: Marius Börschig --- SilKit/include/silkit/capi/Flexray.h | 3 +++ SilKit/include/silkit/services/flexray/FlexrayDatatypes.hpp | 3 +++ SilKit/source/capi/CapiFlexray.cpp | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/SilKit/include/silkit/capi/Flexray.h b/SilKit/include/silkit/capi/Flexray.h index 3de090be9..528f5b37f 100644 --- a/SilKit/include/silkit/capi/Flexray.h +++ b/SilKit/include/silkit/capi/Flexray.h @@ -237,6 +237,9 @@ struct SilKit_FlexrayNodeParameters //! Number of samples per MicroTick (values 1 or 2). uint8_t pSamplesPerMicrotick; + // ---------------------------------------------------------------------- + // Parameters according to B.3.2.1 (added in SIL Kit 5.0.3) + //! Second Key Slot ID of the key slot (range 0-1023, value 0 means that there is no key slot). uint16_t pSecondKeySlotId; diff --git a/SilKit/include/silkit/services/flexray/FlexrayDatatypes.hpp b/SilKit/include/silkit/services/flexray/FlexrayDatatypes.hpp index 622d7d280..e7d1c04c6 100644 --- a/SilKit/include/silkit/services/flexray/FlexrayDatatypes.hpp +++ b/SilKit/include/silkit/services/flexray/FlexrayDatatypes.hpp @@ -232,6 +232,9 @@ struct FlexrayNodeParameters //! Number of samples per MicroTick (values 1 or 2). uint8_t pSamplesPerMicrotick; + // ---------------------------------------------------------------------- + // Parameters according to B.3.2.1 (added in SIL Kit 5.0.3) + //! Second Key Slot ID of the key slot (range 0-1023, value 0 means that there is no key slot). uint16_t pSecondKeySlotId; diff --git a/SilKit/source/capi/CapiFlexray.cpp b/SilKit/source/capi/CapiFlexray.cpp index 16e3f425a..644706fce 100644 --- a/SilKit/source/capi/CapiFlexray.cpp +++ b/SilKit/source/capi/CapiFlexray.cpp @@ -83,7 +83,7 @@ void assign(SilKit::Services::Flexray::FlexrayNodeParameters& cppNodeParameters, cppNodeParameters.pSamplesPerMicrotick = nodeParameters->pSamplesPerMicrotick; } - if ( inputVersion == 2) + if (inputVersion == 2) { cppNodeParameters.pTwoKeySlotMode = nodeParameters->pTwoKeySlotMode; cppNodeParameters.pSecondKeySlotId = nodeParameters->pSecondKeySlotId;