Martin-Laclaustra/CronAlarms

Hand over arguments to the callback function

Opened this issue · 2 comments

In #9, someone asked how to specify arguments to the called function.

Another question: is there a way to overgive arguments to the called function?

Martin-Laclaustra commented on Dec 31, 2020
You could create member variables in your class that can be accessed from the called function.
Changing the called function signature would require changes to the library code.

Can you please give an example how to do that?

+1

I do not understand the question. If you create a class and pass the pointer of your class function to cronalarms, such function could access any member variable of your class.