0 votes
1.7k 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 8 views
asked Sep 19 in Arduino by Samurai
0 votes
1 answer 16 views
0 votes
1 answer 16 views
+1 vote
2 answers 6.3k views
+2 votes
1 answer 8.7k views
asked Mar 15, 2017 in Arduino by Manoj
+1 vote
1 answer 446 views
...