Skip to content

Commit

Permalink
proper name for the id
Browse files Browse the repository at this point in the history
  • Loading branch information
XenGi committed May 4, 2017
1 parent 861bec7 commit 01e74ff
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

public class MainActivity extends ActionBarActivity {
private DatagramSocket client_socket;
private String uid;
private String uuid;
private InetAddress ipaddress = null;
private int port = 1338;

Expand All @@ -42,8 +42,8 @@ public void run() {
final String modifiedSentence = new String(receivePacket.getData(), 0, receivePacket.getLength());

Log.i("PyMLGCtlr", "Receiver" + modifiedSentence);
if(modifiedSentence.startsWith("/uid/")) {
uid = modifiedSentence.substring(5);
if(modifiedSentence.startsWith("/uuid/")) {
uuid = modifiedSentence.substring(5);
new Thread(new Sender()).start();
}
} catch(IOException e) {
Expand All @@ -58,7 +58,7 @@ class Sender implements Runnable {
public void run() {
while(true) {
try {
String cmd = "/controller/" + uid + "/states/" + buttonStates;
String cmd = "/controller/" + uuid + "/states/" + buttonStates;
byte[] send_data = cmd.getBytes(Charset.forName("UTF-8"));
DatagramPacket send_packet = new DatagramPacket(send_data, cmd.length(), ipaddress, 1338);
client_socket.send(send_packet);
Expand Down

0 comments on commit 01e74ff

Please sign in to comment.