I am stating to play around with socket.io and I was wondering If anyone had a really simple example of how to get info (llh, fix) from the reach. Having a bit of trouble picking it up from the source code.
I would like to host a web page on the Reach like reachview but displaying coordinates only. Can I just get the coordinates over TCP?
It creates the socket.io object and initiates connection to the socket.io server. After that, it registers two handlers, one for the disconnect, which shows a warning you can see in the newer versions of ReachView, another one for connect two take the warning away after reconnecting.
And here, in the same file, you can find a handler, which reads the status:
socket.on("coordinate broadcast", function(msg) {
// check if the browser tab and app tab are active
if ((active_tab == "Status") && (isActive == true)) {
console.groupCollapsed('Coordinate msg received:');
for (var k in msg)
console.log(k + ':' + msg[k]);
console.groupEnd();
updateCoordinateGrid(msg);
}
});
Don’t hesitate to ask, if you have any more questions!