Woman, Life, Freedom


DoIP Library
Diagnostics over Internet Protocol (DoIP) C++ library
vehicle_id_response.h
1#ifndef VEHICLE_ID_RESPONSE_H
2#define VEHICLE_ID_RESPONSE_H
3
4#include <array>
5#include <string>
6#include "./message.h"
7
8namespace DoipLib
9{
12 {
13 private:
14 static const PayloadType cPayloadType{
15 PayloadType::VehicleAnnoucementIdResponse};
16 static const std::size_t cVinSize{17};
17 static constexpr std::size_t cIdSize{6};
18
19 std::string mVin;
20 uint16_t mLogicalAddress;
21 std::array<uint8_t, cIdSize> mEid;
22 std::array<uint8_t, cIdSize> mGid;
23 uint8_t mFurtherAction;
24 bool mUseVehicleIdSync;
25 uint8_t mVinGidStatus;
26
27 void SetPayload(const std::vector<uint8_t> &payload);
28
29 protected:
30 void GetPayload(std::vector<uint8_t> &payload) const override;
31
32 virtual bool TrySetPayload(
33 const std::vector<uint8_t> &payload,
34 uint32_t payloadLength) override;
35
36 public:
37 VehicleIdResponse() noexcept;
38
48 uint8_t protocolVersion,
49 const std::string &vin,
50 uint16_t logicalAddress,
51 std::array<uint8_t, cIdSize> eid,
52 std::array<uint8_t, cIdSize> gid,
53 uint8_t furtherAction);
54
64 uint8_t protocolVersion,
65 std::string &&vin,
66 uint16_t logicalAddress,
67 std::array<uint8_t, cIdSize> eid,
68 std::array<uint8_t, cIdSize> gid,
69 uint8_t furtherAction);
70
81 uint8_t protocolVersion,
82 const std::string &vin,
83 uint16_t logicalAddress,
84 std::array<uint8_t, cIdSize> eid,
85 std::array<uint8_t, cIdSize> gid,
86 uint8_t furtherAction,
87 uint8_t vinGidStatus);
88
99 uint8_t protocolVersion,
100 std::string &&vin,
101 uint16_t logicalAddress,
102 std::array<uint8_t, cIdSize> eid,
103 std::array<uint8_t, cIdSize> gid,
104 uint8_t furtherAction,
105 uint8_t vinGidStatus);
106
109 std::string GetVin() const;
110
113 uint16_t GetLogicalAddress() const noexcept;
114
117 std::array<uint8_t, cIdSize> GetEid() const;
118
121 std::array<uint8_t, cIdSize> GetGid() const;
122
125 uint8_t GetFurtherAction() const noexcept;
126
130 bool TryGetVinGinStatus(uint8_t &vinGinStatus) const noexcept;
131 };
132}
133
134#endif
DoIP generic message.
Definition: message.h:12
Vehicle announcement ID response message.
Definition: vehicle_id_response.h:12
void GetPayload(std::vector< uint8_t > &payload) const override
Get message payload.
bool TryGetVinGinStatus(uint8_t &vinGinStatus) const noexcept
Try to get the VIN/GIN status.
std::array< uint8_t, cIdSize > GetGid() const
Get GID.
virtual bool TrySetPayload(const std::vector< uint8_t > &payload, uint32_t payloadLength) override
Try to set message payload.
std::string GetVin() const
Get VIN.
uint16_t GetLogicalAddress() const noexcept
Get logical address.
std::array< uint8_t, cIdSize > GetEid() const
Get EID.
uint8_t GetFurtherAction() const noexcept
Get further action.