1#ifndef DIAG_MESSAGE_ACK_H
2#define DIAG_MESSAGE_ACK_H
5#include "./diag_nack_type.h"
13 static const PayloadType cPayloadType{
14 PayloadType::DiagMessageNegativeAcknowledgement};
16 uint16_t mSourceAddress;
17 uint16_t mTargetAddress;
18 DiagNackType mNackCode;
19 bool mHasPreviousMessage;
20 std::vector<uint8_t> mPreviousMessage;
22 void SetCompulsoryPayload(
const std::vector<uint8_t> &payload);
25 void GetPayload(std::vector<uint8_t> &payload)
const override;
28 const std::vector<uint8_t> &payload,
29 uint32_t payloadLength)
override;
40 uint8_t protocolVersion,
41 uint16_t sourceAddress,
42 uint16_t targetAddress,
43 DiagNackType nackCode);
52 uint8_t protocolVersion,
53 uint16_t sourceAddress,
54 uint16_t targetAddress,
55 DiagNackType nackCode,
56 const std::vector<uint8_t> &previousMessage);
65 uint8_t protocolVersion,
66 uint16_t sourceAddress,
67 uint16_t targetAddress,
68 DiagNackType nackCode,
69 std::vector<uint8_t> &&previousMessage);
Diagnostic message negative acknowledgement.
Definition: diag_message_nack.h:11
DiagMessageNack(uint8_t protocolVersion, uint16_t sourceAddress, uint16_t targetAddress, DiagNackType nackCode, std::vector< uint8_t > &&previousMessage)
Constructor including previous message.
uint16_t GetTargetAddress() const noexcept
Get message target address.
virtual bool TrySetPayload(const std::vector< uint8_t > &payload, uint32_t payloadLength) override
Try to set message payload.
DiagMessageNack(uint8_t protocolVersion, uint16_t sourceAddress, uint16_t targetAddress, DiagNackType nackCode, const std::vector< uint8_t > &previousMessage)
Constructor including previous message.
bool TryGetPreviousMessage(std::vector< uint8_t > &previousMessage)
Get previous diagnostic message.
DiagNackType GetNackCode() const noexcept
Get NACK code.
DiagMessageNack(uint8_t protocolVersion, uint16_t sourceAddress, uint16_t targetAddress, DiagNackType nackCode)
Constructor without previous message.
void GetPayload(std::vector< uint8_t > &payload) const override
Get message payload.
uint16_t GetSourceAddress() const noexcept
Get message source address.
DoIP generic message.
Definition: message.h:12