MeshNet  1.0.0
Public Member Functions | Data Fields | Private Attributes
MeshFrameControl Struct Reference

Structure, that contains bit flags used for Frame Control in MeshPacket. Size of this structure is always 1 byte. More...

#include <meshPacketFlags.h>

Public Member Functions

 MeshFrameControl ()
 
 MeshFrameControl (uint8_t raw)
 
 MeshFrameControl (const MeshFrameControl &)=default
 
MeshFrameControloperator= (const MeshFrameControl &)=default
 
void SetCarriageFrame (bool isCarriageFrame, bool isHeader=false)
 Sets frame as carriage frame. More...
 
bool IsCarriageFrame () const
 Checks, if frame is part of carriage. More...
 
bool IsCarriageHeader () const
 Checks, if frame is header part of carriage. More...
 
bool ContainsDestinationAddress () const
 Check if frame with current control frame has to contain Destination address field. More...
 
bool ContainsHopCount () const
 Check if frame with current control frame has to contain hop count field. More...
 
bool ContainsFromAddress () const
 Check if frame with current control frame has to contain From address field. More...
 
bool ContainsToAddress () const
 Check if frame with current control frame has to contain To address field. More...
 
void Clear ()
 Clears frame control flags to it's default values. More...
 
MeshFrameControloperator= (uint8_t val)
 
 operator uint8_t () const
 
 operator uint8_t ()
 
size_t prettyPrint (OSTREAM &stream) const
 Pretty prints frame ontrolto stream. More...
 

Data Fields

volatile bool RoutingEnabled: 1
 Enables or disables routing. When routing is enabled, packet will contain address of next node, which can read current packet. Other nodes which receives this message will ignore it. More...
 
volatile bool RelayingEnabled: 1
 Enables or disables relaying. When relaying is enabled, can be relayied to nodes, which are not neighbors. When relaying is disabled, packet can be received only by neighbors. More...
 
volatile bool SystemPacket: 1
 True when current packet is system packet. More...
 
volatile bool SecuredPacket: 1
 True when packet is secured. More...
 
volatile bool ACKRequired: 1
 True, when destination node has to send acknowledgement. More...
 
volatile bool MoreFrameControl: 1
 True, when message contains another frame control after current frame control. More...
 

Private Attributes

volatile bool CarriageHeader: 1
 True when frame is header frame of frame carriage. More...
 
volatile bool CarriageFrame: 1
 True when frame is part of carriage. Big packets can be splited to multiple frames, which are called carriage. Carriage contains head, it is first frame, which contains specific fields and data and other carriage frames, which contains only basic fields and data. More...
 

Detailed Description

Structure, that contains bit flags used for Frame Control in MeshPacket. Size of this structure is always 1 byte.

See also
meshFrame.h
MeshFrameHeader
MeshFrame
MeshPacket

Constructor & Destructor Documentation

◆ MeshFrameControl() [1/3]

MeshFrameControl::MeshFrameControl ( )
inline

◆ MeshFrameControl() [2/3]

MeshFrameControl::MeshFrameControl ( uint8_t  raw)
inline

◆ MeshFrameControl() [3/3]

MeshFrameControl::MeshFrameControl ( const MeshFrameControl )
default

Member Function Documentation

◆ Clear()

void MeshFrameControl::Clear ( )
inline

Clears frame control flags to it's default values.

◆ ContainsDestinationAddress()

bool MeshFrameControl::ContainsDestinationAddress ( ) const
inline

Check if frame with current control frame has to contain Destination address field.

◆ ContainsFromAddress()

bool MeshFrameControl::ContainsFromAddress ( ) const
inline

Check if frame with current control frame has to contain From address field.

◆ ContainsHopCount()

bool MeshFrameControl::ContainsHopCount ( ) const
inline

Check if frame with current control frame has to contain hop count field.

◆ ContainsToAddress()

bool MeshFrameControl::ContainsToAddress ( ) const
inline

Check if frame with current control frame has to contain To address field.

◆ IsCarriageFrame()

bool MeshFrameControl::IsCarriageFrame ( ) const
inline

Checks, if frame is part of carriage.

◆ IsCarriageHeader()

bool MeshFrameControl::IsCarriageHeader ( ) const
inline

Checks, if frame is header part of carriage.

◆ operator uint8_t() [1/2]

MeshFrameControl::operator uint8_t ( )
inline

◆ operator uint8_t() [2/2]

MeshFrameControl::operator uint8_t ( ) const
inline

◆ operator=() [1/2]

MeshFrameControl& MeshFrameControl::operator= ( const MeshFrameControl )
default

◆ operator=() [2/2]

MeshFrameControl& MeshFrameControl::operator= ( uint8_t  val)
inline

◆ prettyPrint()

size_t MeshFrameControl::prettyPrint ( OSTREAM stream) const

Pretty prints frame ontrolto stream.

Parameters
streamStream, where to print data.
Returns
Returns count of printed characters.

◆ SetCarriageFrame()

void MeshFrameControl::SetCarriageFrame ( bool  isCarriageFrame,
bool  isHeader = false 
)
inline

Sets frame as carriage frame.

Warning
This is reserved only for MAC layer.
Parameters
isCarriageFrameTrue when frame is carriage frame.
isHeaderTrue when frame is header frame of carriage.

Field Documentation

◆ ACKRequired

volatile bool MeshFrameControl::ACKRequired

True, when destination node has to send acknowledgement.

Note
Acronym is ACK-R

◆ CarriageFrame

volatile bool MeshFrameControl::CarriageFrame
private

True when frame is part of carriage. Big packets can be splited to multiple frames, which are called carriage. Carriage contains head, it is first frame, which contains specific fields and data and other carriage frames, which contains only basic fields and data.

Note
Acronym is CF

◆ CarriageHeader

volatile bool MeshFrameControl::CarriageHeader
private

True when frame is header frame of frame carriage.

Note
Acronym is CH

◆ MoreFrameControl

volatile bool MeshFrameControl::MoreFrameControl

True, when message contains another frame control after current frame control.

Note
Acronym is MFC @TODO Implement it somehow.

◆ RelayingEnabled

volatile bool MeshFrameControl::RelayingEnabled

Enables or disables relaying. When relaying is enabled, can be relayied to nodes, which are not neighbors. When relaying is disabled, packet can be received only by neighbors.

Note
Acronym is RE

◆ RoutingEnabled

volatile bool MeshFrameControl::RoutingEnabled

Enables or disables routing. When routing is enabled, packet will contain address of next node, which can read current packet. Other nodes which receives this message will ignore it.

Note
Acronym is ROE

◆ SecuredPacket

volatile bool MeshFrameControl::SecuredPacket

True when packet is secured.

◆ SystemPacket

volatile bool MeshFrameControl::SystemPacket

True when current packet is system packet.

Note
Acronym is SP

The documentation for this struct was generated from the following files: