1#ifndef SOMEIP_MESSAGE_H
2#define SOMEIP_MESSAGE_H
8#include "../helper/payload_helper.h"
17 enum class SomeIpMessageType : uint8_t
20 RequestNoReturn = 0x01,
25 TpRequestNoReturn = 0x21,
26 TpNotification = 0x22,
32 enum class SomeIpReturnCode : uint8_t
41 eWrongProtocolVersion,
42 eWrongInterfaceVersion,
59 uint8_t mProtocolVersion;
60 uint8_t mInterfaceVersion;
61 SomeIpMessageType mMessageType;
62 SomeIpReturnCode mReturnCode;
67 uint8_t protocolVersion,
68 uint8_t interfaceVersion,
69 SomeIpMessageType messageType,
70 SomeIpReturnCode returnCode)
noexcept;
82 uint8_t protocolVersion,
83 uint8_t interfaceVersion,
84 SomeIpMessageType messageType,
85 uint16_t sessionId = 1);
97 uint8_t protocolVersion,
98 uint8_t interfaceVersion,
99 SomeIpMessageType messageType,
100 SomeIpReturnCode returnCode,
101 uint16_t sessionId = 1);
108 const std::vector<uint8_t> &payload);
122 virtual uint32_t
Length() const noexcept = 0;
159 virtual std::vector<uint8_t>
Payload() const;
SOME/IP Abstract Message.
Definition: someip_message.h:54
uint16_t ClientId() const noexcept
Get client ID.
Definition: someip_message.cpp:126
virtual uint32_t Length() const noexcept=0
Get message length.
SomeIpReturnCode ReturnCode() const noexcept
Get return code.
Definition: someip_message.cpp:173
virtual void SetSessionId(uint16_t sessionId)
Set a new session ID.
Definition: someip_message.cpp:136
SomeIpMessageType MessageType() const noexcept
Get message type.
Definition: someip_message.cpp:168
uint8_t InterfaceVersion() const noexcept
Get interface version.
Definition: someip_message.cpp:163
virtual bool IncrementSessionId() noexcept
Increment the session ID by one.
Definition: someip_message.cpp:141
uint32_t MessageId() const noexcept
Get message ID.
Definition: someip_message.cpp:121
static void Deserialize(SomeIpMessage *message, const std::vector< uint8_t > &payload)
Deserialize a SOME/IP message payload.
Definition: someip_message.cpp:99
virtual std::vector< uint8_t > Payload() const
Get message payload.
Definition: someip_message.cpp:178
uint8_t ProtocolVersion() const noexcept
Get protocol version.
Definition: someip_message.cpp:158
uint16_t SessionId() const noexcept
Get session ID.
Definition: someip_message.cpp:131