Woman, Life, Freedom


DoIP Library
Diagnostics over Internet Protocol (DoIP) C++ library
entity_status_response.h
1#ifndef ENTITY_STATUS_RESPONSE_H
2#define ENTITY_STATUS_RESPONSE_H
3
4#include "./message.h"
5#include "./node_type.h"
6
7namespace DoipLib
8{
11 {
12 private:
13 static const PayloadType cPayloadType{
14 PayloadType::DoipEntityStatusResponse};
15
16 NodeType mEntityType;
17 uint8_t mMaxOpenSockets;
18 uint8_t mCurrentlyOpenSocket;
19 bool mHasMaxDataSize;
20 uint32_t mMaxDataSize;
21
23 uint8_t protocolVersion,
24 NodeType entityType,
25 uint8_t maxOpenSockets,
26 uint8_t currentlyOpenSocket,
27 bool hasMaxDataSize,
28 uint32_t maxDataSize = 0) noexcept;
29
30 void SetPayload(const std::vector<uint8_t> &payload);
31
32 protected:
33 void GetPayload(std::vector<uint8_t> &payload) const override;
34
35 virtual bool TrySetPayload(
36 const std::vector<uint8_t> &payload,
37 uint32_t payloadLength) override;
38
39 public:
40 EntityStatusResponse() noexcept;
41
48 uint8_t protocolVersion,
49 NodeType entityType,
50 uint8_t maxOpenSockets,
51 uint8_t currentlyOpenSocket) noexcept;
52
60 uint8_t protocolVersion,
61 NodeType entityType,
62 uint8_t maxOpenSockets,
63 uint8_t currentlyOpenSocket,
64 uint32_t maxDataSize) noexcept;
65
68 NodeType GetEntityType() const noexcept;
69
72 uint8_t GetMaxOpenSockets() const noexcept;
73
76 uint8_t GetCurrentlyOpenSocket() const noexcept;
77
81 bool TryGetMaxDataSize(uint32_t &maxDataSize) const noexcept;
82 };
83}
84
85#endif
Diagnostic entity status response.
Definition: entity_status_response.h:11
virtual bool TrySetPayload(const std::vector< uint8_t > &payload, uint32_t payloadLength) override
Try to set message payload.
void GetPayload(std::vector< uint8_t > &payload) const override
Get message payload.
bool TryGetMaxDataSize(uint32_t &maxDataSize) const noexcept
Try to get the maximum data size.
uint8_t GetCurrentlyOpenSocket() const noexcept
Get currently open socket number.
uint8_t GetMaxOpenSockets() const noexcept
Get maximum open sockets number.
NodeType GetEntityType() const noexcept
Get entity type.
DoIP generic message.
Definition: message.h:12