QGC : How to get a value from C++ to QML

Before my Drone take off, in QGC, I need to check Base Station status is on or off. I need to write a TCP checking function with a timer to trigger the TCP checking, and pass the result to QML namely MainToolBar.qml.
So my question are:
1.) If I were to put a timer to do TCP function, where should I put the timer and function? 2.) once the function return the value(on or off), how to pass to MainToolBar.qml?

I have been struggle with this for months, sincerely hope someone can help or give me some hints, thanks so much.