Skip to content

Commit

Permalink
Did some basic design of the networking package, and created a DOCUME…
Browse files Browse the repository at this point in the history
…NTATION.md file.
  • Loading branch information
pid1 committed Feb 7, 2015
1 parent ad7174d commit 21eb26a
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 2 deletions.
19 changes: 19 additions & 0 deletions DOCUMENTATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Thermocontroller
================
An interactive client/server setup for environmental control.
##Creators
Aimee Dipietro, Jonathan Huang, David Paquette, Jonathan Roemer
##Summary
Thermocontroller is an interactive server/client setup for environmental control. The user sends a command to the command and control server, which forwards that command to the client device. Both the client and server software is built to be deployed on a Raspberry Pi running GNU/Linux, with the client using the GPIO pins to interact with external devices.
##Main Package
The methods in Main prompt the user for which mode they want to run the program in.
##Server Package
The server package is the core of Thermocontroller, as it handles all user authentication, configuration storage, and communication with the thermostat devices.
##UI Package
The UI package provides a graphical frontend for the server capabilities.
##Thermostat
The thermostat package deals with received commands from the server, and directly interfaces with devices through the GPIO pins.
##Networking
The networking package is shared between both the server and the thermostat packages. It handles all network communication, and forwards commands.
##Testing
The testing packages contains our various JUnit test files, which were used for validation throughout the development process.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ An interactive client/server setup for environmental control.
##Creators
Aimee Dipietro, Jonathan Huang, David Paquette, Jonathan Roemer
##Summary
Thermocontroller is an interactive server/client setup for environmental control. The user sends a command to the command and control server, which forwards that command to the client device. Both the client and server software is built to be deployed on a Raspberry Pi running GNU/Linux, with the client using the GPIO pins to interact with external devices.
Thermocontroller is an interactive server/client setup for environmental control. The user sends a command to the command and control server, which forwards that command to the client device. Both the client and server software is built to be deployed on a Raspberry Pi running GNU/Linux, with the client using the GPIO pins to interact with external devices. Extensive documenation is provided in the DOCUMENATION.md file.
##License
Thermocontroller is licensed under the GPLv3.

Expand Down
Binary file modified bin/networking/Network.class
Binary file not shown.
30 changes: 29 additions & 1 deletion src/networking/Network.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
package networking;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.ServerSocket;
import java.net.Socket;

public class Network {
// Listen on port 7777
private static final int PORT = 7777;

public static void serverCurrentTemperatureListener() throws Exception {
ServerSocket listener = new ServerSocket(PORT);
try {
while (true) {
Socket socket = listener.accept();
try {
BufferedReader input =
new BufferedReader(new InputStreamReader(socket.getInputStream()));
String currentTemperature = input.readLine();
System.out.printf("The current temperature is:", currentTemperature);
} finally {
socket.close();
}
}
}
finally {
listener.close();
}
}


}
}

0 comments on commit 21eb26a

Please sign in to comment.