|
|
|
The communication server is a piece of open source software written in Java that controls the communication between different serial ports. This means that we can retrieve data between wiring boards both wire- and wirelessly if the serial ports they use are registered in the program The way of registering boards in the program is through adding them to the config.xml file. This file contains all the information needed to make the program work. We wanted to keep the communication mechanisms as simple as possible so that it is possible for not too experienced Java programmers to hack into the code and reuse it. The server receives information from any of the registered serial ports and broadcasts it back to all the connections <?xml version="1.0" ?>
<config>
<ServerIP>127.0.0.1</ServerIP>
<Control_Port>5050</Control_Port>
<UserName>Mojo</UserName>
<Serial_Port direction="2">COM1</Serial_Port>
<Serial_Port direction="s">COM12</Serial_Port>
<Debug_Level>INFO</Debug_Level>
</config>
Figure 1: form of the config.xml file The needs for running the communication server in a computer are to have java and the support for serial port installed in it. The code detects the XML formatted configuration file and reads the following parameters: - SeverIP: this is the IP number where the Socket will be opened for connections for program like Flash will be open. We have included with the deliverable for this project a code example in Java, to get the chance of using physical computing pieces connected directly to Flash, not one but many (up to 30 with this version of the communication server) - Control_Port: port in the Socket where the program will be waiting for incoming communication requests - UserName: this is not really needed for this version of the server, in the future we expect to make the servers able of retrieven information from other servers, then the user's name will be useful for identification purposes - Serial Port: the program allows the configuration of serial ports as inputs (r), outputs (s), or bidirectional (2) with the attribute "direction" - Debug_Level: this is the amount of information to log. The communication server counts with a logging systems that stores data depending on the configuration. Two typical levels of monitoring are: INFO - everything will be stored -, and SEVERE - only the unthrowable exceptions and error will be logged - This program has been tried in PC with no problem, the way of calling it is through a batch file that calls the right class, looks into the configuration files, open the ports and starts to resend to all its outputs anything that comes in |