Platinum demo client and server

This is the reference documentation for the Platinum project server code. Also holds some demo clients.

This page was generated automatically using Gitlab CI on (see bottom right of this page, Doxygen footer).
Latest (local) commit date: Tue Sep 24 16:41:09 2019 +0200

Please check "Related Pages" in menu bar above for the other pages.

Recent updates

1 - Content

This source tree holds several programs in folder src/, and some additional testing stuff located in folder src_test/ (see files).

For each of theses apps, you can provide a configuration file holding some run-time parameters (IP adress of server, port number, ...). See provided .ini files and page Data storage and configuration.

2 - Usage for the Platinum project.

The latest version of the server is currently installed on the server, and can be launched from any user shell.

$ plati-server my_config.ini

You need to provide the configuration file. If no configuration file is given, it will use the default file located /etc/platinum/config_server.ini that will use dummy data.

3 - Code architecture

The server implements a specific protocol, described on page Communication protocol. It is modeled by a Finite State Machine (FSM), whose components are in namespace fsmn and by some network code, with most of it in namespace prot.

The FSM part of the code is based on an external library: Spaghetti (see Download and build instruction). The different states are listed in fsmn::En_ServerStatus and the events in fsmn::En_Events. Configuration of the FSM is done in PlatiServer_TCP::configureFSM(). Each FSM state is assigned to a callback function, that will be called automatically at the moment the FSM switches to that state.

For the network part, the code uses boost::asio, the generic class TcpServerAsync wraps this, and a dedicated class PlatiServer_TCP inherits from it. This latter class embeds the FSM, and provides an implementation (PlatiServer_TCP::getResponseData()) of the virtual member function TcpServerAsync::getResponseData().

That function is called upon each reception of a network frame, and its task is to fill the Tx Buffer with the response data. This is done by analysing the received network data frame (see basic header format here: 2 - Common Header). From that header, we extract the prot::En_MessageType and the prot::En_DataType, and make sure the combination is allowed. Then, the associated message Id is transformed into an FSM event, through the global map g_event_map. The event is then processed by the FSM, that may or may not switch to another state. If so, then the associated callback function is triggered, that will fill the Tx Buffer with the required answer data frame, and send it.

Graph Handling

At startup, the server will attempt to load the file holding the graph description (full path is given in configuration file), and will abort if unable. This file must be build separately, using the separate program src/make_graph.cpp, from two files holding:

From 2019-08-29, the branch 3dim_sphere_coord implements code dealing with a sphere coordinate file holding the 3 values X,Y,Z. Should be merged in master pretty much soon... => DONE !

Once the graph is loaded in the wrapper class PlatinumData_graph, each navigation request will produce a path from source sphere to destination spheres, using the Dijkstra algorithm. This is done through function findShortedPath(), using the wrapper class Dijkstra_Data.

For all the graphs requirements (storage and algorithms), the Boost Graph library is used (see Download and build instruction).


At each startup, a timestamped log file is created, and every navigation transaction is logged, independently of its outcome. All the relevant information on the transaction is logged (start and end time, nb of spheres, type of request, outcome, ...) This can be expanded on request.

The logfile name is:


See CurrentTransaction, En_NavOutcome, CurrentTransaction::initLogging()

It is also possible to log all the stdout output generated by the server by starting the server with:

$ plati-server my_config.ini 1>stdout.log