sandeepmistry / arduino-LoRa

An Arduino library for sending and receiving data using LoRa radios.
MIT License
1.61k stars 621 forks source link

Changed rx and tx callbacks to std::function #569

Open ZacJW opened 2 years ago

ZacJW commented 2 years ago

By using std::function rather than function pointers, users can invoke more complex callback functions such as non-static methods via the use of std::bind.

This is a backwards compatible change as function pointers coerce into std::functions. I've verfied as much by compiling and running an existing project and it works without any modifications.

I have not updated any documentation as it doesn't explicitly say "function pointer" which would now be wrong, just "function" which could mean std::function.