This commit is contained in:
Lucas Pleß 2012-06-22 01:30:18 +02:00
parent 2a40f0971e
commit e95ea0359f
1 changed files with 0 additions and 30 deletions

View File

@ -11,11 +11,9 @@ import java.io.*;
import java.net.DatagramPacket; import java.net.DatagramPacket;
import java.net.DatagramSocket; import java.net.DatagramSocket;
import java.net.InetAddress; import java.net.InetAddress;
import java.net.Socket;
public class BuntiClient implements IBuntiClient { public class BuntiClient implements IBuntiClient {
private final String baseAddress; private final String baseAddress;
//private final HttpClient client = new DefaultHttpClient();
public BuntiClient(String server, int port) { public BuntiClient(String server, int port) {
baseAddress = "http://" + server + ":" + port + "/"; baseAddress = "http://" + server + ":" + port + "/";
@ -24,8 +22,6 @@ public class BuntiClient implements IBuntiClient {
@Override @Override
public void setPar56(final int red, final int green, final int blue) { public void setPar56(final int red, final int green, final int blue) {
System.out.println("BuntiClient: setPar56 " + red + "," + green + "," + blue);
Runnable r = new Runnable() { Runnable r = new Runnable() {
@Override @Override
public void run() { public void run() {
@ -75,8 +71,6 @@ public class BuntiClient implements IBuntiClient {
@Override @Override
public void setPar56(final int par, final int red, final int green, final int blue) { public void setPar56(final int par, final int red, final int green, final int blue) {
System.out.println("BuntiClient: setPar56 par=" + par + " " + red + "," + green + "," + blue);
Runnable r = new Runnable() { Runnable r = new Runnable() {
@Override @Override
public void run() { public void run() {
@ -147,30 +141,6 @@ public class BuntiClient implements IBuntiClient {
new Thread(r).start(); new Thread(r).start();
/* try {
HttpPost post = new HttpPost(baseAddress + "/control/devices");
post.addHeader("Content-Type", "application/json");
StringEntity entity = new StringEntity(
"{ \"timeStamp\": 0, \"updates\": [ {\"deviceId\": 4, \"options\": { \"red\": "+
red+", \"green\": "+green+", \"yellow\": "+yellow+" } } ] }" ,
"UTF-8");
post.setEntity(entity);
HttpResponse response = client.execute(post);
System.out.println(response);
post.abort();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}*/
} }
} }