I am currently using two XBees, one of them attached to my computer, and the other on a homemade UAV. The Xbee on the plane is constantly sending data about about the plane, and I want to get that data using my C++ interface – a Form (I believe they’re also called WinForms?). My form has a webBrowser in it that has Google Earth embedded, and I want to update the plane’s location on the GE map. I know how to get the data from the XBee, but I just don’t know how to get the code that gathers the data to execute constantly without input.
This project was someone else’s who dropped it. I “inherited” this code, and it’s a bit confusing to me due to lack of comments.
You can change your message pump to use
PeekMessage()instead of the usualGetMessage(). This will allow you to process messages if any are available or do something else while the message loop is idle.When using the Win32 API, it looks something like:
For .NET based applications, you might want to take a look at the
Application.Idleevent.