How on_connect() called in example temperature_conversion.cpp

17 views
Skip to first unread message

Ahmed Rafiq

unread,
Apr 10, 2016, 9:51:33 AM4/10/16
to MQTT

I didn't understood how the example code for temperature_conversion, the member function on_connect is working ?

from main, it called loop() through object, but while I'm checking the source code for loop(), I didn't found anything that calling the on_connect().

could anybody please explain.

Thanks in advance.

Roger Light

unread,
Apr 10, 2016, 4:00:58 PM4/10/16
to mq...@googlegroups.com
Hi Ahmed,

When the broker sends a CONNACK message to the client, the network
processing code recognises it and calls on_connect(). Try looking in
lib/read_handle_connect.c

Cheers,

Roger
> --
> To learn more about MQTT please visit http://mqtt.org
> ---
> You received this message because you are subscribed to the Google Groups
> "MQTT" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mqtt+uns...@googlegroups.com.
> To post to this group, send email to mq...@googlegroups.com.
> Visit this group at https://groups.google.com/group/mqtt.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages