DoIP generic message.
More...
#include <message.h>
|
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...
|
|
|
static bool | TryExtractPayloadType (const std::vector< uint8_t > &serializedMessage, PayloadType &payloadType) |
| Try to extract the payload type from the given serialized message. More...
|
|
|
| Message (PayloadType payloadType) noexcept |
| Constructor. More...
|
|
| Message (uint8_t protocolVersion, PayloadType payloadType) noexcept |
| Constructor. More...
|
|
virtual void | GetPayload (std::vector< uint8_t > &payload) const =0 |
| Get message payload. More...
|
|
virtual bool | TrySetPayload (const std::vector< uint8_t > &payload, uint32_t payloadLength)=0 |
| Try to set message payload. More...
|
|
|
static const std::size_t | cHeaderSize {8} |
| DoIP message header size.
|
|
◆ Message() [1/2]
DoipLib::Message::Message |
( |
PayloadType |
payloadType | ) |
|
|
explicitprotectednoexcept |
Constructor.
- Parameters
-
payloadType | DoIP message payload type |
◆ Message() [2/2]
DoipLib::Message::Message |
( |
uint8_t |
protocolVersion, |
|
|
PayloadType |
payloadType |
|
) |
| |
|
protectednoexcept |
Constructor.
- Parameters
-
protocolVersion | DoIP ISO protocol version |
payloadType | DoIP message payload type |
◆ GetPayload()
virtual void DoipLib::Message::GetPayload |
( |
std::vector< uint8_t > & |
payload | ) |
const |
|
protectedpure virtual |
Get message payload.
- Parameters
-
[out] | payload | Payload byte array |
Implemented in DoipLib::AliveCheckRequest, DoipLib::AliveCheckResponse, DoipLib::DiagMessage, DoipLib::DiagMessageAck, DoipLib::DiagMessageNack, DoipLib::EidVehicleIdRequest, DoipLib::EntityStatusRequest, DoipLib::EntityStatusResponse, DoipLib::GenericNack, DoipLib::PowerModeRequest, DoipLib::PowerModeResponse, DoipLib::RoutingActivationRequest, DoipLib::RoutingActivationResponse, DoipLib::VehicleIdRequest, DoipLib::VehicleIdResponse, and DoipLib::VinVehicleIdRequest.
◆ Serialize()
void DoipLib::Message::Serialize |
( |
std::vector< uint8_t > & |
serializedMessage | ) |
const |
Serialize DoIP message.
- Parameters
-
[out] | serializedMessage | Serialize message byte array |
◆ TryDeserialize()
bool DoipLib::Message::TryDeserialize |
( |
const std::vector< uint8_t > & |
serializedMessage, |
|
|
GenericNackType & |
nackCode |
|
) |
| |
Try to deserialize DoIP message.
- Parameters
-
[in] | serializedMessage | Serialize message byte array |
[out] | nackCode | Negative acknowledgement code if deserialization failed |
- Returns
- True if the deserialization is successful, otherwise false
◆ TryExtractPayloadType()
static bool DoipLib::Message::TryExtractPayloadType |
( |
const std::vector< uint8_t > & |
serializedMessage, |
|
|
PayloadType & |
payloadType |
|
) |
| |
|
static |
Try to extract the payload type from the given serialized message.
- Parameters
-
[in] | serializedMessage | Serialized message byte array |
[out] | payloadType | Extracted payload type |
- Returns
- True if the payload type is extracted successfully, otherwise false
◆ TrySetPayload()
virtual bool DoipLib::Message::TrySetPayload |
( |
const std::vector< uint8_t > & |
payload, |
|
|
uint32_t |
payloadLength |
|
) |
| |
|
protectedpure virtual |
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
Implemented in DoipLib::AliveCheckRequest, DoipLib::AliveCheckResponse, DoipLib::DiagMessage, DoipLib::DiagMessageAck, DoipLib::DiagMessageNack, DoipLib::EidVehicleIdRequest, DoipLib::EntityStatusRequest, DoipLib::EntityStatusResponse, DoipLib::GenericNack, DoipLib::PowerModeRequest, DoipLib::PowerModeResponse, DoipLib::RoutingActivationRequest, DoipLib::RoutingActivationResponse, DoipLib::VehicleIdRequest, DoipLib::VehicleIdResponse, and DoipLib::VinVehicleIdRequest.