intro



SourceForge.net Logo

LinPoch's software design


LinPoch is devided in several subsystems, most of them written in Java. LinPoch currently consists of 3 diferent projects:
- LinPoch (Java)
- KDE LinPoch front-end(Java)
- LinPoch kio slave for konqueror (C++)

The hart of the system is LinPoch. This project is a library, that does the actual communication with the Nokia 9210. KDE LinPoch is a small project (in size) that show a systemtray icon in KDE. The last subproject is LinPoch kio slave, this is a plugin that makes it possible to access files from konqueror.
The 2 Java projects are deployed in one application, visable as the systemtray icon. This application keeps the connection open to the Nokia phone. The LinPoch kio slave is a seperate proces that communicates with the systemtray application. The communication between those proceses is done with DCOP, the KDE interprocess protocol. This DCOP functionality is in the KDE LinPoch project, since this has KDE dependencies.
All subprojects have a strict dependency model. LinPoch depends on none of the projects, KDE LinPoch depends on LinPoch, the io slave depends on KDE LinPoch.

LinPoch

LinPoch implements the plp protocol, that is used by the Nokia 9210. The plp protocol defines layers, which are derived from the osi-layers. This was very convenient for the design of LinPoch, because this matches the layer design pattern from the gang of 4:


fig 1 package dependencies of LinPoch

All package (layer in this context), except for the lowest, rs232, depend on exactly one package. Each layer adds functionality to the system.


fig 2 Layers and data abstraction

rs232
At the lowest level rs232 the system handles physical connections and incomming and outcomming bytes. At this level, the system doesn't understand anything about the the meaning of those bytes.Drawn as zeros and ones in figure 2.

link
The link layer doesn't understand physical devices, but it does understand the bytes freom the rs232 layer. This layer knows that the bytes are specific frames, see link layer in figure 2. This layer sends and recieves frames. It can detect frames out of a stream of bytes, by identifying its begin and end. It handles retransmission, crc check (is the frame sane), byte stuffing (escape bytes, when data contains characters that could be seen as control characters). It has destinct states, disconnected, connecting, waiting for data to be acknowlegded, etc. It also checks if the connection is still sane, by keeping track of keep alive messages from the phone. All these responsiblities taken by serveral objects in this package.
This layer in turn doesn't understand the meaning of the data that is packaged in the frames. This layer does garantee that the data will be received by the phone and the data received from the phone is correct. To this layer that packaged data is just an array of bytes.

session
The data that is packages by the link layer is in fact a frame (again). This is a frame the session layer understands. The session layer doens't have to detect the beginning and end of a frame, because the link layer allready did that. Each package of data from the link layer is accactly one frame for the session layer.Figure 2, session layer shows that.The added value of the session layer is to allow more undependend so called channels over one connection. See figure 3 below:


fig 3 session layer as a multiplexer

This layer operates as a sort of multiplexer.Kind a like ports in tcp/ip. This layer also knows that a frame can contain a max number of bytes. It devides (send) and reassembles (receive) frames. An object using a channel doesn't have to worry about max size of frames. Since LinPoch is an OO system, the Channel objects handle this devide an reassembly functionality themsleves. The session objects gather all data from its Channel objects when the link layer has send an event that is ready to send data.

presentation
The presentation layer knows what the data actually means. For example a client that knows how to communicate with the fileserver on the Nokia phone. This client can be used to transfer files to and from the Nokia phone. This client uses a channel from the session layer. This way there can be multiple clients (file client, contacts client, calander client) over one connection.