sMQTTBroker
Public Member Functions | Friends | List of all members
sMQTTBroker Class Referenceabstract

#include <sMQTTBroker.h>

Inheritance diagram for sMQTTBroker:
Inheritance graph
[legend]

Public Member Functions

bool init (unsigned short port, bool checkWifiConnection=false)
 
void update ()
 
void publish (const std::string &topic, const std::string &payload, unsigned char qos=0, bool retain=false)
 
void restart ()
 restart WIFI server
 
virtual bool onEvent (sMQTTEvent *event)=0
 receive event from broker More...
 
unsigned long getRetainedTopicCount ()
 receive retained topic count
 
std::string getRetaiedTopicName (unsigned long index)
 receive topic name by index More...
 

Friends

class sMQTTClient
 

Detailed Description

Main class

Member Function Documentation

◆ getRetaiedTopicName()

std::string sMQTTBroker::getRetaiedTopicName ( unsigned long  index)

receive topic name by index

Parameters
indexindex of topic

◆ init()

bool sMQTTBroker::init ( unsigned short  port,
bool  checkWifiConnection = false 
)

setup broker

Parameters
portset listen port
checkWifiConnectionenable/disable notify wifi connection in onEvent

◆ onEvent()

virtual bool sMQTTBroker::onEvent ( sMQTTEvent event)
pure virtual

receive event from broker

Parameters
event

Implemented in sMQTTBrokerWithoutEvent.

◆ publish()

void sMQTTBroker::publish ( const std::string &  topic,
const std::string &  payload,
unsigned char  qos = 0,
bool  retain = false 
)

publish message

Parameters
topicname of topic
payload
qos
retain

◆ update()

void sMQTTBroker::update ( )

call in loop function


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