- UwbTagBleActivity: BLE scan filtered to 'UWB_TAG_XXXX' device names - Connects to GATT service 12345678-1234-5678-1234-56789abcdef0 - Read/write JSON config char: sleep_timeout_s, display_brightness, tag_name, uwb_channel, ranging_interval_ms, battery_report - Subscribes to status + battery notification characteristics - Material Design UI with scan list, config form, and live status - Runtime BLE permission handling for API 26+ / API 31+ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
61 lines
2.2 KiB
XML
61 lines
2.2 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<com.google.android.material.card.MaterialCardView
|
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:layout_margin="4dp"
|
|
app:cardElevation="2dp"
|
|
android:clickable="true"
|
|
android:focusable="true">
|
|
|
|
<LinearLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:orientation="horizontal"
|
|
android:padding="12dp"
|
|
android:gravity="center_vertical">
|
|
|
|
<LinearLayout
|
|
android:layout_width="0dp"
|
|
android:layout_height="wrap_content"
|
|
android:layout_weight="1"
|
|
android:orientation="vertical">
|
|
|
|
<TextView
|
|
android:id="@+id/tvDeviceName"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:text="UWB_TAG_XXXX"
|
|
android:textAppearance="@style/TextAppearance.MaterialComponents.Subtitle2"
|
|
android:textStyle="bold" />
|
|
|
|
<TextView
|
|
android:id="@+id/tvDeviceAddress"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:text="XX:XX:XX:XX:XX:XX"
|
|
android:textAppearance="@style/TextAppearance.MaterialComponents.Caption" />
|
|
|
|
</LinearLayout>
|
|
|
|
<TextView
|
|
android:id="@+id/tvRssi"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:text="-70 dBm"
|
|
android:textAppearance="@style/TextAppearance.MaterialComponents.Caption"
|
|
android:textColor="?attr/colorSecondary" />
|
|
|
|
<Button
|
|
android:id="@+id/btnConnect"
|
|
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginStart="8dp"
|
|
android:text="Connect" />
|
|
|
|
</LinearLayout>
|
|
|
|
</com.google.android.material.card.MaterialCardView>
|