I can make it static.
I have spent quite some time searching and haven't seen any mention of making the funtion static.
I'm quite new to c++ so thanks for your help.
And thanks for all the effort you put into esp88266 and arduino ide development. Really awesome.