MeshNet  1.0.0
Static Public Member Functions | Static Public Attributes | Private Member Functions
DisconnectPD Class Reference

Static class, that groups static methods to decode node disconnect packet. More...

#include <meshPacketDecoders.h>

Static Public Member Functions

static bool IsSameType (const MeshPacket &packet)
 Checks if system packet type match decoder type, but does not check its validity. More...
 
static bool IsValid (const MeshPacket &packet)
 Checks if packet is valid. More...
 
static MeshNetDisconnectPacketType GetDisconnectType (const MeshPacket &packet)
 Gets disconnect packet type. More...
 
static void SetDisconnectType (MeshPacket &packet, MeshNetDisconnectPacketType disconnectType)
 Sets disconnect packet type. More...
 
static bool Construct (MeshPacket &packet, uint8_t sourceAddr, uint8_t destAddr, MeshNetDisconnectPacketType disconnectType)
 Constructs packet of current type. More...
 

Static Public Attributes

const static SystemPacketType Type = SPT_Disconnect
 Type of system packet, that can be decoded with current decoder. More...
 

Private Member Functions

 DisconnectPD ()
 

Detailed Description

Static class, that groups static methods to decode node disconnect packet.

Constructor & Destructor Documentation

◆ DisconnectPD()

DisconnectPD::DisconnectPD ( )
inlineprivate

Member Function Documentation

◆ Construct()

static bool DisconnectPD::Construct ( MeshPacket packet,
uint8_t  sourceAddr,
uint8_t  destAddr,
MeshNetDisconnectPacketType  disconnectType 
)
inlinestatic

Constructs packet of current type.

Parameters
[in]packetSystem packet to construct.
sourceAddrSource node address.
destAddrDestination node address.
disconnectTypeDisconnect packet type.
Returns
Returns true when packet was constructed successfully.

◆ GetDisconnectType()

static MeshNetDisconnectPacketType DisconnectPD::GetDisconnectType ( const MeshPacket packet)
inlinestatic

Gets disconnect packet type.

Parameters
[in]packetSystem packet to decode.
Returns
Disconnect packet type.
Warning
Always check, if packet is valid using IsValid() method, else exception can be thrown.

◆ IsSameType()

static bool DisconnectPD::IsSameType ( const MeshPacket packet)
inlinestatic

Checks if system packet type match decoder type, but does not check its validity.

Parameters
[in]packetSystem packet to decode.
Returns
True when this decoder should be used to decode current system packet.

◆ IsValid()

static bool DisconnectPD::IsValid ( const MeshPacket packet)
inlinestatic

Checks if packet is valid.

Parameters
[in]packetSystem packet to decode.
Returns
True when packet is valid and can be decoded.
Warning
Invalid packet should not be decoded, because it can cause exception.

◆ SetDisconnectType()

static void DisconnectPD::SetDisconnectType ( MeshPacket packet,
MeshNetDisconnectPacketType  disconnectType 
)
inlinestatic

Sets disconnect packet type.

Parameters
[in]packetSystem packet to decode.
disconnectTypeDisconnect packet type.
Warning
Always check, if packet is valid using IsValid() method, else exception can be thrown.

Field Documentation

◆ Type

const static SystemPacketType DisconnectPD::Type = SPT_Disconnect
static

Type of system packet, that can be decoded with current decoder.


The documentation for this class was generated from the following file: