|
|
|
|
|
|
|
|
import android.annotation.SuppressLint; |
|
|
import android.annotation.SuppressLint; |
|
|
import android.util.Log; |
|
|
import android.util.Log; |
|
|
|
|
|
|
|
|
|
|
|
import com.example.ueberwachungssystem.WifiCommunication; |
|
|
|
|
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
import java.text.SimpleDateFormat; |
|
|
import java.util.Calendar; |
|
|
import java.util.Calendar; |
|
|
import java.util.Date; |
|
|
import java.util.Date; |
|
|
|
|
|
|
|
|
return String.join("\t", state, time, type, value); |
|
|
return String.join("\t", state, time, type, value); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String toMessage() { |
|
|
|
|
|
String state; |
|
|
|
|
|
if(detectionState) |
|
|
|
|
|
state = "An"; |
|
|
|
|
|
else |
|
|
|
|
|
state = "Aus"; |
|
|
|
|
|
|
|
|
|
|
|
return String.join(",", "1", timeStamp, "Gruppe2", WifiCommunication.getLocalIpAddress(), state, detectionType, String.valueOf(detectedValue)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** Debug Report */ |
|
|
/** Debug Report */ |
|
|
public void log(String tag) { |
|
|
public void log(String tag) { |
|
|
Log.d(tag, this.toString()); |
|
|
Log.d(tag, this.toString()); |