Class Structure

src/Main.cpp

This is the entry point of the application. It just calls two functions in FruityMesh.cpp. The first one boots up the node and the second one runs an endless loop to fetch and process events.

src/FruityMesh.cpp

During bootup, classes such as the SoftDevice, Terminal, Logger, Storage, and others are initialized. After everything has been started, the event handling routine takes over. All event dispatching routines, as well as interrupt and error handlers are implemented here.

src/base/

The base folder contains a few classes that are meant as wrappers for the S130 API. The most central one is the FruityHal, which wraps all nRF functionality (not yet complete).

src/mesh/Node.cpp

The Node class is responsible for building mesh connections and works hand in hand with the MeshConnection and ConnectionManager classes to accomplish these tasks.

src/mesh/ConnectionManager.cpp

The ConnectionManager is responsible for handling and scheduling all BLE connections. It is the central point to handle connects, disconnects and reestablishing connections.

src/mesh/MeshConnection.cpp

All connections between nodes are using the MeshConnection class. This, together with the ConnectionManager and the Node handles clustering and meshing in general.

src/mesh/

Other classes, all derived from BaseConnection are also in this folder and they enable e.g. smart phones to connect to the mesh and send and receive data. The most important one is the MeshAccessConnection, which implements a custom encryption protocol for communicating with external devices independent of their operating system.

src/modules/

This folder contains a number of modules that provide specific functionality apart from the meshing protocol. To implement a new module, use a template in the fruitymesh/src_examples/ folder to get started and have a look at the StatusReporterModule to get an idea of how to implement additional functionality.

If you want to learn more about modules, either read the Modules chapter or have at look at this tutorial about Implementing a Custom Module.

src/utility/

A basic circular queue implementation, a file system, utility classes, implementation of the terminal, logger, etc.