PubSubClient3 v3.3.2
Located at <a href='https://github.com/hmueller01/pubsubclient3'>GitHub</a>
 
Loading...
Searching...
No Matches
PubSubClient.cpp File Reference

A simple client for MQTT. More...

#include "PubSubClient.h"

Go to the source code of this file.

Macros

#define PUBSUB_WAIT_YIELD()
 Give other tasks a chance to run while waiting for data.
 

Detailed Description

A simple client for MQTT.

Author
Nicholas O'Leary - http://knolleary.net
Holger Mueller - https://github.com/hmueller01/pubsubclient3

This file is part of the PubSubClient library.

Definition in file PubSubClient.cpp.

Macro Definition Documentation

◆ PUBSUB_WAIT_YIELD

#define PUBSUB_WAIT_YIELD ( )
Value:
yield()

Give other tasks a chance to run while waiting for data.

On FreeRTOS a yield only reschedules a task of equal or higher priority, which is what a real time scheduler has to promise. A task spinning in a wait loop therefore never lets the idle task run, and a watchdog fed from that idle task fires. Blocking for a single tick is what actually hands the CPU over.

vTaskDelay(1) rather than delay(1): the intent is one tick, and delay(ms) maps to vTaskDelay(ms / portTICK_PERIOD_MS), which rounds down to zero below a 1 kHz tick.

Definition at line 27 of file PubSubClient.cpp.