diff --git a/SilKit/source/services/lin/LinController.cpp b/SilKit/source/services/lin/LinController.cpp index 3952f7eab..48777b6ae 100644 --- a/SilKit/source/services/lin/LinController.cpp +++ b/SilKit/source/services/lin/LinController.cpp @@ -515,11 +515,9 @@ void LinController::GoToSleep() return; } - // Detailed: Send LinSendFrameRequest with GoToSleep-Frame and set LinControllerStatus::SleepPending. BusSim will trigger LinTransmission. + // Detailed: Send LinSendFrameRequest with GoToSleep-Frame and set LinControllerStatus::SleepPending. BusSim will trigger LinTransmission. Sleep after frame is received. // Trivial: Directly send LinTransmission with GoToSleep-Frame and call GoToSleepInternal() on this controller. _simulationBehavior.GoToSleep(); - - _controllerStatus = LinControllerStatus::Sleep; } void LinController::GoToSleepInternal() @@ -784,11 +782,19 @@ void LinController::ReceiveMsg(const IServiceEndpoint* from, const LinTransmissi // Dispatch GoToSleep frames to dedicated handlers if (isGoToSleepFrame) { - // only call GoToSleepHandlers for slaves, i.e., not for the master that issued the GoToSleep command. if (_controllerMode == LinControllerMode::Slave) { + // Only call GoToSleepHandlers for slaves, i.e., not for the master that issued the GoToSleep command. CallHandlers(LinGoToSleepEvent{msg.timestamp}); } + // Detailed: Go to sleep after go-to-sleep frame was received by master + else if (_controllerMode == LinControllerMode::Master) + { + if (_controllerStatus == LinControllerStatus::SleepPending) + { + _controllerStatus = LinControllerStatus::Sleep; + } + } } } diff --git a/docs/changelog/versions/latest.md b/docs/changelog/versions/latest.md index 6992b924f..5691ab6de 100644 --- a/docs/changelog/versions/latest.md +++ b/docs/changelog/versions/latest.md @@ -1,5 +1,10 @@ # [5.0.5] - UNRELEASED +## Fixed + +- `lin`: fixed missing reception of the Go-To-Sleep frame by the master after `GoToSleep()` in detailed simulation + + ## Changed - `cmake`: merged almost all internal CMake `INTERFACE` libraries into `I_SilKit`