I have a device on the internet. It has a MAC address. I would like to communicate with this device. The device accepts short commands, and returns data.
I would like to communicate with this device from a web browser. I can write HTML or PHP, or even CGI if necessary.
Problem is XmlHttpRequest doesn't allow cross domain access, and this device knows nothing about JSONP.
I do have a C++ program which can communicate with the device over the internet. It runs as a web server, and does a lot of low level socket I/O. It accepts user browsers connecting to it, via a certain port number, and it connects to the device, and it shuffles the data back and forth between the device and the user, formatting the data into HTML, sending the formatted HTML to the user's web browser.
Question: If I write a website in PHP, is there some way I can jump from PHP code into this C++ code?
Or, is there a way I can do this the other way around: run PHP code from within the C++ program? Right now the C++ program knows nothing about PHP or what to do with such files. We do have Apache installed. Not sure how to send it a PHP file for processing from a C++ program.