0 votes
3.5k views
in Arduino by
Here is my code

data_retry_timer = myArduino.arduino_timer.setInterval(PIN_DATA_SEND_RETRY_INTERVAL*1500, myArduino.arduino_try_any_pending_server_updates);

which calls a function from my class. But this throws the error

error: invalid use of non-static member function 'void MyArduino::arduino_try_any_pending_server_updates()'

Can anyone solve this for me as I have no idea on what is wrong.

thanks!

1 Answer

0 votes
by
Ok, so you are trying to call a callback function which should indeed work like this. Wrap that class function to another function like this.

data_retry_timer = myArduino.arduino_timer.setInterval(PIN_DATA_SEND_RETRY_INTERVAL*1500, arduino_try_any_pending_server_updates);

void arduino_try_any_pending_server_updates()
{
  myArduino.arduino_try_any_pending_server_updates();
}

This should work, I have not tested though.

Related questions

0 votes
1 answer 1.0k views
asked Sep 19, 2021 in Arduino by Samurai
0 votes
1 answer 1.3k views
0 votes
1 answer 864 views
asked Sep 12, 2021 in Arduino by mithun (1.3k points)
+1 vote
2 answers 8.2k views
+2 votes
1 answer 9.8k views
asked Mar 15, 2017 in Arduino by Manoj
+1 vote
1 answer 1.4k views
...