Connections

There are a number of different connection types each used for a different purpose.

BaseConnection

A base connection is the base class of all different connections. It provides some general concepts such as a PacketQueue for sending and methods and some methods for splitting/reassembling messages according to the connection MTU.

Connection States

enum class ConnectionState{
	DISCONNECTED=0,
	CONNECTING=1,
	CONNECTED=2,
	HANDSHAKING=3,
	HANDSHAKE_DONE=4,
	REESTABLISHING = 5,
	REESTABLISHING_HANDSHAKE = 6
};

ResolverConnection

This connection is instantiated as soon as another device connects to our Node (In which case we are the peripherial. Initially we do not know whether the other device is a mesh node, a smartphone or sth. else. The resolver connection will wait until the partner transmits a packet from which it can know the type of connection that needs to be instantiated. This connection is then created with the data already known and the ResolverConnection is deleted.

MeshConnection

MeshConnections are initiated by the Node and are used to connect between two mesh nodes. They store important information for clustering such as the clusterId and clusterSize of their partner. It also implements the handshake that is necessary for two partners so that they can be connected to the same cluster. It works closely together with the Node.

MeshAccessConnection

The MeshAccessConnection is mostly documented in the documentation of the MeshAccessModule.