knolleary / pubsubclient

A client library for the Arduino Ethernet Shield that provides support for MQTT.
http://pubsubclient.knolleary.net/
MIT License
3.78k stars 1.46k forks source link

Extend usage of std::function on all the platforms where it's available #993

Open alranel opened 1 year ago

alranel commented 1 year ago

At this point in time, C++11 is available on most Arduino platforms and not just on ESP8266 and ESP32. With this pull request, the ability to supply lambdas (including object methods) to setCallback() instead of plain function pointers is extended automatically to all the platforms which provide support for std::function. :)

imbeacon commented 1 year ago

Hi, faced the issue with the same reason, on Arduino Nano Connect, based on RP2040. @knolleary, please add ability to use std::function as callbacks not just for ESP-based boards.

manchoz commented 1 year ago

+1