Diagnostic message negative acknowledgement.
More...
#include <diag_message_nack.h>
|
| DiagMessageNack (uint8_t protocolVersion, uint16_t sourceAddress, uint16_t targetAddress, DiagNackType nackCode) |
| Constructor without previous message. More...
|
|
| DiagMessageNack (uint8_t protocolVersion, uint16_t sourceAddress, uint16_t targetAddress, DiagNackType nackCode, const std::vector< uint8_t > &previousMessage) |
| Constructor including previous message. More...
|
|
| DiagMessageNack (uint8_t protocolVersion, uint16_t sourceAddress, uint16_t targetAddress, DiagNackType nackCode, std::vector< uint8_t > &&previousMessage) |
| Constructor including previous message. More...
|
|
uint16_t | GetSourceAddress () const noexcept |
| Get message source address. More...
|
|
uint16_t | GetTargetAddress () const noexcept |
| Get message target address. More...
|
|
DiagNackType | GetNackCode () const noexcept |
| Get NACK code. More...
|
|
bool | TryGetPreviousMessage (std::vector< uint8_t > &previousMessage) |
| Get previous diagnostic message. More...
|
|
void | Serialize (std::vector< uint8_t > &serializedMessage) const |
| Serialize DoIP message. More...
|
|
bool | TryDeserialize (const std::vector< uint8_t > &serializedMessage, GenericNackType &nackCode) |
| Try to deserialize DoIP message. More...
|
|
|
void | GetPayload (std::vector< uint8_t > &payload) const override |
| Get message payload. More...
|
|
virtual bool | TrySetPayload (const std::vector< uint8_t > &payload, uint32_t payloadLength) override |
| Try to set message payload. More...
|
|
| Message (PayloadType payloadType) noexcept |
| Constructor. More...
|
|
| Message (uint8_t protocolVersion, PayloadType payloadType) noexcept |
| Constructor. More...
|
|
|
static bool | TryExtractPayloadType (const std::vector< uint8_t > &serializedMessage, PayloadType &payloadType) |
| Try to extract the payload type from the given serialized message. More...
|
|
static const std::size_t | cHeaderSize {8} |
| DoIP message header size.
|
|
Diagnostic message negative acknowledgement.
◆ DiagMessageNack() [1/3]
DoipLib::DiagMessageNack::DiagMessageNack |
( |
uint8_t |
protocolVersion, |
|
|
uint16_t |
sourceAddress, |
|
|
uint16_t |
targetAddress, |
|
|
DiagNackType |
nackCode |
|
) |
| |
Constructor without previous message.
- Parameters
-
protocolVersion | DoIP ISO protocol version |
sourceAddress | Sender logical address |
targetAddress | Receiver logical address |
nackCode | Negative acknowledgement code |
◆ DiagMessageNack() [2/3]
DoipLib::DiagMessageNack::DiagMessageNack |
( |
uint8_t |
protocolVersion, |
|
|
uint16_t |
sourceAddress, |
|
|
uint16_t |
targetAddress, |
|
|
DiagNackType |
nackCode, |
|
|
const std::vector< uint8_t > & |
previousMessage |
|
) |
| |
Constructor including previous message.
- Parameters
-
protocolVersion | DoIP ISO protocol version |
sourceAddress | Sender logical address |
targetAddress | Receiver logical address |
nackCode | Negative acknowledgement code |
previousMessage | Previous diagnostic message payload |
◆ DiagMessageNack() [3/3]
DoipLib::DiagMessageNack::DiagMessageNack |
( |
uint8_t |
protocolVersion, |
|
|
uint16_t |
sourceAddress, |
|
|
uint16_t |
targetAddress, |
|
|
DiagNackType |
nackCode, |
|
|
std::vector< uint8_t > && |
previousMessage |
|
) |
| |
Constructor including previous message.
- Parameters
-
protocolVersion | DoIP ISO protocol version |
sourceAddress | Sender logical address |
targetAddress | Receiver logical address |
nackCode | Negative acknowledgement code |
previousMessage | Previous diagnostic message payload |
◆ GetNackCode()
DiagNackType DoipLib::DiagMessageNack::GetNackCode |
( |
| ) |
const |
|
noexcept |
Get NACK code.
- Returns
- Negative acknowledgement code
◆ GetPayload()
void DoipLib::DiagMessageNack::GetPayload |
( |
std::vector< uint8_t > & |
payload | ) |
const |
|
overrideprotectedvirtual |
Get message payload.
- Parameters
-
[out] | payload | Payload byte array |
Implements DoipLib::Message.
◆ GetSourceAddress()
uint16_t DoipLib::DiagMessageNack::GetSourceAddress |
( |
| ) |
const |
|
noexcept |
Get message source address.
- Returns
- Sender logical address
◆ GetTargetAddress()
uint16_t DoipLib::DiagMessageNack::GetTargetAddress |
( |
| ) |
const |
|
noexcept |
Get message target address.
- Returns
- Receiver logical address
◆ TryGetPreviousMessage()
bool DoipLib::DiagMessageNack::TryGetPreviousMessage |
( |
std::vector< uint8_t > & |
previousMessage | ) |
|
Get previous diagnostic message.
- Parameters
-
[out] | previousMessage | Previous diagnostic message payload |
- Returns
- True if the message is available, otherwise false
◆ TrySetPayload()
virtual bool DoipLib::DiagMessageNack::TrySetPayload |
( |
const std::vector< uint8_t > & |
payload, |
|
|
uint32_t |
payloadLength |
|
) |
| |
|
overrideprotectedvirtual |
Try to set message payload.
- Parameters
-
[in] | payload | Payload byte array |
[in] | payloadLength | Payload length from the message header |
- Returns
- True if the payload is set successfully, otherwise false
Implements DoipLib::Message.