Diagnostic message (e.g., an UDS message)
More...
#include <diag_message.h>
|
| DiagMessage (uint8_t protocolVersion, uint16_t sourceAddress, uint16_t targetAddress, const std::vector< uint8_t > &userData) |
| Constructor. More...
|
|
| DiagMessage (uint8_t protocolVersion, uint16_t sourceAddress, uint16_t targetAddress, std::vector< uint8_t > &&userData) |
| Constructor. More...
|
|
uint16_t | GetSourceAddress () const noexcept |
| Get message source address. More...
|
|
uint16_t | GetTargetAddress () const noexcept |
| Get message target address. More...
|
|
void | GetUserData (std::vector< uint8_t > &userData) const |
| Get user data. 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 (e.g., an UDS message)
◆ DiagMessage() [1/2]
DoipLib::DiagMessage::DiagMessage |
( |
uint8_t |
protocolVersion, |
|
|
uint16_t |
sourceAddress, |
|
|
uint16_t |
targetAddress, |
|
|
const std::vector< uint8_t > & |
userData |
|
) |
| |
Constructor.
- Parameters
-
protocolVersion | DoIP ISO protocol version |
sourceAddress | Sender logical address |
targetAddress | Receiver logical address |
userData | Actual diagnostic payload data (e.g., UDS message payload) |
◆ DiagMessage() [2/2]
DoipLib::DiagMessage::DiagMessage |
( |
uint8_t |
protocolVersion, |
|
|
uint16_t |
sourceAddress, |
|
|
uint16_t |
targetAddress, |
|
|
std::vector< uint8_t > && |
userData |
|
) |
| |
Constructor.
- Parameters
-
protocolVersion | DoIP ISO protocol version |
sourceAddress | Sender logical address |
targetAddress | Receiver logical address |
userData | Actual diagnostic payload data (e.g., UDS message payload) |
◆ GetPayload()
void DoipLib::DiagMessage::GetPayload |
( |
std::vector< uint8_t > & |
payload | ) |
const |
|
overrideprotectedvirtual |
Get message payload.
- Parameters
-
[out] | payload | Payload byte array |
Implements DoipLib::Message.
◆ GetSourceAddress()
uint16_t DoipLib::DiagMessage::GetSourceAddress |
( |
| ) |
const |
|
noexcept |
Get message source address.
- Returns
- Sender logical address
◆ GetTargetAddress()
uint16_t DoipLib::DiagMessage::GetTargetAddress |
( |
| ) |
const |
|
noexcept |
Get message target address.
- Returns
- Receiver logical address
◆ GetUserData()
void DoipLib::DiagMessage::GetUserData |
( |
std::vector< uint8_t > & |
userData | ) |
const |
Get user data.
- Parameters
-
[out] | userData | Actual diagnostic payload data (e.g., UDS message payload) |
◆ TrySetPayload()
virtual bool DoipLib::DiagMessage::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.