Monday, March 19, 2007

Iksemel-patch and GloPosCom engine comitted to Subversion

A patch for iksemel to enable GTalk communication with OpenSSL is checked in. So is also a working version of the gloposcom engine.

Record and playback tools comitted to Subversion

I've created a tool( now that records GPS-sentences and the delta time between two sentences. Another tool( plays back the GPS-sentences with the same delta time delay between sentences. The timing during playback is not 100% accurate since the OS both at recording and playback is not 100% accurate and I've not taken into consideration that transfer of a sentence from a GPS-unit to a host take time (varies by baudrate). The playback is done with FIFO and only tested on MacOSX. The recording is only tested on WinXPSP2.

Saturday, March 10, 2007

Registered project GloPosCom with Sourceforge


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):

#include "engine.h"
#include "openssl.h"

int main(int argc, char* argv[])

engine_t* engine;
BIO* logger;

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_server(engine, "");
engine_set_xmpp_account(engine, "", "password");

engine_set_gps_device(engine, "/dev/tty.gps");



return 0;


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.