Hello, i am using this library, and i am having to re-write the call backs to support std::function on the ESP devices.
In my project, i have created a HASSMQTT class for handling all of my HAMqtt logic. Normally, i would use a lambda or std::bind to a callback which has a std::function based type.
I would really like this functionality - but i can't in the default library as you only except function pointers, and not method pointers (on supported boards).
Now, of course the std::function is available for all 32bit boards, so adding support for all 32bit boards using a single preprocessor macro is preferred.
Hello, i am using this library, and i am having to re-write the call backs to support
std::function
on the ESP devices.In my project, i have created a
HASSMQTT
class for handling all of my HAMqtt logic. Normally, i would use a lambda orstd::bind
to a callback which has astd::function
based type.I would really like this functionality - but i can't in the default library as you only except function pointers, and not method pointers (on supported boards).
I would recommend doing something like:
Now, of course the
std::function
is available for all 32bit boards, so adding support for all 32bit boards using a single preprocessor macro is preferred.