|
@@ -0,0 +1,184 @@
|
|
|
+<?xml version="1.0" encoding="utf-8"?>
|
|
|
+
|
|
|
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
|
+ xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
|
+ xmlns:tools="http://schemas.android.com/tools"
|
|
|
+ android:layout_width="match_parent"
|
|
|
+ android:layout_height="match_parent"
|
|
|
+ android:orientation="vertical">
|
|
|
+
|
|
|
+ <LinearLayout
|
|
|
+ android:layout_width="wrap_content"
|
|
|
+ android:layout_height="match_parent"
|
|
|
+ android:layout_gravity="center_horizontal"
|
|
|
+ android:orientation="vertical">
|
|
|
+
|
|
|
+ <TextView
|
|
|
+ android:layout_width="wrap_content"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:layout_gravity="center_horizontal"
|
|
|
+ android:layout_marginTop="@dimen/dp_15"
|
|
|
+ android:text="串口通信测试"
|
|
|
+ android:textColor="@color/orange"
|
|
|
+ android:textSize="28sp" />
|
|
|
+
|
|
|
+ <LinearLayout
|
|
|
+ android:layout_width="wrap_content"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:layout_gravity="center_vertical"
|
|
|
+ android:layout_marginTop="@dimen/dp_15"
|
|
|
+ android:orientation="horizontal">
|
|
|
+
|
|
|
+ <TextView
|
|
|
+ android:layout_width="wrap_content"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:text="指令类型"
|
|
|
+ android:textColor="@color/orange"
|
|
|
+ android:textSize="18sp" />
|
|
|
+
|
|
|
+ <RadioGroup
|
|
|
+ android:id="@+id/rg_type"
|
|
|
+ android:layout_width="wrap_content"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:orientation="horizontal">
|
|
|
+
|
|
|
+ <RadioButton
|
|
|
+ android:id="@+id/rb_type_read"
|
|
|
+ android:layout_width="wrap_content"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:checked="true"
|
|
|
+ android:text="读" />
|
|
|
+
|
|
|
+ <RadioButton
|
|
|
+ android:id="@+id/rb_type_write"
|
|
|
+ android:layout_width="wrap_content"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:text="写" />
|
|
|
+ </RadioGroup>
|
|
|
+
|
|
|
+ </LinearLayout>
|
|
|
+
|
|
|
+ <LinearLayout
|
|
|
+ android:layout_width="wrap_content"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:layout_gravity="center_vertical"
|
|
|
+ android:layout_marginTop="@dimen/dp_15"
|
|
|
+ android:orientation="horizontal">
|
|
|
+
|
|
|
+ <TextView
|
|
|
+ android:layout_width="wrap_content"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:text="读/写地址"
|
|
|
+ android:textColor="@color/orange"
|
|
|
+ android:textSize="18sp" />
|
|
|
+
|
|
|
+ <Spinner
|
|
|
+ android:id="@+id/sp_address_area"
|
|
|
+ android:layout_width="@dimen/dp_10"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:layout_marginStart="@dimen/dp_10"
|
|
|
+ android:layout_marginLeft="@dimen/dp_10"
|
|
|
+ android:outlineAmbientShadowColor="@color/orange"
|
|
|
+ android:outlineSpotShadowColor="@color/orange"
|
|
|
+ android:shadowColor="@color/orange"
|
|
|
+ tools:ignore="RtlCompat"></Spinner>
|
|
|
+
|
|
|
+ <EditText
|
|
|
+ android:id="@+id/et_command"
|
|
|
+ android:layout_width="@dimen/dp_10"
|
|
|
+ android:layout_height="@dimen/dp_10"
|
|
|
+ android:layout_marginStart="@dimen/dp_10"
|
|
|
+ android:digits="0123456789"
|
|
|
+ android:maxLines="1"
|
|
|
+ android:padding="@dimen/dp_10"
|
|
|
+ android:textColor="@color/orange"
|
|
|
+ android:textSize="16sp"
|
|
|
+ android:layout_marginLeft="@dimen/dp_10" />
|
|
|
+
|
|
|
+ </LinearLayout>
|
|
|
+
|
|
|
+ <LinearLayout
|
|
|
+ android:id="@+id/ll_read_length"
|
|
|
+ android:layout_width="wrap_content"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:layout_gravity="center_vertical"
|
|
|
+ android:layout_marginTop="@dimen/dp_10"
|
|
|
+ android:orientation="horizontal">
|
|
|
+
|
|
|
+ <TextView
|
|
|
+ android:layout_width="wrap_content"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:text="读取数据长度(字节)"
|
|
|
+ android:textColor="@color/orange"
|
|
|
+ android:textSize="18sp" />
|
|
|
+
|
|
|
+ <Spinner
|
|
|
+ android:id="@+id/sp_data_length"
|
|
|
+ android:layout_width="@dimen/dp_10"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:layout_marginStart="@dimen/dp_10"
|
|
|
+ android:layout_marginLeft="@dimen/dp_10"></Spinner>
|
|
|
+
|
|
|
+ </LinearLayout>
|
|
|
+
|
|
|
+
|
|
|
+ <LinearLayout
|
|
|
+ android:id="@+id/ll_write_data"
|
|
|
+ android:layout_width="wrap_content"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:layout_gravity="center_vertical"
|
|
|
+ android:layout_marginTop="@dimen/dp_10"
|
|
|
+ android:orientation="horizontal"
|
|
|
+ android:visibility="gone">
|
|
|
+
|
|
|
+ <TextView
|
|
|
+ android:layout_width="wrap_content"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:text="写入数据(16进制)"
|
|
|
+ android:textColor="@color/orange"
|
|
|
+ android:textSize="18sp" />
|
|
|
+
|
|
|
+ <EditText
|
|
|
+ android:id="@+id/et_data"
|
|
|
+ android:layout_width="@dimen/dp_10"
|
|
|
+ android:layout_height="@dimen/dp_10"
|
|
|
+ android:layout_marginStart="@dimen/dp_10"
|
|
|
+ android:digits="0123456789ABCDEFabcdef"
|
|
|
+ android:hint="16进制,例如:08C3"
|
|
|
+ android:maxLines="1"
|
|
|
+ android:padding="@dimen/dp_10"
|
|
|
+ android:textColor="@color/orange"
|
|
|
+ android:textSize="16sp"
|
|
|
+ android:layout_marginLeft="@dimen/dp_10" />
|
|
|
+
|
|
|
+ </LinearLayout>
|
|
|
+
|
|
|
+ <LinearLayout
|
|
|
+ android:layout_width="wrap_content"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:layout_gravity="center_horizontal"
|
|
|
+ android:layout_marginTop="@dimen/dp_10"
|
|
|
+ android:orientation="horizontal">
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <Button
|
|
|
+ android:id="@+id/btn_set"
|
|
|
+ android:layout_width="wrap_content"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:text="置位"
|
|
|
+ android:textColor="@color/orange" />
|
|
|
+
|
|
|
+
|
|
|
+ <Button
|
|
|
+ android:id="@+id/btn_rst"
|
|
|
+ android:layout_width="wrap_content"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:text="复位"
|
|
|
+ android:textColor="@color/orange" />
|
|
|
+
|
|
|
+ </LinearLayout>
|
|
|
+ </LinearLayout>
|
|
|
+
|
|
|
+
|
|
|
+</LinearLayout>
|