Skip to content

Passing class members functions as callbacks of setMultiPathStreamCallback #377

Answered by mobizt
engmarconi asked this question in Q&A
Discussion options

You must be logged in to vote

You can declare your callback function as static inside your class. Using your class member function without object as a callback function is not allowed in C++.

You can create the ESP8266 schedule task that executes these 3 functions i.e. Firebase.readStream, stream.streamTimeout() and stream.streamAvailable() repeatedly in your class.

if (!Firebase.readStream(stream))
Serial.printf("sream read error, %s\n\n", stream.errorReason().c_str());
if (stream.streamTimeout())
{
Serial.println("stream timed out, resuming...\n");
if (!stream.httpConnected

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@engmarconi
Comment options

@mobizt
Comment options

@engmarconi
Comment options

Answer selected by engmarconi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants