SPSP
Simple publish-subscribe protocol. Connects low power IoT clients to MQTT.
All Classes Files Functions Variables Typedefs Enumerations
Public Types | Public Member Functions | Protected Attributes | List of all members
SPSP::LocalLayers::DummyLocalLayer Class Reference

Dummy local layer for testing. More...

#include <layers_dummy.hpp>

Inheritance diagram for SPSP::LocalLayers::DummyLocalLayer:
Inheritance graph
[legend]
Collaboration diagram for SPSP::LocalLayers::DummyLocalLayer:
Collaboration graph
[legend]

Public Types

using LocalAddrT = SPSP::LocalAddr
 
using LocalMessageT = SPSP::LocalMessage< SPSP::LocalAddr >
 
using SentMsgsSetT = std::unordered_set< LocalMessageT >
 
- Public Types inherited from SPSP::ILocalLayer< LocalMessage< LocalAddr > >
using LocalAddrT = typename LocalMessage< LocalAddr > ::LocalAddrT
 
using LocalMessageT = LocalMessage< LocalAddr >
 

Public Member Functions

virtual bool send (const LocalMessageT &msg)
 Sends the message to given node. More...
 
void receiveDirect (const LocalMessageT &msg, int rssi=0)
 Simulates reception of data from local layer. More...
 
const SentMsgsSetT & getSentMsgs ()
 Returns set of sent messages. More...
 
size_t getSentMsgsCount ()
 Returns count of sent messages. More...
 
- Public Member Functions inherited from SPSP::ILocalLayer< LocalMessage< LocalAddr > >
void setNode (void *n)
 Sets pointer to the owner node. More...
 
ILocalNode< ILocalLayer > * getNode () const
 Gets the node object. More...
 
bool nodeConnected () const
 Checks whether the owner node is connected. More...
 
virtual bool send (const LocalMessage< LocalAddr > &msg)=0
 Sends the message to given node. More...
 

Protected Attributes

SentMsgsSetT m_sentMsgs
 
size_t m_sentMsgsCount = 0
 

Detailed Description

Dummy local layer for testing.

Definition at line 27 of file layers_dummy.hpp.

Member Function Documentation

◆ getSentMsgs()

const SentMsgsSetT& SPSP::LocalLayers::DummyLocalLayer::getSentMsgs ( )
inline

Returns set of sent messages.

Returns
Sent messages set

Definition at line 75 of file layers_dummy.hpp.

◆ getSentMsgsCount()

size_t SPSP::LocalLayers::DummyLocalLayer::getSentMsgsCount ( )
inline

Returns count of sent messages.

Returns
Sent messages count

Definition at line 85 of file layers_dummy.hpp.

◆ receiveDirect()

void SPSP::LocalLayers::DummyLocalLayer::receiveDirect ( const LocalMessageT msg,
int  rssi = 0 
)
inline

Simulates reception of data from local layer.

Parameters
msgMessage
rssiReceived signal strength indicator (in dBm)
Returns
true Delivery successful
false Delivery failed

Definition at line 63 of file layers_dummy.hpp.

◆ send()

virtual bool SPSP::LocalLayers::DummyLocalLayer::send ( const LocalMessageT msg)
inlinevirtual

Sends the message to given node.

In the message, empty address means send to the bridge peer.

Parameters
msgMessage
Returns
true Delivery successful
false Delivery failed

Definition at line 48 of file layers_dummy.hpp.


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