Prechádzať zdrojové kódy

A133分机增加串口功能配置

weizhengliang 2 týždňov pred
rodič
commit
f581664ff5

+ 5 - 2
android_bed/src/main/java/com/wdkl/app/ncs/callingbed/activity/CallingbedActivity.kt

@@ -2561,8 +2561,11 @@ class CallingbedActivity :BaseActivity<BedCallingbedActivityPresenter, Callingbe
 
 
             Constant.EVENT_433_START -> {
             Constant.EVENT_433_START -> {
                 //打开433串口
                 //打开433串口
-                SerialPortUtil433.getInstance().openSerialPort()
-//                SerialPortUtil433.getInstance().setOn433DataReceiveListener(this)
+                val s433Path = SettingConfig.get433SerialPort(BaseApplication.appContext)
+                if ("off" != s433Path) {
+                    SerialPortUtil433.getInstance().openSerialPort(s433Path)
+                }
+                //SerialPortUtil433.getInstance().setOn433DataReceiveListener(this)
             }
             }
 
 
             Constant.EVENT_433_STOP -> {
             Constant.EVENT_433_STOP -> {

+ 12 - 1
android_bed/src/main/java/com/wdkl/app/ncs/callingbed/activity/DeviceSystemActivity.kt

@@ -13,7 +13,9 @@ import com.wdkl.app.ncs.callingbed.BuildConfig
 import com.wdkl.app.ncs.callingbed.R
 import com.wdkl.app.ncs.callingbed.R
 import com.wdkl.app.ncs.callingbed.databinding.CallingbedDeviceSysBinding
 import com.wdkl.app.ncs.callingbed.databinding.CallingbedDeviceSysBinding
 import com.wdkl.app.ncs.callingbed.dialog.CallConfigDialogHelper
 import com.wdkl.app.ncs.callingbed.dialog.CallConfigDialogHelper
+import com.wdkl.app.ncs.callingbed.dialog.SerialPortConfigDialogHelper
 import com.wdkl.app.ncs.callingbed.dialog.SystemDialogHelper
 import com.wdkl.app.ncs.callingbed.dialog.SystemDialogHelper
+import com.wdkl.app.ncs.callingbed.dialog.SystemDialogHelper2
 import com.wdkl.app.ncs.callingbed.helper.AppUpdateHelper
 import com.wdkl.app.ncs.callingbed.helper.AppUpdateHelper
 import com.wdkl.app.ncs.callingbed.launch.CallingbedLaunch
 import com.wdkl.app.ncs.callingbed.launch.CallingbedLaunch
 import com.wdkl.app.ncs.callingbed.settings.SettingConfig
 import com.wdkl.app.ncs.callingbed.settings.SettingConfig
@@ -124,6 +126,7 @@ class DeviceSystemActivity : BaseActivity<BedTextActivityPresenter, CallingbedDe
         device_sys_language_settings_tv.setOnClickListener(this)
         device_sys_language_settings_tv.setOnClickListener(this)
         device_sys_system_settings_tv.setOnClickListener(this)
         device_sys_system_settings_tv.setOnClickListener(this)
         device_sys_software_and_information_tv.setOnClickListener(this)
         device_sys_software_and_information_tv.setOnClickListener(this)
+        device_serial_port_settings_tv.setOnClickListener(this)
     }
     }
 
 
     override fun bindEvent() {
     override fun bindEvent() {
@@ -247,6 +250,7 @@ class DeviceSystemActivity : BaseActivity<BedTextActivityPresenter, CallingbedDe
                 Toast.makeText(activity, "restart now...", Toast.LENGTH_LONG).show()
                 Toast.makeText(activity, "restart now...", Toast.LENGTH_LONG).show()
                 Handler().postDelayed({ AppUpdateHelper.restartApp(activity) }, 3000)
                 Handler().postDelayed({ AppUpdateHelper.restartApp(activity) }, 3000)
             }
             }
+
             //通话设置
             //通话设置
             R.id.device_sys_language_settings_tv -> {
             R.id.device_sys_language_settings_tv -> {
                 if (BuildConfig.flag.equals(Constant.DEV_W_A133)) {
                 if (BuildConfig.flag.equals(Constant.DEV_W_A133)) {
@@ -254,16 +258,23 @@ class DeviceSystemActivity : BaseActivity<BedTextActivityPresenter, CallingbedDe
                 } else {
                 } else {
                     showMessage(R.string.device_not_support)
                     showMessage(R.string.device_not_support)
                 }
                 }
-
             }
             }
+
             //进入设置
             //进入设置
             R.id.device_sys_system_settings_tv -> {
             R.id.device_sys_system_settings_tv -> {
                 SystemDialogHelper.showDialog(activity, 2)
                 SystemDialogHelper.showDialog(activity, 2)
             }
             }
+
             //关于主机
             //关于主机
             R.id.device_sys_software_and_information_tv -> {
             R.id.device_sys_software_and_information_tv -> {
 
 
             }
             }
+
+            R.id.device_serial_port_settings_tv -> {
+                SystemDialogHelper2.showDialog(activity) {
+                    SerialPortConfigDialogHelper.showDialog(activity)
+                }
+            }
         }
         }
     }
     }
 }
 }

+ 62 - 0
android_bed/src/main/java/com/wdkl/app/ncs/callingbed/adapter/SerialPortAdapter.java

@@ -0,0 +1,62 @@
+package com.wdkl.app.ncs.callingbed.adapter;
+
+import android.content.Context;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.TextView;
+
+import com.wdkl.app.ncs.callingbed.R;
+
+import java.util.List;
+
+public class SerialPortAdapter extends BaseAdapter {
+
+    private Context context;
+    private List<String> serialPortList;
+
+    public SerialPortAdapter(Context context, List<String> list) {
+        this.context = context;
+        this.serialPortList = list;
+    }
+
+    @Override
+    public int getCount() {
+        return serialPortList.size();
+    }
+
+    @Override
+    public Object getItem(int position) {
+        return serialPortList.get(position);
+    }
+
+    @Override
+    public long getItemId(int position) {
+        return position;
+    }
+
+    @Override
+    public View getView(int position, View convertView, ViewGroup parent) {
+
+        ViewHolder holder = null;
+
+        if (convertView == null) {
+            convertView = View.inflate(context, R.layout.frame_item, null);
+
+            holder = new ViewHolder();
+            holder.tv = (TextView) convertView.findViewById(R.id.tv_frame_name);
+
+            convertView.setTag(holder);
+        } else {
+            holder = (ViewHolder) convertView.getTag();
+        }
+
+        holder.tv.setText(serialPortList.get(position));
+
+        return convertView;
+    }
+
+    static class ViewHolder {
+        private TextView tv;
+    }
+}

+ 138 - 0
android_bed/src/main/java/com/wdkl/app/ncs/callingbed/dialog/SerialPortConfigDialogHelper.java

@@ -0,0 +1,138 @@
+package com.wdkl.app.ncs.callingbed.dialog;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.os.Handler;
+import android.text.TextUtils;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.AdapterView;
+import android.widget.Button;
+import android.widget.LinearLayout;
+import android.widget.Spinner;
+import android.widget.Toast;
+
+import com.wdkl.app.ncs.callingbed.R;
+import com.wdkl.app.ncs.callingbed.adapter.SerialPortAdapter;
+import com.wdkl.app.ncs.callingbed.helper.AppUpdateHelper;
+import com.wdkl.app.ncs.callingbed.helper.Utils;
+import com.wdkl.app.ncs.callingbed.settings.SettingConfig;
+import com.wdkl.ncs.android.lib.base.BaseApplication;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+
+import static com.wdkl.ncs.android.lib.utils.ExtendMethodsKt.showMessage;
+
+public class SerialPortConfigDialogHelper {
+
+    private static AlertDialog alertDialog;
+    private static final ArrayList<String> serialPorts = new ArrayList<>(Arrays.asList("off", "/dev/ttyS2", "/dev/ttyS7"));
+    private static String selectNfcSerial, selectLoraSerial, select433Serial;
+
+    public static void showDialog(Activity activity) {
+        View contentView = LayoutInflater.from(activity).inflate(R.layout.serial_port_config_dialog, null);
+        AlertDialog.Builder builder = new AlertDialog.Builder(activity);
+        builder.setView(contentView);
+        LinearLayout layout = contentView.findViewById(R.id.ll_serial_config_view);
+        Spinner nfcSpinner = contentView.findViewById(R.id.spinner_nfc);
+        Spinner loraSpinner = contentView.findViewById(R.id.spinner_lora);
+        Spinner s433Spinner = contentView.findViewById(R.id.spinner_433);
+        Button cancelButton = contentView.findViewById(R.id.cancel_button);
+        Button confirmButton = contentView.findViewById(R.id.confirm_button);
+
+        layout.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                try {
+                    Utils.hideInputKeyboard(alertDialog.getWindow().getDecorView().getWindowToken());
+                } catch (Exception e) {
+                    //
+                }
+            }
+        });
+
+        String nfcKeysSerial = SettingConfig.getNFCSerialPort(BaseApplication.appContext);
+        String s433Serial = SettingConfig.get433SerialPort(BaseApplication.appContext);
+        String loraSerial = SettingConfig.getLoraSerialPort(BaseApplication.appContext);
+
+        //NFC串口
+        SerialPortAdapter nfcAdapter = new SerialPortAdapter(activity, serialPorts);
+        nfcSpinner.setAdapter(nfcAdapter);
+        nfcSpinner.setSelection(serialPorts.indexOf(nfcKeysSerial));
+        nfcSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
+            @Override
+            public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
+                selectNfcSerial = serialPorts.get(position);
+            }
+
+            @Override
+            public void onNothingSelected(AdapterView<?> parent) {
+
+            }
+        });
+
+        //lora串口
+        SerialPortAdapter loraAdapter = new SerialPortAdapter(activity, serialPorts);
+        loraSpinner.setAdapter(loraAdapter);
+        loraSpinner.setSelection(serialPorts.indexOf(loraSerial));
+        loraSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
+            @Override
+            public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
+                selectLoraSerial = serialPorts.get(position);
+            }
+
+            @Override
+            public void onNothingSelected(AdapterView<?> parent) {
+
+            }
+        });
+
+        //433串口
+        SerialPortAdapter s433Adapter = new SerialPortAdapter(activity, serialPorts);
+        s433Spinner.setAdapter(s433Adapter);
+        s433Spinner.setSelection(serialPorts.indexOf(s433Serial));
+        s433Spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
+            @Override
+            public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
+                select433Serial = serialPorts.get(position);
+            }
+
+            @Override
+            public void onNothingSelected(AdapterView<?> parent) {
+
+            }
+        });
+
+        cancelButton.setOnClickListener(v -> {
+            if (alertDialog != null) {
+                alertDialog.dismiss();
+            }
+        });
+
+        confirmButton.setOnClickListener(v -> {
+            SettingConfig.setNFCSerialPort(BaseApplication.appContext, selectNfcSerial);
+            SettingConfig.setLoraSerialPort(BaseApplication.appContext, selectLoraSerial);
+            SettingConfig.set433SerialPort(BaseApplication.appContext, select433Serial);
+
+            if (alertDialog != null) {
+                alertDialog.dismiss();
+            }
+
+            Toast.makeText(activity, "restart now...", Toast.LENGTH_LONG).show();
+            new Handler().postDelayed(new Runnable() {
+                @Override
+                public void run() {
+                    AppUpdateHelper.restartApp(BaseApplication.appContext);
+                }
+            }, 3000);
+
+        });
+
+        alertDialog = builder.create();
+        alertDialog.setCanceledOnTouchOutside(true);
+        alertDialog.setCancelable(true);
+        alertDialog.show();
+
+    }
+}

+ 14 - 5
android_bed/src/main/java/com/wdkl/app/ncs/callingbed/hardware/imp/A133HardTools.java

@@ -52,21 +52,30 @@ public class A133HardTools extends HardTools {
 
 
     @Override
     @Override
     public void init(CallingbedActivationActivity callingbedActivationActivity) {
     public void init(CallingbedActivationActivity callingbedActivationActivity) {
+        //功能板接串口0
         SerialPortUtil.getInstance().openSerialPortA133();
         SerialPortUtil.getInstance().openSerialPortA133();
+
         if (Boolean.parseBoolean(BuildConfig.open_sleep)){
         if (Boolean.parseBoolean(BuildConfig.open_sleep)){
             SettingConfig.setSLEEPGatewayOn(callingbedActivationActivity, true);
             SettingConfig.setSLEEPGatewayOn(callingbedActivationActivity, true);
         }
         }
 
 
         if (BuildConfig.device_type.equals("4")){
         if (BuildConfig.device_type.equals("4")){
-            SerialPortUtilLoar.getInstance().openSerialPort();
+            //向家坝宿舍项目lora模块接串口7
+            SerialPortUtilLoar.getInstance().openSerialPort("/dev/ttyS7");
         } else if (Boolean.parseBoolean(BuildConfig.serial_nfc)) {
         } else if (Boolean.parseBoolean(BuildConfig.serial_nfc)) {
             new Thread(() -> {
             new Thread(() -> {
-                //NFC serial port
-                SerialPortNfcUtil.getInstance().openSerialPort();
+                String nfcPath = SettingConfig.getNFCSerialPort(BaseApplication.appContext);
+                if (!"off".equalsIgnoreCase(nfcPath)) {
+                    //NFC serial port
+                    SerialPortNfcUtil.getInstance().openSerialPort(nfcPath);
+                }
             }).start();
             }).start();
         } else {
         } else {
             if (Boolean.parseBoolean(BuildConfig.open_433)){
             if (Boolean.parseBoolean(BuildConfig.open_433)){
-                SerialPortUtil433.getInstance().openSerialPort();
+                String s433Path = SettingConfig.get433SerialPort(BaseApplication.appContext);
+                if (!"off".equalsIgnoreCase(s433Path)) {
+                    SerialPortUtil433.getInstance().openSerialPort(s433Path);
+                }
                 SettingConfig.set433GatewayOn(callingbedActivationActivity, true);
                 SettingConfig.set433GatewayOn(callingbedActivationActivity, true);
             }
             }
         }
         }
@@ -78,7 +87,7 @@ public class A133HardTools extends HardTools {
         SerialPortUtil.getInstance().closeSerialPort();
         SerialPortUtil.getInstance().closeSerialPort();
         if (BuildConfig.device_type.equals("4")){
         if (BuildConfig.device_type.equals("4")){
             SerialPortUtilLoar.getInstance().closeSerialPort();
             SerialPortUtilLoar.getInstance().closeSerialPort();
-        } else  if (Boolean.parseBoolean(BuildConfig.serial_nfc)) {
+        } else if (Boolean.parseBoolean(BuildConfig.serial_nfc)) {
             SerialPortNfcUtil.getInstance().closeSerialPort();
             SerialPortNfcUtil.getInstance().closeSerialPort();
         } else {
         } else {
             SerialPortUtil433.getInstance().closeSerialPort();
             SerialPortUtil433.getInstance().closeSerialPort();

+ 41 - 0
android_bed/src/main/java/com/wdkl/app/ncs/callingbed/settings/SettingConfig.java

@@ -2,6 +2,9 @@ package com.wdkl.app.ncs.callingbed.settings;
 
 
 import android.content.Context;
 import android.content.Context;
 import android.content.SharedPreferences;
 import android.content.SharedPreferences;
+import android.text.TextUtils;
+
+import com.wdkl.ncs.android.middleware.BuildConfig;
 
 
 
 
 public class SettingConfig {
 public class SettingConfig {
@@ -120,6 +123,11 @@ public class SettingConfig {
     //当前是否处于离线模式
     //当前是否处于离线模式
     private static final String KEY_SP_OFFLINE_MODE_RUNNING = "KEY_SP_OFFLINE_MODE_RUNNING";
     private static final String KEY_SP_OFFLINE_MODE_RUNNING = "KEY_SP_OFFLINE_MODE_RUNNING";
 
 
+    //串口路径配置
+    private static final String KEY_SP_NFC_SERIAL_PORT = "KEY_SP_NFC_SERIAL_PORT";
+    private static final String KEY_SP_LORA_SERIAL_PORT = "KEY_SP_LORA_SERIAL_PORT";
+    private static final String KEY_SP_433_SERIAL_PORT = "KEY_SP_433_SERIAL_PORT";
+
     public static void setSwCall(Context context, boolean on) {
     public static void setSwCall(Context context, boolean on) {
         getEditor(context).putBoolean(KEY_SP_SW_CALL, on).apply();
         getEditor(context).putBoolean(KEY_SP_SW_CALL, on).apply();
     }
     }
@@ -283,6 +291,39 @@ public class SettingConfig {
         getEditor(context).putBoolean(KEY_SP_OFFLINE_MODE_RUNNING, enable).apply();
         getEditor(context).putBoolean(KEY_SP_OFFLINE_MODE_RUNNING, enable).apply();
     }
     }
 
 
+    public static String getNFCSerialPort(Context context) {
+        //NFC默认接串口7
+        return getSP(context).getString(KEY_SP_NFC_SERIAL_PORT, "/dev/ttyS7");
+    }
+
+    public static void setNFCSerialPort(Context context, String path) {
+        if (!TextUtils.isEmpty(path)) {
+            getEditor(context).putString(KEY_SP_NFC_SERIAL_PORT, path).apply();
+        }
+    }
+
+    public static String getLoraSerialPort(Context context) {
+        //Lora串口默认为ttyS2
+        return getSP(context).getString(KEY_SP_LORA_SERIAL_PORT, "/dev/ttyS2");
+    }
+
+    public static void setLoraSerialPort(Context context, String path) {
+        if (!TextUtils.isEmpty(path)) {
+            getEditor(context).putString(KEY_SP_LORA_SERIAL_PORT, path).apply();
+        }
+    }
+
+    public static String get433SerialPort(Context context) {
+        //433默认关闭串口
+        return getSP(context).getString(KEY_SP_433_SERIAL_PORT, "off");
+    }
+
+    public static void set433SerialPort(Context context, String path) {
+        if (!TextUtils.isEmpty(path)) {
+            getEditor(context).putString(KEY_SP_433_SERIAL_PORT, path).apply();
+        }
+    }
+
     /**
     /**
      * 获取分机白天亮度
      * 获取分机白天亮度
      *
      *

+ 136 - 136
android_bed/src/main/res/layout-land/callingbed_device_sys.xml

@@ -1,33 +1,31 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
 <layout xmlns:android="http://schemas.android.com/apk/res/android">
 <layout xmlns:android="http://schemas.android.com/apk/res/android">
+
     <LinearLayout
     <LinearLayout
         android:layout_width="match_parent"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:layout_height="match_parent"
-        android:orientation="vertical"
-        android:background="#F7F7F7">
+        android:background="#F7F7F7"
+        android:orientation="vertical">
 
 
         <include
         <include
             android:id="@+id/activity_calling_door_layout_title"
             android:id="@+id/activity_calling_door_layout_title"
             layout="@layout/view_title_layout" />
             layout="@layout/view_title_layout" />
 
 
-
         <RelativeLayout
         <RelativeLayout
             android:layout_width="match_parent"
             android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            >
+            android:layout_height="match_parent">
 
 
             <LinearLayout
             <LinearLayout
                 android:id="@+id/ll_device_config_view"
                 android:id="@+id/ll_device_config_view"
                 android:layout_width="@dimen/d450"
                 android:layout_width="@dimen/d450"
                 android:layout_height="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_marginLeft="@dimen/d24"
                 android:layout_marginLeft="@dimen/d24"
-                android:layout_marginRight="@dimen/d24"
                 android:layout_marginTop="@dimen/d30"
                 android:layout_marginTop="@dimen/d30"
+                android:layout_marginRight="@dimen/d24"
                 android:background="@drawable/shape_bed_bg"
                 android:background="@drawable/shape_bed_bg"
                 android:gravity="center_horizontal"
                 android:gravity="center_horizontal"
                 android:orientation="vertical">
                 android:orientation="vertical">
 
 
-
                 <LinearLayout
                 <LinearLayout
                     android:layout_width="match_parent"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content">
                     android:layout_height="wrap_content">
@@ -36,13 +34,12 @@
                         android:id="@+id/nurse_msg_tx_1"
                         android:id="@+id/nurse_msg_tx_1"
                         android:layout_width="wrap_content"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_height="wrap_content"
+                        android:layout_marginLeft="@dimen/d28"
+                        android:layout_marginTop="@dimen/d18"
                         android:text="*"
                         android:text="*"
-                        android:textSize="@dimen/font_size_18"
                         android:textColor="@color/txt_number"
                         android:textColor="@color/txt_number"
-                        android:textStyle="bold"
-                        android:layout_marginTop="@dimen/d18"
-                        android:layout_marginLeft="@dimen/d28"
-                        />
+                        android:textSize="@dimen/font_size_18"
+                        android:textStyle="bold" />
 
 
                     <TextView
                     <TextView
                         android:layout_width="match_parent"
                         android:layout_width="match_parent"
@@ -55,35 +52,31 @@
 
 
                 </LinearLayout>
                 </LinearLayout>
 
 
-
                 <Spinner
                 <Spinner
                     android:id="@+id/device_sys_ed_1"
                     android:id="@+id/device_sys_ed_1"
                     android:layout_width="match_parent"
                     android:layout_width="match_parent"
                     android:layout_height="@dimen/d52"
                     android:layout_height="@dimen/d52"
-                    android:layout_marginRight="@dimen/d40"
                     android:layout_marginLeft="@dimen/d40"
                     android:layout_marginLeft="@dimen/d40"
                     android:layout_marginTop="@dimen/d40"
                     android:layout_marginTop="@dimen/d40"
+                    android:layout_marginRight="@dimen/d40"
                     android:layout_marginBottom="@dimen/d40"
                     android:layout_marginBottom="@dimen/d40"
                     android:background="@drawable/shape_device_sys_ed_bg"
                     android:background="@drawable/shape_device_sys_ed_bg"
-                    android:gravity="center_vertical"
                     android:entries="@array/device_list"
                     android:entries="@array/device_list"
-
-                    />
+                    android:gravity="center_vertical" />
             </LinearLayout>
             </LinearLayout>
 
 
             <LinearLayout
             <LinearLayout
                 android:id="@+id/ll_device_config_view_2"
                 android:id="@+id/ll_device_config_view_2"
-                android:layout_below="@+id/ll_device_config_view"
                 android:layout_width="@dimen/d450"
                 android:layout_width="@dimen/d450"
                 android:layout_height="wrap_content"
                 android:layout_height="wrap_content"
+                android:layout_below="@+id/ll_device_config_view"
                 android:layout_marginLeft="@dimen/d24"
                 android:layout_marginLeft="@dimen/d24"
-                android:layout_marginRight="@dimen/d24"
                 android:layout_marginTop="@dimen/d30"
                 android:layout_marginTop="@dimen/d30"
+                android:layout_marginRight="@dimen/d24"
                 android:background="@drawable/shape_bed_bg"
                 android:background="@drawable/shape_bed_bg"
                 android:gravity="center_horizontal"
                 android:gravity="center_horizontal"
                 android:orientation="vertical">
                 android:orientation="vertical">
 
 
-
                 <LinearLayout
                 <LinearLayout
                     android:layout_width="match_parent"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content">
                     android:layout_height="wrap_content">
@@ -91,13 +84,12 @@
                     <TextView
                     <TextView
                         android:layout_width="wrap_content"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_height="wrap_content"
+                        android:layout_marginLeft="@dimen/d28"
+                        android:layout_marginTop="@dimen/d18"
                         android:text="*"
                         android:text="*"
-                        android:textSize="@dimen/font_size_18"
                         android:textColor="@color/txt_number"
                         android:textColor="@color/txt_number"
-                        android:textStyle="bold"
-                        android:layout_marginTop="@dimen/d18"
-                        android:layout_marginLeft="@dimen/d28"
-                        />
+                        android:textSize="@dimen/font_size_18"
+                        android:textStyle="bold" />
 
 
                     <TextView
                     <TextView
                         android:layout_width="match_parent"
                         android:layout_width="match_parent"
@@ -114,16 +106,15 @@
                     android:id="@+id/device_sys_ed_2"
                     android:id="@+id/device_sys_ed_2"
                     android:layout_width="match_parent"
                     android:layout_width="match_parent"
                     android:layout_height="@dimen/d52"
                     android:layout_height="@dimen/d52"
-                    android:layout_marginRight="@dimen/d40"
                     android:layout_marginLeft="@dimen/d40"
                     android:layout_marginLeft="@dimen/d40"
                     android:layout_marginTop="@dimen/d40"
                     android:layout_marginTop="@dimen/d40"
+                    android:layout_marginRight="@dimen/d40"
                     android:layout_marginBottom="@dimen/d40"
                     android:layout_marginBottom="@dimen/d40"
                     android:background="@drawable/shape_device_sys_ed_bg"
                     android:background="@drawable/shape_device_sys_ed_bg"
-                    android:gravity="center_vertical"
                     android:entries="@array/language_list"
                     android:entries="@array/language_list"
+                    android:gravity="center_vertical"
                     android:textSize="@dimen/font_size_18"
                     android:textSize="@dimen/font_size_18"
-                    android:textStyle="bold"
-                    />
+                    android:textStyle="bold" />
 
 
                 <LinearLayout
                 <LinearLayout
                     android:layout_width="match_parent"
                     android:layout_width="match_parent"
@@ -132,12 +123,11 @@
                     <TextView
                     <TextView
                         android:layout_width="wrap_content"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_height="wrap_content"
+                        android:layout_marginLeft="@dimen/d28"
                         android:text="*"
                         android:text="*"
-                        android:textSize="@dimen/font_size_18"
                         android:textColor="@color/txt_number"
                         android:textColor="@color/txt_number"
-                        android:textStyle="bold"
-                        android:layout_marginLeft="@dimen/d28"
-                        />
+                        android:textSize="@dimen/font_size_18"
+                        android:textStyle="bold" />
 
 
                     <TextView
                     <TextView
                         android:layout_width="match_parent"
                         android:layout_width="match_parent"
@@ -162,44 +152,41 @@
                         android:id="@+id/device_sys_radio_language_on"
                         android:id="@+id/device_sys_radio_language_on"
                         android:layout_width="wrap_content"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_height="wrap_content"
-                        android:text="@string/str_yes"
-                        android:textColor="@drawable/radio_button_selector_txt2"
                         android:button="@null"
                         android:button="@null"
                         android:drawableLeft="@drawable/radio_button_selector_bg2"
                         android:drawableLeft="@drawable/radio_button_selector_bg2"
                         android:drawablePadding="@dimen/d5"
                         android:drawablePadding="@dimen/d5"
+                        android:text="@string/str_yes"
+                        android:textColor="@drawable/radio_button_selector_txt2"
                         android:textSize="14px" />
                         android:textSize="14px" />
 
 
                     <RadioButton
                     <RadioButton
                         android:id="@+id/device_sys_radio_language_off"
                         android:id="@+id/device_sys_radio_language_off"
                         android:layout_width="wrap_content"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_height="wrap_content"
-                        android:text="@string/str_no"
-                        android:textColor="@drawable/radio_button_selector_txt2"
                         android:layout_marginLeft="@dimen/d10"
                         android:layout_marginLeft="@dimen/d10"
                         android:button="@null"
                         android:button="@null"
                         android:drawableLeft="@drawable/radio_button_selector_bg2"
                         android:drawableLeft="@drawable/radio_button_selector_bg2"
                         android:drawablePadding="@dimen/d5"
                         android:drawablePadding="@dimen/d5"
+                        android:text="@string/str_no"
+                        android:textColor="@drawable/radio_button_selector_txt2"
                         android:textSize="14px" />
                         android:textSize="14px" />
                 </RadioGroup>
                 </RadioGroup>
 
 
 
 
-
-
             </LinearLayout>
             </LinearLayout>
 
 
             <LinearLayout
             <LinearLayout
                 android:id="@+id/ll_device_config_view_3"
                 android:id="@+id/ll_device_config_view_3"
-                android:layout_toRightOf="@+id/ll_device_config_view"
                 android:layout_width="match_parent"
                 android:layout_width="match_parent"
                 android:layout_height="@dimen/d180"
                 android:layout_height="@dimen/d180"
                 android:layout_marginLeft="@dimen/d24"
                 android:layout_marginLeft="@dimen/d24"
-                android:layout_marginRight="@dimen/d24"
                 android:layout_marginTop="@dimen/d30"
                 android:layout_marginTop="@dimen/d30"
+                android:layout_marginRight="@dimen/d24"
+                android:layout_toRightOf="@+id/ll_device_config_view"
                 android:background="@drawable/shape_bed_bg"
                 android:background="@drawable/shape_bed_bg"
                 android:gravity="center_horizontal"
                 android:gravity="center_horizontal"
                 android:orientation="vertical">
                 android:orientation="vertical">
 
 
-
                 <LinearLayout
                 <LinearLayout
                     android:layout_width="match_parent"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content">
                     android:layout_height="wrap_content">
@@ -207,13 +194,12 @@
                     <TextView
                     <TextView
                         android:layout_width="wrap_content"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_height="wrap_content"
+                        android:layout_marginLeft="@dimen/d28"
+                        android:layout_marginTop="@dimen/d18"
                         android:text="*"
                         android:text="*"
-                        android:textSize="@dimen/font_size_18"
                         android:textColor="@color/txt_number"
                         android:textColor="@color/txt_number"
-                        android:textStyle="bold"
-                        android:layout_marginTop="@dimen/d18"
-                        android:layout_marginLeft="@dimen/d28"
-                        />
+                        android:textSize="@dimen/font_size_18"
+                        android:textStyle="bold" />
 
 
                     <TextView
                     <TextView
                         android:layout_width="match_parent"
                         android:layout_width="match_parent"
@@ -239,25 +225,26 @@
                         android:id="@+id/device_sys_radio_window_on"
                         android:id="@+id/device_sys_radio_window_on"
                         android:layout_width="wrap_content"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_height="wrap_content"
-                        android:text="@string/str_device_sys_window_on"
-                        android:textColor="@drawable/radio_button_selector_txt2"
                         android:button="@null"
                         android:button="@null"
                         android:drawableLeft="@drawable/radio_button_selector_bg2"
                         android:drawableLeft="@drawable/radio_button_selector_bg2"
                         android:drawablePadding="@dimen/d5"
                         android:drawablePadding="@dimen/d5"
+                        android:text="@string/str_device_sys_window_on"
+                        android:textColor="@drawable/radio_button_selector_txt2"
                         android:textSize="14px" />
                         android:textSize="14px" />
 
 
                     <RadioButton
                     <RadioButton
                         android:id="@+id/device_sys_radio_window_off"
                         android:id="@+id/device_sys_radio_window_off"
                         android:layout_width="wrap_content"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_height="wrap_content"
-                        android:text="@string/str_device_sys_window_off"
-                        android:textColor="@drawable/radio_button_selector_txt2"
                         android:layout_marginLeft="@dimen/d10"
                         android:layout_marginLeft="@dimen/d10"
                         android:button="@null"
                         android:button="@null"
                         android:drawableLeft="@drawable/radio_button_selector_bg2"
                         android:drawableLeft="@drawable/radio_button_selector_bg2"
                         android:drawablePadding="@dimen/d5"
                         android:drawablePadding="@dimen/d5"
+                        android:text="@string/str_device_sys_window_off"
+                        android:textColor="@drawable/radio_button_selector_txt2"
                         android:textSize="14px" />
                         android:textSize="14px" />
                 </RadioGroup>
                 </RadioGroup>
+
                 <LinearLayout
                 <LinearLayout
                     android:layout_width="match_parent"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content">
                     android:layout_height="wrap_content">
@@ -265,12 +252,11 @@
                     <TextView
                     <TextView
                         android:layout_width="wrap_content"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_height="wrap_content"
+                        android:layout_marginLeft="@dimen/d28"
                         android:text="*"
                         android:text="*"
-                        android:textSize="@dimen/font_size_18"
                         android:textColor="@color/txt_number"
                         android:textColor="@color/txt_number"
-                        android:textStyle="bold"
-                        android:layout_marginLeft="@dimen/d28"
-                        />
+                        android:textSize="@dimen/font_size_18"
+                        android:textStyle="bold" />
 
 
                     <TextView
                     <TextView
                         android:layout_width="match_parent"
                         android:layout_width="match_parent"
@@ -295,116 +281,130 @@
                         android:id="@+id/device_huli_time_on"
                         android:id="@+id/device_huli_time_on"
                         android:layout_width="wrap_content"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_height="wrap_content"
-                        android:text="@string/str_yes"
-                        android:textColor="@drawable/radio_button_selector_txt2"
                         android:button="@null"
                         android:button="@null"
                         android:drawableLeft="@drawable/radio_button_selector_bg2"
                         android:drawableLeft="@drawable/radio_button_selector_bg2"
                         android:drawablePadding="@dimen/d5"
                         android:drawablePadding="@dimen/d5"
+                        android:text="@string/str_yes"
+                        android:textColor="@drawable/radio_button_selector_txt2"
                         android:textSize="14px" />
                         android:textSize="14px" />
 
 
                     <RadioButton
                     <RadioButton
                         android:id="@+id/device_huli_time_off"
                         android:id="@+id/device_huli_time_off"
                         android:layout_width="wrap_content"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_height="wrap_content"
-                        android:text="@string/str_no"
-                        android:textColor="@drawable/radio_button_selector_txt2"
                         android:layout_marginLeft="@dimen/d10"
                         android:layout_marginLeft="@dimen/d10"
                         android:button="@null"
                         android:button="@null"
                         android:drawableLeft="@drawable/radio_button_selector_bg2"
                         android:drawableLeft="@drawable/radio_button_selector_bg2"
                         android:drawablePadding="@dimen/d5"
                         android:drawablePadding="@dimen/d5"
+                        android:text="@string/str_no"
+                        android:textColor="@drawable/radio_button_selector_txt2"
                         android:textSize="14px" />
                         android:textSize="14px" />
                 </RadioGroup>
                 </RadioGroup>
 
 
-
-
             </LinearLayout>
             </LinearLayout>
 
 
-
-            <LinearLayout
-                android:layout_below="@+id/ll_device_config_view_3"
-                android:layout_toRightOf="@+id/ll_device_config_view_2"
+            <ScrollView
                 android:layout_width="match_parent"
                 android:layout_width="match_parent"
-                android:layout_height="wrap_content"
+                android:layout_height="match_parent"
+                android:layout_below="@+id/ll_device_config_view_3"
                 android:layout_marginTop="20dp"
                 android:layout_marginTop="20dp"
                 android:layout_marginBottom="10dp"
                 android:layout_marginBottom="10dp"
-                android:gravity="center"
-                android:orientation="vertical">
+                android:layout_toRightOf="@+id/ll_device_config_view_2">
 
 
-                <TextView
-                    android:id="@+id/device_sys_save_settings_tv"
-                    android:layout_width="match_parent"
-                    android:layout_height="@dimen/d60"
-                    android:layout_marginLeft="@dimen/d24"
-                    android:layout_marginRight="@dimen/d24"
-                    android:gravity="center_vertical"
-                    android:drawableLeft="@mipmap/kssz_bao"
-                    android:paddingLeft="@dimen/d200"
-                    android:drawablePadding="@dimen/d15"
-                    android:background="@drawable/shape_bed_bg"
-                    android:textStyle="bold"
-                    android:text="@string/save_settings"
-                    android:textColor="#000000"
-                    android:textSize="18sp" />
-
-                <TextView
-                    android:id="@+id/device_sys_language_settings_tv"
-                    android:layout_width="match_parent"
-                    android:layout_height="@dimen/d60"
-                    android:layout_marginLeft="@dimen/d24"
-                    android:layout_marginRight="@dimen/d24"
-                    android:layout_marginTop="@dimen/d15"
-                    android:gravity="center_vertical"
-                    android:drawableLeft="@mipmap/kssz_yu"
-                    android:drawablePadding="@dimen/d15"
-                    android:paddingLeft="@dimen/d200"
-                    android:background="@drawable/shape_bed_bg"
-                    android:textStyle="bold"
-                    android:text="@string/call_config"
-                    android:textColor="#000000"
-                    android:textSize="18sp" />
-
-                <TextView
-                    android:id="@+id/device_sys_system_settings_tv"
-                    android:layout_width="match_parent"
-                    android:layout_height="@dimen/d60"
-                    android:layout_marginLeft="@dimen/d24"
-                    android:layout_marginRight="@dimen/d24"
-                    android:layout_marginTop="@dimen/d15"
-                    android:gravity="center_vertical"
-                    android:drawableLeft="@mipmap/kssz_xi"
-                    android:paddingLeft="@dimen/d200"
-                    android:drawablePadding="@dimen/d15"
-                    android:background="@drawable/shape_bed_bg"
-                    android:textStyle="bold"
-                    android:text="@string/system_settings"
-                    android:textColor="#000000"
-                    android:textSize="18sp" />
-
-
-                <TextView
-                    android:id="@+id/device_sys_software_and_information_tv"
+                <LinearLayout
                     android:layout_width="match_parent"
                     android:layout_width="match_parent"
-                    android:layout_height="@dimen/d60"
-                    android:layout_marginLeft="@dimen/d24"
-                    android:layout_marginRight="@dimen/d24"
-                    android:layout_marginTop="15dp"
-                    android:gravity="center_vertical"
-                    android:drawableLeft="@mipmap/kssz_guan"
-                    android:paddingLeft="@dimen/d200"
-                    android:drawablePadding="@dimen/d15"
-                    android:background="@drawable/shape_bed_bg"
-                    android:text="@string/str_about"
-                    android:textStyle="bold"
-                    android:textColor="#000000"
-                    android:textSize="18sp" />
+                    android:layout_height="wrap_content"
+                    android:gravity="center"
+                    android:orientation="vertical">
 
 
+                    <TextView
+                        android:id="@+id/device_sys_save_settings_tv"
+                        android:layout_width="match_parent"
+                        android:layout_height="@dimen/d60"
+                        android:layout_marginLeft="@dimen/d24"
+                        android:layout_marginRight="@dimen/d24"
+                        android:background="@drawable/shape_bed_bg"
+                        android:drawableLeft="@mipmap/kssz_bao"
+                        android:drawablePadding="@dimen/d15"
+                        android:gravity="center_vertical"
+                        android:paddingLeft="@dimen/d200"
+                        android:text="@string/save_settings"
+                        android:textColor="#000000"
+                        android:textSize="18sp"
+                        android:textStyle="bold" />
 
 
-            </LinearLayout>
+                    <TextView
+                        android:id="@+id/device_sys_language_settings_tv"
+                        android:layout_width="match_parent"
+                        android:layout_height="@dimen/d60"
+                        android:layout_marginLeft="@dimen/d24"
+                        android:layout_marginTop="@dimen/d15"
+                        android:layout_marginRight="@dimen/d24"
+                        android:background="@drawable/shape_bed_bg"
+                        android:drawableLeft="@mipmap/kssz_yu"
+                        android:drawablePadding="@dimen/d15"
+                        android:gravity="center_vertical"
+                        android:paddingLeft="@dimen/d200"
+                        android:text="@string/call_config"
+                        android:textColor="#000000"
+                        android:textSize="18sp"
+                        android:textStyle="bold" />
 
 
+                    <TextView
+                        android:id="@+id/device_serial_port_settings_tv"
+                        android:layout_width="match_parent"
+                        android:layout_height="@dimen/d60"
+                        android:layout_marginLeft="@dimen/d24"
+                        android:layout_marginTop="@dimen/d15"
+                        android:layout_marginRight="@dimen/d24"
+                        android:background="@drawable/shape_bed_bg"
+                        android:drawableLeft="@mipmap/kssz_xi"
+                        android:drawablePadding="@dimen/d15"
+                        android:gravity="center_vertical"
+                        android:paddingLeft="@dimen/d200"
+                        android:text="@string/serial_port_config"
+                        android:textColor="#000000"
+                        android:textSize="18sp"
+                        android:textStyle="bold" />
 
 
+                    <TextView
+                        android:id="@+id/device_sys_system_settings_tv"
+                        android:layout_width="match_parent"
+                        android:layout_height="@dimen/d60"
+                        android:layout_marginLeft="@dimen/d24"
+                        android:layout_marginTop="@dimen/d15"
+                        android:layout_marginRight="@dimen/d24"
+                        android:background="@drawable/shape_bed_bg"
+                        android:drawableLeft="@mipmap/kssz_xi"
+                        android:drawablePadding="@dimen/d15"
+                        android:gravity="center_vertical"
+                        android:paddingLeft="@dimen/d200"
+                        android:text="@string/system_settings"
+                        android:textColor="#000000"
+                        android:textSize="18sp"
+                        android:textStyle="bold" />
 
 
-        </RelativeLayout>
+                    <TextView
+                        android:id="@+id/device_sys_software_and_information_tv"
+                        android:layout_width="match_parent"
+                        android:layout_height="@dimen/d60"
+                        android:layout_marginLeft="@dimen/d24"
+                        android:layout_marginTop="15dp"
+                        android:layout_marginRight="@dimen/d24"
+                        android:background="@drawable/shape_bed_bg"
+                        android:drawableLeft="@mipmap/kssz_guan"
+                        android:drawablePadding="@dimen/d15"
+                        android:gravity="center_vertical"
+                        android:paddingLeft="@dimen/d200"
+                        android:text="@string/str_about"
+                        android:textColor="#000000"
+                        android:textSize="18sp"
+                        android:textStyle="bold" />
 
 
+                </LinearLayout>
+            </ScrollView>
+
+        </RelativeLayout>
 
 
     </LinearLayout>
     </LinearLayout>
 
 

+ 137 - 139
android_bed/src/main/res/layout/callingbed_device_sys.xml

@@ -1,16 +1,16 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
 <layout xmlns:android="http://schemas.android.com/apk/res/android">
 <layout xmlns:android="http://schemas.android.com/apk/res/android">
+
     <LinearLayout
     <LinearLayout
         android:layout_width="match_parent"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:layout_height="match_parent"
-        android:orientation="vertical"
-        android:background="#F7F7F7">
+        android:background="#F7F7F7"
+        android:orientation="vertical">
 
 
         <include
         <include
             android:id="@+id/activity_calling_door_layout_title"
             android:id="@+id/activity_calling_door_layout_title"
             layout="@layout/view_title_layout" />
             layout="@layout/view_title_layout" />
 
 
-
         <LinearLayout
         <LinearLayout
             android:layout_width="match_parent"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
             android:layout_height="match_parent"
@@ -21,13 +21,12 @@
                 android:layout_width="match_parent"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_marginLeft="@dimen/d24"
                 android:layout_marginLeft="@dimen/d24"
-                android:layout_marginRight="@dimen/d24"
                 android:layout_marginTop="@dimen/d30"
                 android:layout_marginTop="@dimen/d30"
+                android:layout_marginRight="@dimen/d24"
                 android:background="@drawable/shape_bed_bg"
                 android:background="@drawable/shape_bed_bg"
                 android:gravity="center_horizontal"
                 android:gravity="center_horizontal"
                 android:orientation="vertical">
                 android:orientation="vertical">
 
 
-
                 <LinearLayout
                 <LinearLayout
                     android:layout_width="match_parent"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content">
                     android:layout_height="wrap_content">
@@ -36,13 +35,12 @@
                         android:id="@+id/nurse_msg_tx_1"
                         android:id="@+id/nurse_msg_tx_1"
                         android:layout_width="wrap_content"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_height="wrap_content"
+                        android:layout_marginLeft="@dimen/d28"
+                        android:layout_marginTop="@dimen/d18"
                         android:text="*"
                         android:text="*"
-                        android:textSize="@dimen/font_size_18"
                         android:textColor="@color/txt_number"
                         android:textColor="@color/txt_number"
-                        android:textStyle="bold"
-                        android:layout_marginTop="@dimen/d18"
-                        android:layout_marginLeft="@dimen/d28"
-                        />
+                        android:textSize="@dimen/font_size_18"
+                        android:textStyle="bold" />
 
 
                     <TextView
                     <TextView
                         android:layout_width="match_parent"
                         android:layout_width="match_parent"
@@ -55,22 +53,20 @@
 
 
                 </LinearLayout>
                 </LinearLayout>
 
 
-
                 <Spinner
                 <Spinner
                     android:id="@+id/device_sys_ed_1"
                     android:id="@+id/device_sys_ed_1"
                     android:layout_width="match_parent"
                     android:layout_width="match_parent"
                     android:layout_height="@dimen/d52"
                     android:layout_height="@dimen/d52"
-                    android:layout_marginRight="@dimen/d40"
                     android:layout_marginLeft="@dimen/d40"
                     android:layout_marginLeft="@dimen/d40"
                     android:layout_marginTop="@dimen/d40"
                     android:layout_marginTop="@dimen/d40"
+                    android:layout_marginRight="@dimen/d40"
                     android:layout_marginBottom="@dimen/d40"
                     android:layout_marginBottom="@dimen/d40"
                     android:background="@drawable/shape_device_sys_ed_bg"
                     android:background="@drawable/shape_device_sys_ed_bg"
+                    android:entries="@array/language_list"
                     android:gravity="center_vertical"
                     android:gravity="center_vertical"
                     android:paddingLeft="@dimen/d26"
                     android:paddingLeft="@dimen/d26"
-                    android:entries="@array/language_list"
                     android:textSize="@dimen/font_size_18"
                     android:textSize="@dimen/font_size_18"
-                    android:textStyle="bold"
-                    />
+                    android:textStyle="bold" />
 
 
             </LinearLayout>
             </LinearLayout>
 
 
@@ -78,13 +74,12 @@
                 android:layout_width="match_parent"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_marginLeft="@dimen/d24"
                 android:layout_marginLeft="@dimen/d24"
-                android:layout_marginRight="@dimen/d24"
                 android:layout_marginTop="@dimen/d30"
                 android:layout_marginTop="@dimen/d30"
+                android:layout_marginRight="@dimen/d24"
                 android:background="@drawable/shape_bed_bg"
                 android:background="@drawable/shape_bed_bg"
                 android:gravity="center_horizontal"
                 android:gravity="center_horizontal"
                 android:orientation="vertical">
                 android:orientation="vertical">
 
 
-
                 <LinearLayout
                 <LinearLayout
                     android:layout_width="match_parent"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content">
                     android:layout_height="wrap_content">
@@ -92,13 +87,12 @@
                     <TextView
                     <TextView
                         android:layout_width="wrap_content"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_height="wrap_content"
+                        android:layout_marginLeft="@dimen/d28"
+                        android:layout_marginTop="@dimen/d18"
                         android:text="*"
                         android:text="*"
-                        android:textSize="@dimen/font_size_18"
                         android:textColor="@color/txt_number"
                         android:textColor="@color/txt_number"
-                        android:textStyle="bold"
-                        android:layout_marginTop="@dimen/d18"
-                        android:layout_marginLeft="@dimen/d28"
-                        />
+                        android:textSize="@dimen/font_size_18"
+                        android:textStyle="bold" />
 
 
                     <TextView
                     <TextView
                         android:layout_width="match_parent"
                         android:layout_width="match_parent"
@@ -110,21 +104,21 @@
                         android:textStyle="bold" />
                         android:textStyle="bold" />
 
 
                 </LinearLayout>
                 </LinearLayout>
+
                 <Spinner
                 <Spinner
                     android:id="@+id/device_sys_ed_2"
                     android:id="@+id/device_sys_ed_2"
                     android:layout_width="match_parent"
                     android:layout_width="match_parent"
                     android:layout_height="@dimen/d52"
                     android:layout_height="@dimen/d52"
-                    android:layout_marginRight="@dimen/d40"
                     android:layout_marginLeft="@dimen/d40"
                     android:layout_marginLeft="@dimen/d40"
                     android:layout_marginTop="@dimen/d40"
                     android:layout_marginTop="@dimen/d40"
+                    android:layout_marginRight="@dimen/d40"
                     android:layout_marginBottom="@dimen/d40"
                     android:layout_marginBottom="@dimen/d40"
                     android:background="@drawable/shape_device_sys_ed_bg"
                     android:background="@drawable/shape_device_sys_ed_bg"
+                    android:entries="@array/language_list"
                     android:gravity="center_vertical"
                     android:gravity="center_vertical"
                     android:paddingLeft="@dimen/d26"
                     android:paddingLeft="@dimen/d26"
-                    android:entries="@array/language_list"
                     android:textSize="@dimen/font_size_18"
                     android:textSize="@dimen/font_size_18"
-                    android:textStyle="bold"
-                    />
+                    android:textStyle="bold" />
 
 
                 <LinearLayout
                 <LinearLayout
                     android:layout_width="match_parent"
                     android:layout_width="match_parent"
@@ -133,12 +127,11 @@
                     <TextView
                     <TextView
                         android:layout_width="wrap_content"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_height="wrap_content"
+                        android:layout_marginLeft="@dimen/d28"
                         android:text="*"
                         android:text="*"
-                        android:textSize="@dimen/font_size_18"
                         android:textColor="@color/txt_number"
                         android:textColor="@color/txt_number"
-                        android:textStyle="bold"
-                        android:layout_marginLeft="@dimen/d28"
-                        />
+                        android:textSize="@dimen/font_size_18"
+                        android:textStyle="bold" />
 
 
                     <TextView
                     <TextView
                         android:layout_width="match_parent"
                         android:layout_width="match_parent"
@@ -163,58 +156,52 @@
                         android:id="@+id/device_sys_radio_language_on"
                         android:id="@+id/device_sys_radio_language_on"
                         android:layout_width="wrap_content"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_height="wrap_content"
-                        android:text="@string/str_yes"
-                        android:textColor="@drawable/radio_button_selector_txt"
                         android:button="@null"
                         android:button="@null"
                         android:drawableLeft="@drawable/radio_button_selector_bg"
                         android:drawableLeft="@drawable/radio_button_selector_bg"
                         android:drawablePadding="@dimen/d5"
                         android:drawablePadding="@dimen/d5"
+                        android:text="@string/str_yes"
+                        android:textColor="@drawable/radio_button_selector_txt"
                         android:textSize="14px" />
                         android:textSize="14px" />
 
 
                     <RadioButton
                     <RadioButton
                         android:id="@+id/device_sys_radio_language_off"
                         android:id="@+id/device_sys_radio_language_off"
                         android:layout_width="wrap_content"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_height="wrap_content"
-                        android:text="@string/str_no"
-                        android:textColor="@drawable/radio_button_selector_txt"
                         android:layout_marginLeft="@dimen/d10"
                         android:layout_marginLeft="@dimen/d10"
                         android:button="@null"
                         android:button="@null"
                         android:drawableLeft="@drawable/radio_button_selector_bg"
                         android:drawableLeft="@drawable/radio_button_selector_bg"
                         android:drawablePadding="@dimen/d5"
                         android:drawablePadding="@dimen/d5"
+                        android:text="@string/str_no"
+                        android:textColor="@drawable/radio_button_selector_txt"
                         android:textSize="14px" />
                         android:textSize="14px" />
                 </RadioGroup>
                 </RadioGroup>
 
 
-
-
-
             </LinearLayout>
             </LinearLayout>
 
 
             <LinearLayout
             <LinearLayout
                 android:layout_width="match_parent"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_marginLeft="@dimen/d24"
                 android:layout_marginLeft="@dimen/d24"
-                android:layout_marginRight="@dimen/d24"
                 android:layout_marginTop="@dimen/d30"
                 android:layout_marginTop="@dimen/d30"
+                android:layout_marginRight="@dimen/d24"
                 android:background="@drawable/shape_bed_bg"
                 android:background="@drawable/shape_bed_bg"
                 android:gravity="center_horizontal"
                 android:gravity="center_horizontal"
                 android:orientation="vertical">
                 android:orientation="vertical">
 
 
-
                 <LinearLayout
                 <LinearLayout
                     android:layout_width="match_parent"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:layout_height="wrap_content"
-                    android:orientation="horizontal"
                     android:layout_marginTop="@dimen/d20"
                     android:layout_marginTop="@dimen/d20"
-                    >
+                    android:orientation="horizontal">
 
 
                     <TextView
                     <TextView
                         android:layout_width="wrap_content"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_height="wrap_content"
+                        android:layout_marginLeft="@dimen/d28"
                         android:text="*"
                         android:text="*"
-                        android:textSize="@dimen/font_size_18"
                         android:textColor="@color/txt_number"
                         android:textColor="@color/txt_number"
-                        android:textStyle="bold"
-                        android:layout_marginLeft="@dimen/d28"
-                        />
+                        android:textSize="@dimen/font_size_18"
+                        android:textStyle="bold" />
 
 
                     <TextView
                     <TextView
                         android:layout_width="wrap_content"
                         android:layout_width="wrap_content"
@@ -228,55 +215,51 @@
                         android:id="@+id/device_sys_group_window"
                         android:id="@+id/device_sys_group_window"
                         android:layout_width="match_parent"
                         android:layout_width="match_parent"
                         android:layout_height="wrap_content"
                         android:layout_height="wrap_content"
-                        android:layout_marginLeft="@dimen/d24"
                         android:layout_gravity="center"
                         android:layout_gravity="center"
+                        android:layout_marginLeft="@dimen/d24"
                         android:orientation="horizontal">
                         android:orientation="horizontal">
 
 
                         <RadioButton
                         <RadioButton
                             android:id="@+id/device_sys_radio_window_on"
                             android:id="@+id/device_sys_radio_window_on"
                             android:layout_width="wrap_content"
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
                             android:layout_height="wrap_content"
-                            android:text="@string/str_device_sys_window_on"
-                            android:textColor="@drawable/radio_button_selector_txt"
                             android:button="@null"
                             android:button="@null"
                             android:drawableLeft="@drawable/radio_button_selector_bg"
                             android:drawableLeft="@drawable/radio_button_selector_bg"
                             android:drawablePadding="@dimen/d5"
                             android:drawablePadding="@dimen/d5"
+                            android:text="@string/str_device_sys_window_on"
+                            android:textColor="@drawable/radio_button_selector_txt"
                             android:textSize="14px" />
                             android:textSize="14px" />
 
 
                         <RadioButton
                         <RadioButton
                             android:id="@+id/device_sys_radio_window_off"
                             android:id="@+id/device_sys_radio_window_off"
                             android:layout_width="wrap_content"
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
                             android:layout_height="wrap_content"
-                            android:text="@string/str_device_sys_window_off"
-                            android:textColor="@drawable/radio_button_selector_txt"
                             android:layout_marginLeft="@dimen/d10"
                             android:layout_marginLeft="@dimen/d10"
                             android:button="@null"
                             android:button="@null"
                             android:drawableLeft="@drawable/radio_button_selector_bg"
                             android:drawableLeft="@drawable/radio_button_selector_bg"
                             android:drawablePadding="@dimen/d5"
                             android:drawablePadding="@dimen/d5"
+                            android:text="@string/str_device_sys_window_off"
+                            android:textColor="@drawable/radio_button_selector_txt"
                             android:textSize="14px" />
                             android:textSize="14px" />
                     </RadioGroup>
                     </RadioGroup>
 
 
                 </LinearLayout>
                 </LinearLayout>
 
 
-
-
                 <LinearLayout
                 <LinearLayout
                     android:layout_width="match_parent"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:layout_height="wrap_content"
-                    android:orientation="horizontal"
                     android:layout_marginTop="@dimen/d20"
                     android:layout_marginTop="@dimen/d20"
                     android:layout_marginBottom="@dimen/d20"
                     android:layout_marginBottom="@dimen/d20"
-                    >
+                    android:orientation="horizontal">
 
 
                     <TextView
                     <TextView
                         android:layout_width="wrap_content"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_height="wrap_content"
+                        android:layout_marginLeft="@dimen/d28"
                         android:text="*"
                         android:text="*"
-                        android:textSize="@dimen/font_size_18"
                         android:textColor="@color/txt_number"
                         android:textColor="@color/txt_number"
-                        android:textStyle="bold"
-                        android:layout_marginLeft="@dimen/d28"
-                        />
+                        android:textSize="@dimen/font_size_18"
+                        android:textStyle="bold" />
 
 
                     <TextView
                     <TextView
                         android:layout_width="wrap_content"
                         android:layout_width="wrap_content"
@@ -290,124 +273,139 @@
                         android:id="@+id/device_huli_group_time"
                         android:id="@+id/device_huli_group_time"
                         android:layout_width="match_parent"
                         android:layout_width="match_parent"
                         android:layout_height="wrap_content"
                         android:layout_height="wrap_content"
-                        android:layout_marginLeft="@dimen/d24"
                         android:layout_gravity="center"
                         android:layout_gravity="center"
+                        android:layout_marginLeft="@dimen/d24"
                         android:orientation="horizontal">
                         android:orientation="horizontal">
 
 
                         <RadioButton
                         <RadioButton
                             android:id="@+id/device_huli_time_on"
                             android:id="@+id/device_huli_time_on"
                             android:layout_width="wrap_content"
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
                             android:layout_height="wrap_content"
-                            android:text="@string/str_yes"
-                            android:textColor="@drawable/radio_button_selector_txt2"
                             android:button="@null"
                             android:button="@null"
                             android:drawableLeft="@drawable/radio_button_selector_bg2"
                             android:drawableLeft="@drawable/radio_button_selector_bg2"
                             android:drawablePadding="@dimen/d5"
                             android:drawablePadding="@dimen/d5"
+                            android:text="@string/str_yes"
+                            android:textColor="@drawable/radio_button_selector_txt2"
                             android:textSize="14px" />
                             android:textSize="14px" />
 
 
                         <RadioButton
                         <RadioButton
                             android:id="@+id/device_huli_time_off"
                             android:id="@+id/device_huli_time_off"
                             android:layout_width="wrap_content"
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
                             android:layout_height="wrap_content"
-                            android:text="@string/str_no"
-                            android:textColor="@drawable/radio_button_selector_txt2"
                             android:layout_marginLeft="@dimen/d10"
                             android:layout_marginLeft="@dimen/d10"
                             android:button="@null"
                             android:button="@null"
                             android:drawableLeft="@drawable/radio_button_selector_bg2"
                             android:drawableLeft="@drawable/radio_button_selector_bg2"
                             android:drawablePadding="@dimen/d5"
                             android:drawablePadding="@dimen/d5"
+                            android:text="@string/str_no"
+                            android:textColor="@drawable/radio_button_selector_txt2"
                             android:textSize="14px" />
                             android:textSize="14px" />
                     </RadioGroup>
                     </RadioGroup>
                 </LinearLayout>
                 </LinearLayout>
 
 
-
-
-
             </LinearLayout>
             </LinearLayout>
 
 
-            <LinearLayout
+            <ScrollView
                 android:layout_width="match_parent"
                 android:layout_width="match_parent"
-                android:layout_height="wrap_content"
+                android:layout_height="match_parent"
                 android:layout_marginTop="20dp"
                 android:layout_marginTop="20dp"
-                android:layout_marginBottom="10dp"
-                android:gravity="center"
-                android:orientation="vertical">
+                android:layout_marginBottom="10dp">
 
 
-                <TextView
-                    android:id="@+id/device_sys_save_settings_tv"
-                    android:layout_width="match_parent"
-                    android:layout_height="@dimen/d60"
-                    android:layout_marginLeft="@dimen/d24"
-                    android:layout_marginRight="@dimen/d24"
-                    android:gravity="center_vertical"
-                    android:drawableLeft="@mipmap/kssz_bao"
-                    android:paddingLeft="@dimen/d200"
-                    android:drawablePadding="@dimen/d15"
-                    android:background="@drawable/shape_bed_bg"
-                    android:textStyle="bold"
-                    android:text="@string/save_settings"
-                    android:textColor="#000000"
-                    android:textSize="18sp" />
-
-                <TextView
-                    android:id="@+id/device_sys_language_settings_tv"
-                    android:layout_width="match_parent"
-                    android:layout_height="@dimen/d60"
-                    android:layout_marginLeft="@dimen/d24"
-                    android:layout_marginRight="@dimen/d24"
-                    android:layout_marginTop="@dimen/d15"
-                    android:gravity="center_vertical"
-                    android:drawableLeft="@mipmap/kssz_yu"
-                    android:drawablePadding="@dimen/d15"
-                    android:paddingLeft="@dimen/d200"
-                    android:background="@drawable/shape_bed_bg"
-                    android:textStyle="bold"
-                    android:text="@string/language_settings"
-                    android:textColor="#000000"
-                    android:textSize="18sp" />
-
-                <TextView
-                    android:id="@+id/device_sys_system_settings_tv"
-                    android:layout_width="match_parent"
-                    android:layout_height="@dimen/d60"
-                    android:layout_marginLeft="@dimen/d24"
-                    android:layout_marginRight="@dimen/d24"
-                    android:layout_marginTop="@dimen/d15"
-                    android:gravity="center_vertical"
-                    android:drawableLeft="@mipmap/kssz_xi"
-                    android:paddingLeft="@dimen/d200"
-                    android:drawablePadding="@dimen/d15"
-                    android:background="@drawable/shape_bed_bg"
-                    android:textStyle="bold"
-                    android:text="@string/system_settings"
-                    android:textColor="#000000"
-                    android:textSize="18sp" />
-
-
-                <TextView
-                    android:id="@+id/device_sys_software_and_information_tv"
+                <LinearLayout
                     android:layout_width="match_parent"
                     android:layout_width="match_parent"
-                    android:layout_height="@dimen/d60"
-                    android:layout_marginLeft="@dimen/d24"
-                    android:layout_marginRight="@dimen/d24"
-                    android:layout_marginTop="15dp"
-                    android:gravity="center_vertical"
-                    android:drawableLeft="@mipmap/kssz_guan"
-                    android:paddingLeft="@dimen/d200"
-                    android:drawablePadding="@dimen/d15"
-                    android:background="@drawable/shape_bed_bg"
-                    android:text="关于主机"
-                    android:textStyle="bold"
-                    android:textColor="#000000"
-                    android:textSize="18sp" />
+                    android:layout_height="wrap_content"
+                    android:gravity="center"
+                    android:orientation="vertical">
+
+                    <TextView
+                        android:id="@+id/device_sys_save_settings_tv"
+                        android:layout_width="match_parent"
+                        android:layout_height="@dimen/d60"
+                        android:layout_marginLeft="@dimen/d24"
+                        android:layout_marginRight="@dimen/d24"
+                        android:background="@drawable/shape_bed_bg"
+                        android:drawableLeft="@mipmap/kssz_bao"
+                        android:drawablePadding="@dimen/d15"
+                        android:gravity="center_vertical"
+                        android:paddingLeft="@dimen/d200"
+                        android:text="@string/save_settings"
+                        android:textColor="#000000"
+                        android:textSize="18sp"
+                        android:textStyle="bold" />
 
 
+                    <TextView
+                        android:id="@+id/device_sys_language_settings_tv"
+                        android:layout_width="match_parent"
+                        android:layout_height="@dimen/d60"
+                        android:layout_marginLeft="@dimen/d24"
+                        android:layout_marginTop="@dimen/d15"
+                        android:layout_marginRight="@dimen/d24"
+                        android:background="@drawable/shape_bed_bg"
+                        android:drawableLeft="@mipmap/kssz_yu"
+                        android:drawablePadding="@dimen/d15"
+                        android:gravity="center_vertical"
+                        android:paddingLeft="@dimen/d200"
+                        android:text="@string/language_settings"
+                        android:textColor="#000000"
+                        android:textSize="18sp"
+                        android:textStyle="bold" />
 
 
-            </LinearLayout>
+                    <TextView
+                        android:id="@+id/device_serial_port_settings_tv"
+                        android:layout_width="match_parent"
+                        android:layout_height="@dimen/d60"
+                        android:layout_marginLeft="@dimen/d24"
+                        android:layout_marginTop="@dimen/d15"
+                        android:layout_marginRight="@dimen/d24"
+                        android:background="@drawable/shape_bed_bg"
+                        android:drawableLeft="@mipmap/kssz_xi"
+                        android:drawablePadding="@dimen/d15"
+                        android:gravity="center_vertical"
+                        android:paddingLeft="@dimen/d200"
+                        android:text="@string/serial_port_config"
+                        android:textColor="#000000"
+                        android:textSize="18sp"
+                        android:textStyle="bold" />
+
+                    <TextView
+                        android:id="@+id/device_sys_system_settings_tv"
+                        android:layout_width="match_parent"
+                        android:layout_height="@dimen/d60"
+                        android:layout_marginLeft="@dimen/d24"
+                        android:layout_marginTop="@dimen/d15"
+                        android:layout_marginRight="@dimen/d24"
+                        android:background="@drawable/shape_bed_bg"
+                        android:drawableLeft="@mipmap/kssz_xi"
+                        android:drawablePadding="@dimen/d15"
+                        android:gravity="center_vertical"
+                        android:paddingLeft="@dimen/d200"
+                        android:text="@string/system_settings"
+                        android:textColor="#000000"
+                        android:textSize="18sp"
+                        android:textStyle="bold" />
+
+                    <TextView
+                        android:id="@+id/device_sys_software_and_information_tv"
+                        android:layout_width="match_parent"
+                        android:layout_height="@dimen/d60"
+                        android:layout_marginLeft="@dimen/d24"
+                        android:layout_marginTop="15dp"
+                        android:layout_marginRight="@dimen/d24"
+                        android:background="@drawable/shape_bed_bg"
+                        android:drawableLeft="@mipmap/kssz_guan"
+                        android:drawablePadding="@dimen/d15"
+                        android:gravity="center_vertical"
+                        android:paddingLeft="@dimen/d200"
+                        android:text="关于主机"
+                        android:textColor="#000000"
+                        android:textSize="18sp"
+                        android:textStyle="bold" />
 
 
+                </LinearLayout>
 
 
+            </ScrollView>
 
 
         </LinearLayout>
         </LinearLayout>
 
 
-
     </LinearLayout>
     </LinearLayout>
 
 
 </layout>
 </layout>

+ 20 - 0
android_bed/src/main/res/layout/frame_item.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_height="40dp"
+    android:layout_width="match_parent"
+    android:orientation="vertical">
+
+    <TextView
+        android:id="@+id/tv_frame_name"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_margin="8dp"
+        android:text="--"
+        android:textSize="22sp" />
+
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="1dp"
+        android:background="@color/black"
+        android:layout_marginBottom="10dp"/>
+</LinearLayout>

+ 132 - 0
android_bed/src/main/res/layout/serial_port_config_dialog.xml

@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:gravity="center"
+    android:background="@android:color/transparent">
+
+    <LinearLayout
+        android:id="@+id/ll_serial_config_view"
+        android:layout_width="480dp"
+        android:layout_height="448dp"
+        android:background="@color/white"
+        android:gravity="center"
+        android:orientation="vertical">
+
+        <TextView
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="23dp"
+            android:gravity="center"
+            android:text="@string/serial_port_config"
+            android:textColor="@color/black"
+            android:textSize="@dimen/font_size_18"
+            android:textStyle="bold" />
+
+        <LinearLayout
+            android:layout_width="380dp"
+            android:layout_height="52dp"
+            android:layout_marginTop="24dp"
+            android:gravity="center_vertical"
+            android:orientation="horizontal">
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="@string/serial_port_NFC"
+                android:textColor="@color/black"
+                android:textSize="@dimen/font_size_18"
+                android:textStyle="bold" />
+
+            <Spinner
+                android:id="@+id/spinner_nfc"
+                android:layout_width="wrap_content"
+                android:layout_height="match_parent"
+                android:layout_marginStart="20dp"
+                android:gravity="center_vertical"
+                android:spinnerMode="dropdown" />
+
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="380dp"
+            android:layout_height="52dp"
+            android:layout_marginTop="10dp"
+            android:gravity="center_vertical"
+            android:orientation="horizontal">
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="@string/serial_port_lora"
+                android:textColor="@color/black"
+                android:textSize="@dimen/font_size_18"
+                android:textStyle="bold" />
+
+            <Spinner
+                android:id="@+id/spinner_lora"
+                android:layout_width="wrap_content"
+                android:layout_height="match_parent"
+                android:layout_marginStart="20dp"
+                android:gravity="center_vertical"
+                android:spinnerMode="dropdown" />
+
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="380dp"
+            android:layout_height="52dp"
+            android:layout_marginTop="10dp"
+            android:gravity="center_vertical"
+            android:orientation="horizontal">
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="@string/serial_port_433"
+                android:textColor="@color/black"
+                android:textSize="@dimen/font_size_18"
+                android:textStyle="bold" />
+
+            <Spinner
+                android:id="@+id/spinner_433"
+                android:layout_width="wrap_content"
+                android:layout_height="match_parent"
+                android:layout_marginStart="20dp"
+                android:gravity="center_vertical"
+                android:spinnerMode="dropdown" />
+
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="380dp"
+            android:layout_height="52dp"
+            android:layout_marginTop="24dp"
+            android:layout_marginBottom="40dp"
+            android:gravity="center_vertical"
+            android:orientation="horizontal">
+
+            <Button
+                android:id="@+id/cancel_button"
+                android:layout_width="176dp"
+                android:layout_height="48dp"
+                android:background="@drawable/shape_callconfig_bt_bg"
+                android:gravity="center"
+                android:text="@string/str_cancel"
+                android:textColor="@drawable/selector_bottom_btn_text_color"
+                android:textSize="16sp" />
+
+            <Button
+                android:id="@+id/confirm_button"
+                android:layout_width="176dp"
+                android:layout_height="48dp"
+                android:layout_marginLeft="30dp"
+                android:background="@drawable/shape_main_hos_txt_bg"
+                android:gravity="center"
+                android:text="@string/str_confirm"
+                android:textColor="@drawable/selector_bottom_btn_text_color"
+                android:textSize="16sp" />
+        </LinearLayout>
+    </LinearLayout>
+
+</LinearLayout>

+ 5 - 5
bedlib/src/main/java/serialporttest/utils/SerialPortNfcUtil.java

@@ -44,9 +44,9 @@ public class SerialPortNfcUtil {
     /**
     /**
      * 打开串口的方法
      * 打开串口的方法
      */
      */
-    public void openSerialPort() {
+    public void openSerialPort(String path) {
 
 
-        Log.i(TAG, "打开NFC串口7");
+        Log.i(TAG, "打开NFC串口: " + path);
         try {
         try {
             serialPort = new SerialPort();
             serialPort = new SerialPort();
             serialPort.setCallback(new SerialPort.Callback() {
             serialPort.setCallback(new SerialPort.Callback() {
@@ -56,14 +56,14 @@ public class SerialPortNfcUtil {
                     inputStream = serialPort.getInputStream();
                     inputStream = serialPort.getInputStream();
                     outputStream = serialPort.getOutputStream();
                     outputStream = serialPort.getOutputStream();
                     isOpenSerialPortUtil = true;
                     isOpenSerialPortUtil = true;
-                    Log.i(TAG, "open nfc serialPort7 success...");
+                    Log.i(TAG, "open nfc serialPort success..." + path);
                     receiveSerialPort();
                     receiveSerialPort();
                 }
                 }
             });
             });
-            serialPort.open(new File("/dev/ttyS7"), 115200, 0);
+            serialPort.open(new File(path), 115200, 0);
         } catch (Exception e) {
         } catch (Exception e) {
             e.printStackTrace();
             e.printStackTrace();
-            Log.e(TAG, "open nfc serialPort7 failed...");
+            Log.e(TAG, "open nfc serialPort failed..." + path);
         }
         }
     }
     }
 
 

+ 7 - 5
bedlib/src/main/java/serialporttest/utils/SerialPortUtil433.java

@@ -39,12 +39,14 @@ public class SerialPortUtil433 {
     /**
     /**
      * 打开串口的方法
      * 打开串口的方法
      */
      */
-    public void openSerialPort() {
+    public void openSerialPort(String path) {
         if (isOpenSerialPortUtil) {
         if (isOpenSerialPortUtil) {
             Log.i(TAG, "串口已经被打开");
             Log.i(TAG, "串口已经被打开");
             return;
             return;
         }
         }
-        Log.i(TAG, "打开串口7");
+
+        Log.i(TAG, "打开串口: " + path);
+
         try {
         try {
             serialPort433 = new SerialPort();
             serialPort433 = new SerialPort();
             serialPort433.setCallback(new SerialPort.Callback() {
             serialPort433.setCallback(new SerialPort.Callback() {
@@ -55,14 +57,14 @@ public class SerialPortUtil433 {
                     outputStream433 = serialPort433.getOutputStream();
                     outputStream433 = serialPort433.getOutputStream();
                     isOpenSerialPortUtil = true;
                     isOpenSerialPortUtil = true;
 
 
-                    Log.i(TAG, "open openSerialPort0 success...");
+                    Log.i(TAG, "open serialPort success..." + path);
                     receiveSerialPort();
                     receiveSerialPort();
                 }
                 }
             });
             });
-            serialPort433.open(new File("/dev/ttyS7"), 115200, 0);
+            serialPort433.open(new File(path), 115200, 0);
         } catch (Exception e) {
         } catch (Exception e) {
             e.printStackTrace();
             e.printStackTrace();
-            Log.e(TAG, "open openSerialPort0 failed...");
+            Log.e(TAG, "open serialPort failed..." + path);
         }
         }
     }
     }
 
 

+ 5 - 5
bedlib/src/main/java/serialporttest/utils/SerialPortUtilLoar.java

@@ -40,12 +40,12 @@ public class SerialPortUtilLoar {
     /**
     /**
      * 打开串口的方法
      * 打开串口的方法
      */
      */
-    public void openSerialPort() {
+    public void openSerialPort(String path) {
         if (isOpenSerialPortUtil) {
         if (isOpenSerialPortUtil) {
             Log.i(TAG, "串口已经被打开");
             Log.i(TAG, "串口已经被打开");
             return;
             return;
         }
         }
-        Log.i(TAG, "打开串口7");
+        Log.i(TAG, "打开串口: " + path);
         try {
         try {
             serialPortLoar = new SerialPort();
             serialPortLoar = new SerialPort();
             serialPortLoar.setCallback(new SerialPort.Callback() {
             serialPortLoar.setCallback(new SerialPort.Callback() {
@@ -56,7 +56,7 @@ public class SerialPortUtilLoar {
                     outputStreamLoar = serialPortLoar.getOutputStream();
                     outputStreamLoar = serialPortLoar.getOutputStream();
                     isOpenSerialPortUtil = true;
                     isOpenSerialPortUtil = true;
 
 
-                    Log.i(TAG, "open openSerialPort0 success...");
+                    Log.i(TAG, "open serialPort success..." + path);
                     receiveSerialPort();
                     receiveSerialPort();
                     //启动的时候发送一次
                     //启动的时候发送一次
                     send("AT+FREQ=483200000,483200000,483200000,483200000\r\n");
                     send("AT+FREQ=483200000,483200000,483200000,483200000\r\n");
@@ -67,10 +67,10 @@ public class SerialPortUtilLoar {
 
 
                 }
                 }
             });
             });
-            serialPortLoar.open(new File("/dev/ttyS7"), 115200, 0);
+            serialPortLoar.open(new File(path), 115200, 0);
         } catch (Exception e) {
         } catch (Exception e) {
             e.printStackTrace();
             e.printStackTrace();
-            Log.e(TAG, "open openSerialPort0 failed...");
+            Log.e(TAG, "open serialPort failed..." + path);
         }
         }
     }
     }
 
 

+ 5 - 0
resource/src/main/res/values-es/strings.xml

@@ -662,4 +662,9 @@
     <string name="str_action_error">No Activity</string>
     <string name="str_action_error">No Activity</string>
     <string name="disconnect_server">Disconnect with server…</string>
     <string name="disconnect_server">Disconnect with server…</string>
     <string name="str_set_button">Función del botón aún no configurada</string>
     <string name="str_set_button">Función del botón aún no configurada</string>
+
+    <string name="serial_port_config">Serial port config</string>
+    <string name="serial_port_NFC">NFC:</string>
+    <string name="serial_port_lora">Lora:</string>
+    <string name="serial_port_433">433:</string>
 </resources>
 </resources>

+ 6 - 0
resource/src/main/res/values-pt/strings.xml

@@ -123,6 +123,7 @@
     <string name="str_delete_tip">Delete?</string>
     <string name="str_delete_tip">Delete?</string>
     <string name="str_message_content_error">Invalid message</string>
     <string name="str_message_content_error">Invalid message</string>
     <string name="str_voice_message_invalid">Invalid voice message</string>
     <string name="str_voice_message_invalid">Invalid voice message</string>
+    <string name="str_video_message_invalid">Invalid vídeo file</string>
     <string name="str_message_save_success">Success!</string>
     <string name="str_message_save_success">Success!</string>
     <string name="str_record_message_success">Record success!</string>
     <string name="str_record_message_success">Record success!</string>
     <string name="str_invalid_creator_name">Please select creator</string>
     <string name="str_invalid_creator_name">Please select creator</string>
@@ -683,4 +684,9 @@
     <string name="str_action_error">No Activity</string>
     <string name="str_action_error">No Activity</string>
     <string name="disconnect_server">Disconnect with server…</string>
     <string name="disconnect_server">Disconnect with server…</string>
     <string name="str_set_button">Função do botão ainda não configurada</string>
     <string name="str_set_button">Função do botão ainda não configurada</string>
+
+    <string name="serial_port_config">Serial port config</string>
+    <string name="serial_port_NFC">NFC:</string>
+    <string name="serial_port_lora">Lora:</string>
+    <string name="serial_port_433">433:</string>
 </resources>
 </resources>

+ 5 - 0
resource/src/main/res/values-ru/strings.xml

@@ -649,4 +649,9 @@
     <string name="str_action_error">No Activity</string>
     <string name="str_action_error">No Activity</string>
     <string name="disconnect_server">Disconnect with server…</string>
     <string name="disconnect_server">Disconnect with server…</string>
     <string name="str_set_button">Функция кнопки ещё не настроена</string>
     <string name="str_set_button">Функция кнопки ещё не настроена</string>
+
+    <string name="serial_port_config">Serial port config</string>
+    <string name="serial_port_NFC">NFC:</string>
+    <string name="serial_port_lora">Lora:</string>
+    <string name="serial_port_433">433:</string>
 </resources>
 </resources>

+ 7 - 1
resource/src/main/res/values-zh/strings.xml

@@ -118,7 +118,8 @@
     <string name="str_empty_voice_msg">未录制语音</string>
     <string name="str_empty_voice_msg">未录制语音</string>
     <string name="str_delete_tip">确认删除?</string>
     <string name="str_delete_tip">确认删除?</string>
     <string name="str_message_content_error">留言内容为空</string>
     <string name="str_message_content_error">留言内容为空</string>
-    <string name="str_voice_message_invalid">语音留言文件无效</string>
+    <string name="str_voice_message_invalid">无效的语音文件</string>
+    <string name="str_video_message_invalid">无效的视频文件</string>
     <string name="str_message_save_success">留言成功!</string>
     <string name="str_message_save_success">留言成功!</string>
     <string name="str_record_message_success">语音录制成功!</string>
     <string name="str_record_message_success">语音录制成功!</string>
     <string name="str_invalid_creator_name">请先选择创建人</string>
     <string name="str_invalid_creator_name">请先选择创建人</string>
@@ -669,4 +670,9 @@
     <string name="disconnect_server">与服务器断开连接…</string>
     <string name="disconnect_server">与服务器断开连接…</string>
 
 
     <string name="str_set_button">暂未设置按键功能</string>
     <string name="str_set_button">暂未设置按键功能</string>
+
+    <string name="serial_port_config">串口设置</string>
+    <string name="serial_port_NFC">NFC:</string>
+    <string name="serial_port_lora">Lora:</string>
+    <string name="serial_port_433">433:</string>
 </resources>
 </resources>

+ 5 - 0
resource/src/main/res/values/strings.xml

@@ -663,4 +663,9 @@
     <string name="disconnect_server">Disconnect with server…</string>
     <string name="disconnect_server">Disconnect with server…</string>
 
 
     <string name="str_set_button">Button functionality not set yet</string>
     <string name="str_set_button">Button functionality not set yet</string>
+
+    <string name="serial_port_config">Serial port config</string>
+    <string name="serial_port_NFC">NFC:</string>
+    <string name="serial_port_lora">Lora:</string>
+    <string name="serial_port_433">433:</string>
 </resources>
 </resources>