I've just registered a project with Sourceforge now called GloPosCom. This blog will be the place I submit information regarding the project.
The project shall provide an API for communicating global positioning coordinates from a portable device/laptop to one or more XMPP-clients. The API reside on the portable device/laptop and communicate with one or several XMPP-clients through a XMPP-gateway. The API in itself is a XMPP-client. The XMPP-clients can send commands that are handled by the API.
So far I've only created an "engine" that is IO-multiplexed (I don't want to deal with the various ways multithreading is done on the various platforms) and a simple API to interact with the engine.
The engine currently connects to GTalk via the iksemel library and reads GPS-coordinates via the nmeap library . A small test-program I've written allows you to send commands from a GTalk client to the engine and the engine replies with the current position.
Since GTalk requires TLS and I could not find GnuTLS for all the platforms I want the API/engine to run on I had to alter iksemel some. It now uses OpenSSL instead of GnuTLS.
Here is the test program (just to illustrate the API):
int main(int argc, char* argv)
logger = BIO_new_fd(0, BIO_NOCLOSE);
engine = engine_new();
engine_set_logger(engine, ENGINE_XMPP, logger);
engine_set_logger(engine, ENGINE_GPS, logger);
engine_set_xmpp_account(engine, "firstname.lastname@example.org", "password");
The engine_run function do "polling" and can be extended to include other tasks the application shall perform:
The engine_run function look like this:
So far I've not added much error-handling or any retry mechanisms if the GPS-
Bluetooth link go down or if the network connection is terminated.