added debugging buttons
This commit is contained in:
@@ -197,7 +197,8 @@ class BLEController(ctx: Context) : BLEControllerListener{
|
||||
// "94:B9:7E:C0:53:FE") debugger
|
||||
// "30:83:98:00:89:86" KTM
|
||||
return null != (device!!.address.startsWith("94:B9:7E:C0:53:FE")
|
||||
or device!!.address.startsWith("30:83:98:00:89:86"))
|
||||
or device!!.address.startsWith("30:83:98:00:89:86")
|
||||
or device!!.address.startsWith("EC:DA:3B:BF:E2:A2"))
|
||||
|
||||
}
|
||||
private fun deviceFound(device: BluetoothDevice) {
|
||||
|
||||
@@ -17,12 +17,12 @@ class MainActivity : AppCompatActivity() {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_main)
|
||||
|
||||
var location = Location("52.3759", "9.7320")
|
||||
var calculator = SunriseSunsetCalculator(location, "GMT+0200")
|
||||
|
||||
var sunrise = calculator.getOfficialSunsetForDate(Calendar.getInstance())
|
||||
|
||||
Log.d("Debug", sunrise)
|
||||
// var location = Location("52.3759", "9.7320")
|
||||
// var calculator = SunriseSunsetCalculator(location, "GMT+0200")
|
||||
//
|
||||
// var sunrise = calculator.getOfficialSunsetForDate(Calendar.getInstance())
|
||||
//
|
||||
// Log.d("Debug", sunrise)
|
||||
|
||||
|
||||
findViewById<Button>(R.id.btnStop)
|
||||
@@ -42,10 +42,35 @@ class MainActivity : AppCompatActivity() {
|
||||
findViewById<Button>(R.id.btnOTA)
|
||||
.setOnClickListener{
|
||||
val intent = Intent(this, BLEConnectionService::class.java)
|
||||
.setAction("OTA")
|
||||
.setAction("OTA")
|
||||
startService(intent)
|
||||
|
||||
}
|
||||
findViewById<Button>(R.id.btn_1km)
|
||||
.setOnClickListener{
|
||||
val intent = Intent(this, BLEConnectionService::class.java)
|
||||
.setAction("X")
|
||||
startService(intent)
|
||||
}
|
||||
findViewById<Button>(R.id.btn_500m)
|
||||
.setOnClickListener{
|
||||
val intent = Intent(this, BLEConnectionService::class.java)
|
||||
.setAction("XX")
|
||||
startService(intent)
|
||||
}
|
||||
findViewById<Button>(R.id.btn_300m)
|
||||
.setOnClickListener{
|
||||
val intent = Intent(this, BLEConnectionService::class.java)
|
||||
.setAction("XXX")
|
||||
startService(intent)
|
||||
}
|
||||
findViewById<Button>(R.id.btn_150m)
|
||||
.setOnClickListener{
|
||||
val intent = Intent(this, BLEConnectionService::class.java)
|
||||
.setAction("XXXX")
|
||||
startService(intent)
|
||||
}
|
||||
|
||||
startForegroundService(
|
||||
Intent(this, BLEConnectionService::class.java)
|
||||
.setAction("STARTService")
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
tools:context=".MainActivity">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="400dp"
|
||||
android:layout_height="257dp"
|
||||
android:layout_width="403dp"
|
||||
android:layout_height="587dp"
|
||||
android:orientation="vertical"
|
||||
tools:layout_editor_absoluteX="1dp"
|
||||
tools:layout_editor_absoluteY="1dp">
|
||||
@@ -30,6 +30,30 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="OTA Update" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_1km"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="1km" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_500m"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="500m" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_300m"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="300m" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_150m"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="150m" />
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Reference in New Issue
Block a user