Message: LIN: Add wakeup request transmit

This commit is contained in:
Samuel Bejko
2026-11-04 13:30:36 -05:00
committed by Kyle Schwarz
parent ee6b846acc
commit 9f747df692
9 changed files with 228 additions and 0 deletions
+16
View File
@@ -140,6 +140,10 @@ static std::vector<uint8_t> EncodeFromMessageLIN(std::shared_ptr<Frame> frame, c
linpacket->CoreMiniBitsLIN.TXCommander = 1;
linpacket->CoreMiniBitsLIN.BreakOnly = 1;
break;
case LINMessage::Type::LIN_WAKEUP_REQUEST:
linpacket->CoreMiniBitsLIN.TXCommander = 1;
linpacket->CoreMiniBitsLIN.WakeupRequest = 1;
break;
default:
break;
}
@@ -165,6 +169,18 @@ static std::vector<uint8_t> EncodeFromMessageLIN(std::shared_ptr<Frame> frame, c
linpacket->CoreMiniBitsLIN.len = 0;
}
if(linmsg->linMsgType == LINMessage::Type::LIN_WAKEUP_REQUEST) {
const int steps = LINMessage::wakeupPulseWidthSteps(*linmsg);
if(!steps) {
report(APIEvent::Type::ParameterOutOfRange, APIEvent::Severity::Error);
return {};
}
// data[0] is the pulse width in 50 us steps
// data[1] to data[7]: future bits reserved for more LIN wake features
linpacket->CoreMiniBitsLIN.len = 1;
linpacket->data[0] = static_cast<uint8_t>(steps);
}
// Description/stats and network
linpacket->stats = linmsg->description;