Browse Source

merge Kommunikation Version 1.3 UDP Socket

Kommunikation
Miguel Siebenhaar 1 year ago
parent
commit
0782bbdd04

+ 0
- 6
app/src/main/java/com/example/ueberwachungssystem/WifiCommunication.java View File

@@ -49,20 +49,14 @@ public class WifiCommunication {
try {
do {
byte[] receiveData = new byte[512];
InetAddress fromAdress;
int fromPort;
DatagramPacket rxPacket = new DatagramPacket(receiveData, receiveData.length);
socket.receive(rxPacket);
fromAdress = rxPacket.getAddress();
fromPort = rxPacket.getPort();
rxString = new String(rxPacket.getData());
if(!previousRxString.equals(rxString)) {
rxStringBuffer.append(rxString).append("\n");
mainActivity.runOnUiThread(() -> mainActivity.tvMessages.setText(rxStringBuffer));
previousRxString = rxString;
}


} while (running);
}
catch (IOException e) {

Loading…
Cancel
Save