PcapPlusPlus  Next
pcpp::DoIpDiagnosticPowerModeResponse Class Reference

Represents a DoIP Diagnostic Power Mode Response message. More...

#include <DoIpLayer.h>

Inheritance diagram for pcpp::DoIpDiagnosticPowerModeResponse:
pcpp::DoIpLayer pcpp::Layer pcpp::IDataContainer

Public Member Functions

 DoIpDiagnosticPowerModeResponse (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
 Constructs the layer from raw DoIP packet data. More...
 
 DoIpDiagnosticPowerModeResponse (DoIpDiagnosticPowerModeCodes modeCode)
 Constructs the message using the specified power mode code. More...
 
DoIpDiagnosticPowerModeCodes getPowerModeCode () const
 Gets the current power mode code. More...
 
void setPowerModeCode (DoIpDiagnosticPowerModeCodes code)
 Sets the power mode code. More...
 
std::string getSummary () const
 Returns a human-readable summary of the message.
 
DoIpPayloadTypes getPayloadType () const override
 Returns the DoIP payload type. More...
 
- Public Member Functions inherited from pcpp::DoIpLayer
std::string getPayloadTypeAsStr () const
 
DoIpProtocolVersion getProtocolVersion () const
 
std::string getProtocolVersionAsStr () const
 
void setProtocolVersion (DoIpProtocolVersion version)
 
void setProtocolVersion (uint8_t rawVersion)
 
uint8_t getInvertProtocolVersion () const
 
void setInvertProtocolVersion (uint8_t iVersion)
 
uint32_t getPayloadLength () const
 
void setPayloadLength (uint32_t length)
 
void parseNextLayer () override
 parse UDS layer
 
size_t getHeaderLen () const override
 
std::string toString () const override
 
void computeCalculateFields () override
 Each layer can compute field values automatically using this method. This is an abstract method.
 
OsiModelLayer getOsiModelLayer () const override
 
- Public Member Functions inherited from pcpp::Layer
 ~Layer () override
 
LayergetNextLayer () const
 
LayergetPrevLayer () const
 
ProtocolType getProtocol () const
 
bool isMemberOfProtocolFamily (ProtocolTypeFamily protocolTypeFamily) const
 
uint8_t * getData () const
 
size_t getDataLen () const
 
uint8_t * getLayerPayload () const
 
size_t getLayerPayloadSize () const
 
bool isAllocatedToPacket () const
 
void copyData (uint8_t *toArr) const
 
uint8_t * getDataPtr (size_t offset=0) const override
 

Static Public Member Functions

static bool isDataLenValid (size_t dataLen)
 Checks if the Diagnostic Power Mode Response data length is valid. More...
 
- Static Public Member Functions inherited from pcpp::DoIpLayer
static DoIpLayerparseDoIpLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
 
static bool isDoIpPort (uint16_t port)
 
static bool isDataValid (uint8_t *data, size_t dataLen)
 

Additional Inherited Members

- Protected Member Functions inherited from pcpp::Layer
template<typename T , typename... Args>
LayerconstructNextLayer (uint8_t *data, size_t dataLen, Packet *packet, Args &&... extraArgs)
 
template<typename T , typename TFallback , typename... Args>
LayertryConstructNextLayerWithFallback (uint8_t *data, size_t dataLen, Packet *packet, Args &&... extraArgs)
 
- Static Protected Member Functions inherited from pcpp::Layer
template<typename T >
static bool canReinterpretAs (const uint8_t *data, size_t dataLen)
 Check if the data is large enough to reinterpret as a type. More...
 

Detailed Description

Represents a DoIP Diagnostic Power Mode Response message.

This message is used to communicate the current power mode of the vehicle or control unit in response to a diagnostic power mode request.

Constructor & Destructor Documentation

◆ DoIpDiagnosticPowerModeResponse() [1/2]

pcpp::DoIpDiagnosticPowerModeResponse::DoIpDiagnosticPowerModeResponse ( uint8_t *  data,
size_t  dataLen,
Layer prevLayer,
Packet packet 
)

Constructs the layer from raw DoIP packet data.

Parameters
[in]dataPointer to the raw data buffer.
[in]dataLenSize of the data buffer in bytes.
[in]prevLayerPointer to the previous protocol layer.
[in]packetPointer to the parent packet.

◆ DoIpDiagnosticPowerModeResponse() [2/2]

pcpp::DoIpDiagnosticPowerModeResponse::DoIpDiagnosticPowerModeResponse ( DoIpDiagnosticPowerModeCodes  modeCode)
explicit

Constructs the message using the specified power mode code.

Parameters
[in]modeCodeDiagnostic power mode code to set.

Member Function Documentation

◆ getPayloadType()

DoIpPayloadTypes pcpp::DoIpDiagnosticPowerModeResponse::getPayloadType ( ) const
inlineoverridevirtual

Returns the DoIP payload type.

Returns
DoIpPayloadTypes::DIAGNOSTIC_POWER_MODE_RESPONSE

Implements pcpp::DoIpLayer.

◆ getPowerModeCode()

DoIpDiagnosticPowerModeCodes pcpp::DoIpDiagnosticPowerModeResponse::getPowerModeCode ( ) const

Gets the current power mode code.

Returns
The diagnostic power mode code.

◆ isDataLenValid()

static bool pcpp::DoIpDiagnosticPowerModeResponse::isDataLenValid ( size_t  dataLen)
inlinestatic

Checks if the Diagnostic Power Mode Response data length is valid.

Parameters
[in]dataLenLength of the data buffer.
Returns
true if the data length is valid, false otherwise.

◆ setPowerModeCode()

void pcpp::DoIpDiagnosticPowerModeResponse::setPowerModeCode ( DoIpDiagnosticPowerModeCodes  code)

Sets the power mode code.

Parameters
[in]codeenum DoIpDiagnosticPowerModeCodes representing the power mode code to set.