-
Notifications
You must be signed in to change notification settings - Fork 0
Communication Management System
The Communication Management System offers a complex network control to allow seperation of data that passes through a single port. The communication is splited into mini-networks of 2 Sendable objects that communicate with each other. Each Sendable object is seperate and can send or receive data seperatly from other Sendables. The communication is done between 2 Sendable objects - one on each side. When a Sendable object is added to the Manager, data about it is sent to the other side. If a correspanding Sendable object exists, communication between the 2 is initiated on the same port. Otherwise, a new Sendable object is created according to the user parameters, if possible, and starts communication with the given object. To allow maximum flexability, the Manager can send and receive data in any wanted way through the use of CommInterfaces.
The Communication Management System manages communication between two different sides. Each side has an equal number of Sendable objects any of which sends and receives data individually:
When a Sendable is created, it is assigned an ID. When connection is established with a remote side, data about each Sendable is sent. If a Sendable with the same ID exists the 2 object begin communication, if not an attempt is done to create a Sendable for communication according to the data of the remote Sendable.
Creation of Sendable objects is done using a SendableCreator object, SendableCreators receive data about a Sendable, specifically a byte indicating a type, and create an object to communicate with that Sendable. Creation of objects by type has to be implemented by users.
In order to allow flexibility with the system, the actual sending and receiving of data is seperated from the management system and is done using a CommInterface. CommInterfaces serve as communication sockets. They are responsible for sending data to the other side, and receiving data from it in any way the want. A CommInterface can use TCP or UDP sockets, Serial ports, UART buses or any other possible way to transfer data.
There are several pre-made CommInterfaces in FlashLib, but it might be necessary to create a custom interface sometimes.