Browse Source

1。测试模式修改

xunchuanzhi 1 year ago
parent
commit
f8d99c0413

+ 4 - 0
android_door/src/main/h10_3128/AndroidManifest.xml

@@ -21,10 +21,14 @@
         <activity android:name="com.wdkl.app.ncs.callingdoor.activity.AppUpdateActivity"
             android:screenOrientation="landscape"
             android:launchMode="singleTask"/>
+        <activity android:name="com.wdkl.app.ncs.callingbed.activity.AppTextActivity"
+            android:screenOrientation="landscape"
+            android:launchMode="singleInstance"/>
 
         <activity android:name="com.wdkl.ncs.host.activity.SipTestActivity" />
         <activity android:name="com.wdkl.ncs.host.activity.CallActivity" />
 
+
         <service
             android:name="com.wdkl.ncs.host.service.WdklSipService"
             android:label="@string/javashop_app_name" />

+ 379 - 0
android_door/src/main/h10_3128/java/com/wdkl/app/ncs/callingdoor/activity/AppTextActivity.kt

@@ -0,0 +1,379 @@
+package com.wdkl.app.ncs.callingbed.activity
+
+import android.graphics.Color
+import android.hardware.Camera
+import android.os.Bundle
+import android.text.method.ScrollingMovementMethod
+import android.view.SurfaceHolder
+import android.view.View
+import com.enation.javashop.android.jrouter.external.annotation.Router
+import com.enation.javashop.net.engine.model.NetState
+import com.wdkl.app.ncs.callingdoor.R
+import com.wdkl.app.ncs.callingdoor.databinding.TestLayBinding
+import com.wdkl.app.ncs.callingdoor.helper.*
+import com.wdkl.app.ncs.callingdoor.launch.CallingdoorLaunch
+import com.wdkl.ncs.android.lib.base.BaseActivity
+import com.wdkl.ncs.android.lib.settings.SettingConfig
+import com.wdkl.ncs.android.lib.vo.filter
+import com.wdkl.ncs.android.middleware.common.Constant
+import com.wdkl.ncs.android.middleware.common.MessageEvent
+import com.wdkl.ncs.android.middleware.logic.contract.callingdoor.QrCodeFragmentContract
+import com.wdkl.ncs.android.middleware.logic.presenter.callingdoor.QrCodeFragmentPresenter
+import kotlinx.android.synthetic.main.test_fragment_lay.camera_preview_surface
+import kotlinx.android.synthetic.main.test_fragment_lay.tv_camera
+import kotlinx.android.synthetic.main.test_fragment_lay.tv_test_info
+import kotlinx.android.synthetic.main.test_lay.*
+import org.greenrobot.eventbus.EventBus
+import org.greenrobot.eventbus.Subscribe
+import org.greenrobot.eventbus.ThreadMode
+
+
+@Router(path = "/callingdoor/text")
+class AppTextActivity :BaseActivity<QrCodeFragmentPresenter, TestLayBinding>(), QrCodeFragmentContract.View{
+    private val TAG = "AppTextActivity"
+
+    var info = ""
+    var buttonTest = false
+    var is_startTest = false
+    var testButton1 = false
+    var testButton2 = false
+    var testButton3 = false
+
+    var sosState = 0
+    var netOff = false
+
+    private var mCamera: Camera? = null
+    val colors = arrayOf(
+            Color.BLACK,
+            Color.WHITE,
+            Color.RED,
+            Color.parseColor("#FFA500"), // 橙色
+            Color.YELLOW,
+            Color.GREEN,
+            Color.CYAN,
+            Color.BLUE,
+            Color.MAGENTA
+    )
+    var colorIndex = 0
+    override fun onCreate(savedInstanceState: Bundle?) {
+        //切换语言
+        val languageId: Int = SettingConfig.getLanguageId(this)
+        LocaleMangerUtils.setApplicationLanguageByIndex(this, languageId)
+        super.onCreate(savedInstanceState)
+    }
+
+    override fun getLayId(): Int {
+        return R.layout.test_lay
+    }
+
+    override fun bindDagger() {
+        CallingdoorLaunch.component.inject(this)
+    }
+
+    override fun init() {
+        Constant.IS_TEXT = true
+        is_startTest=false
+        RecordHelper.getInstance().init()
+        SoundPoolManager.getInstance().playSound(4, 1.0f, 1.0f, 0)
+        tv_test_info.movementMethod = ScrollingMovementMethod.getInstance()
+        tv_ip.text = "IP:" + NetHelper.getInstance().localIP
+
+        startCameraPreview()
+    }
+    private var red = 0
+    var is_cm = false
+    override fun bindEvent() {
+        btn_reset.setOnClickListener {
+            SerialPortHelper.resetDevice()
+        }
+        view_title_layout_img.setOnClickListener {
+            Constant.IS_TEXT = false
+            finish()
+        }
+        btn_fist.setOnClickListener {
+            slayout.visibility = View.GONE
+            btn_fist.visibility = View.GONE
+            color_view.visibility = View.GONE
+
+        }
+
+        btn_color.setOnClickListener {
+            SoundPoolManager.getInstance().playSound(6, 1.0f, 1.0f, 0)
+            color_view.bringToFront()
+            color_view.visibility = View.VISIBLE
+            btn_fist.visibility = View.VISIBLE
+
+        }
+        color_view.setOnClickListener {
+            btn_fist.visibility = View.VISIBLE
+            color_view.setBackgroundColor(colors[colorIndex])
+            colorIndex = (colorIndex + 1) % colors.size
+        }
+        btn_cm.setOnClickListener {
+            SoundPoolManager.getInstance().playSound(7, 1.0f, 1.0f, 0)
+            is_cm=true
+            slayout.bringToFront()
+            slayout.visibility = View.VISIBLE
+            btn_fist.visibility = View.VISIBLE
+//            slayout.removeAllViews()
+//            red = ContextCompat.getColor(this, R.color.colorAccent);//指定一种颜色
+//            for (i in 0 until 9) {
+//                for (j in 0 until 5) {
+//                    val textView = TextView(this)
+//                    textView.setOnTouchListener(this) // 每个TextView都监听触摸事件
+//                    val rowSpec = GridLayout.spec(i, 1.0f) // 行坐标和比重rowweight,用float表示的
+//                    val columnSpec = GridLayout.spec(j, 1.0f) // 列坐标和columnweight
+//                    val params = GridLayout.LayoutParams(rowSpec, columnSpec)
+//                    slayout.addView(textView, params)
+//                }
+//            }
+        }
+
+        btn_net_off.setOnClickListener {
+            if (netOff) {
+                netOff = false
+                SerialPortHelper.netOff(false)
+            } else {
+                netOff = true
+                SerialPortHelper.netOff(true)
+            }
+            btn_net_off.isEnabled = false
+
+            Thread {
+                try {
+                    Thread.sleep(5000)
+
+                    activity.runOnUiThread {
+                        tv_ip.text = "IP:" + NetHelper.getInstance().localIP
+                        btn_net_off.isEnabled = true
+                    }
+
+                } catch (ex: Exception) {
+                    //
+                }
+            }.start()
+        }
+
+        btn_sos_test.setOnClickListener {
+            if (sosState == 0) {
+                sosState = 1
+                SerialPortHelper.setSosLight("1")
+                SerialPortHelper.setDoorLight(1, "111") //白色
+            } else if (sosState == 1) {
+                sosState = 2
+                SerialPortHelper.setSosLight("2")
+                //门灯红色闪烁
+                SerialPortHelper.setDoorLight(1, "200") //红色闪烁
+            } else if (sosState == 2) {
+                sosState = 3
+                SerialPortHelper.setDoorLight(1, Constant.nursingColor) //绿色
+            }else {
+                sosState = 0
+                SerialPortHelper.setSosLight("0")
+                SerialPortHelper.setDoorLight(0, "000")
+            }
+
+        }
+    }
+    private fun startTest() {
+        is_startTest=true
+        Thread {
+            info += "\r\n--> 麦克风测试:\r\n"
+            showInfo(info)
+            SoundPoolManager.getInstance().playSound(3, 1.0f, 1.0f, 0)
+            Thread.sleep(2000)
+            info += "开始录音...\r\n"
+            showInfo(info)
+            RecordHelper.getInstance().recordTestStart()
+            Thread.sleep(2500)
+            RecordHelper.getInstance().recordTestStop()
+            Thread.sleep(500)
+            info += "播放录音...\r\n"
+            showInfo(info)
+            MediaPlayHelper.getInstance().playUrlMusic(RecordHelper.getInstance().audiofilePath, 1.0f, false)
+
+            Thread.sleep(3000)
+            RecordHelper.getInstance().deleteAudioFile()
+
+            info += "--> 指示灯测试\r\n"
+            showInfo(info)
+            SerialPortHelper.setCallStatus("1")
+            Thread.sleep(2000)
+            SerialPortHelper.setCallStatus("0")
+
+            info += "===测试结束!===\r\n"
+            showInfo(info)
+            is_startTest=false
+        }.start()
+    }
+
+
+
+
+//    override fun keepScreenOn(): Boolean {
+//        return true
+//    }
+
+    private fun showInfo(text: String) {
+        activity.runOnUiThread {
+            if (tv_test_info != null) {
+                tv_test_info.text = text
+            }
+        }
+    }
+
+    private fun startCameraPreview() {
+        val num = Camera.getNumberOfCameras()
+        if (num > 0) {
+            try {
+                mCamera = Camera.open()
+            } catch (e: Exception) {
+                tv_camera.visibility = View.VISIBLE
+                tv_camera.text = "摄像头打开失败"
+                e.printStackTrace()
+                return
+            }
+
+            camera_preview_surface.getHolder().addCallback(object : SurfaceHolder.Callback {
+                override fun surfaceCreated(holder: SurfaceHolder) {
+                    /**
+                     * The SurfaceHolder must already contain a surface when this method is called.
+                     * If you are using SurfaceView, you will need to register a SurfaceHolder.Callback
+                     * with SurfaceHolder#addCallback(SurfaceHolder.Callback) and wait for
+                     * SurfaceHolder.Callback#surfaceCreated(SurfaceHolder) before
+                     * calling setPreviewDisplay() or starting preview.
+                     * 相机的预览必须在surfaceCreated后调用,否则黑屏且没有任何提示哦
+                     */
+
+                    try {
+                        mCamera!!.setPreviewDisplay(camera_preview_surface.getHolder())
+                        mCamera!!.startPreview()
+                    } catch (e: Exception) {
+                        e.printStackTrace()
+                    }
+                }
+
+                override fun surfaceChanged(
+                        holder: SurfaceHolder,
+                        format: Int,
+                        width: Int,
+                        height: Int
+                ) {
+                    //
+                }
+
+                override fun surfaceDestroyed(holder: SurfaceHolder) {
+                    //
+                }
+            })
+        } else {
+            tv_camera.visibility = View.VISIBLE
+            tv_camera.text = "没有摄像头"
+        }
+    }
+
+    override fun onStart() {
+        EventBus.getDefault().register(this)
+        super.onStart()
+    }
+
+    override fun onStop() {
+        EventBus.getDefault().unregister(this)
+        super.onStop()
+    }
+
+    override fun destory() {
+        if (mCamera != null) {
+            mCamera!!.stopPreview()
+            mCamera!!.release()
+            mCamera = null
+        }
+
+        SOSHelper.sosStop()
+    }
+
+    override fun onError(message: String, type: Int) {
+        //
+    }
+
+    override fun complete(message: String, type: Int) {
+    }
+
+    override fun start() {
+    }
+
+    override fun networkMonitor(state: NetState) {
+        state.filter(onWifi = {
+
+        }, onMobile = {
+
+        }, offline = {
+
+        })
+    }
+
+    override fun setUrlString(url: String) {
+        //
+    }
+
+//    override fun onTouchEvent(event: MotionEvent): Boolean {
+//        when (event.action) {
+//            MotionEvent.ACTION_DOWN -> {
+//                if (is_cm){
+//                    slayout.setBackgroundColor(Color.RED)
+//                }
+//                return true
+//            }
+//            MotionEvent.ACTION_MOVE -> {}
+//            MotionEvent.ACTION_UP -> {}
+//        }
+//        return false
+//    }
+
+
+
+
+    @Subscribe(threadMode = ThreadMode.MAIN)
+    fun onMoonEvent(messageEvent: MessageEvent) {
+        if (Constant.EVENT_SERIAL_TEST == messageEvent.type) {
+            if (!buttonTest) {
+                val message = messageEvent.message as String
+                if (message == "call1" && !testButton1) {
+                    info += " #面板呼叫键# "
+                    testButton1 = true
+                } else if (message == "call2" && !testButton2) {
+                    info += " #手柄按键# "
+                    testButton2 = true
+                } else if (message == "call_end" && !testButton3) {
+                    info += " #面板挂断键# "
+                    testButton3 = true
+                } else if (message == "call_sos") {
+                    info += " #SOS键# "
+                }
+
+                showInfo(info)
+                if (testButton1 && testButton2 && testButton3) {
+                    buttonTest = true
+                }else{
+                    if (!is_startTest){
+                        startTest()
+                    }
+                }
+            }
+        }
+    }
+
+//    override fun onTouch(v: View?, event: MotionEvent?): Boolean {
+//        when (event?.action) {
+//            MotionEvent.ACTION_DOWN -> {
+//                if (is_cm){
+//                    v?.setBackgroundColor(Color.RED)
+//                }
+//                return true
+//            }
+//            MotionEvent.ACTION_MOVE -> {}
+//            MotionEvent.ACTION_UP -> {}
+//        }
+//        return false
+//    }
+}

+ 19 - 9
android_door/src/main/h10_3128/java/com/wdkl/app/ncs/callingdoor/activity/CallingdoorActivity.kt

@@ -500,9 +500,10 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
 
     //测试模式
     fun startTestMode() {
-        if (!testFragment.equals(curFragment)) {
-            switchFragment(R.id.callingdoor_main_frame, TestFragment(), testFragment)
-        }
+        push("/callingdoor/text")
+//        if (!testFragment.equals(curFragment)) {
+//            switchFragment(R.id.callingdoor_main_frame, TestFragment(), testFragment)
+//        }
     }
 
     fun switchFragment(id: Int, fragment: Fragment, tag: String) {
@@ -1174,10 +1175,12 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
     override fun serialPortBedOnclick(buffer: ByteArray) {
         Log.d("serialPortBedOnclick", "按键: buffer[0]=" + buffer[0] + ", buffer[7]=" + buffer[7])
         //测试模式
-        if (testFragment == curFragment) {
+        if (testFragment == curFragment || Constant.IS_TEXT) {
             if (buffer[0].toInt() == 1 || buffer[0].toInt() == 2
                 || buffer[5].toInt() == 1 || buffer[5].toInt() == 2) {
-                EventBus.getDefault().post(MessageEvent("call", Constant.EVENT_SERIAL_TEST))
+                EventBus.getDefault().post(MessageEvent("call1", Constant.EVENT_SERIAL_TEST))
+            } else if (buffer[7].toInt() == 1 || buffer[7].toInt() == 2) {
+                EventBus.getDefault().post(MessageEvent("call_sos", Constant.EVENT_SERIAL_TEST))
             }
             return
         }
@@ -1775,8 +1778,12 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
             //当前是白天并且原来不是白天
             if (Constant.day_state != 0 || forceSet) {
                 //设置白天亮度
-                //ScreenManagerUtil().setScreenBrightness(this, Math.ceil(2.54 * SettingConfig.getDaytimeBrightness(this)).toInt())
-                zhylManager.disp_setLcdBackLight(getContentResolver(),Math.ceil(2.54 * SettingConfig.getDaytimeBrightness(this)).toInt(),1)
+                if ("mk_h10_a133_1".equals(BuildConfig.APP_DEVICE_TYPE)) {
+                    zhylManager.disp_setLcdBackLight(getContentResolver(),Math.ceil(2.54 * SettingConfig.getDaytimeBrightness(this)).toInt(),1)
+                }else{
+                    ScreenManagerUtil().setScreenBrightness(this, Math.ceil(2.54 * SettingConfig.getDaytimeBrightness(this)).toInt())
+                }
+
                 //设置白天系统音量和响铃音
                 VoiceManagerUtil.setSystemVoice(this, SettingConfig.getDoorDaytimeSystemVolume(this))
                 VoiceManagerUtil.setMusicVoice(this, SettingConfig.getDoorDaytimeSystemVolume(this))
@@ -1792,8 +1799,11 @@ class CallingdoorActivity :BaseActivity<CallingdoorActivityPresenter, Callingdoo
             //当前是夜晚并且原来不是夜晚
             if (Constant.day_state != 1 || forceSet) {
                 //设置晚上亮度
-                //ScreenManagerUtil().setScreenBrightness(this, Math.ceil(2.54 * SettingConfig.getNightBrightness(this)).toInt())
-                zhylManager.disp_setLcdBackLight(getContentResolver(),Math.ceil(2.54 * SettingConfig.getNightBrightness(this)).toInt(),1)
+                if ("mk_h10_a133_1".equals(BuildConfig.APP_DEVICE_TYPE)) {
+                 zhylManager.disp_setLcdBackLight(getContentResolver(),Math.ceil(2.54 * SettingConfig.getNightBrightness(this)).toInt(),1)
+                }else{
+                    ScreenManagerUtil().setScreenBrightness(this, Math.ceil(2.54 * SettingConfig.getNightBrightness(this)).toInt())
+                }
                 //设置晚上系统音量和响铃音
                 VoiceManagerUtil.setSystemVoice(this, SettingConfig.getDoorNightSystemVolume(this))
                 VoiceManagerUtil.setMusicVoice(this, SettingConfig.getDoorNightSystemVolume(this))

+ 3 - 0
android_door/src/main/h10_3128/java/com/wdkl/app/ncs/callingdoor/di/CallingdoorComponent.kt

@@ -1,5 +1,6 @@
 package com.wdkl.app.ncs.callingdoor.di
 
+import com.wdkl.app.ncs.callingbed.activity.AppTextActivity
 import com.wdkl.app.ncs.callingdoor.activity.AppUpdateActivity
 import com.wdkl.app.ncs.callingdoor.activity.CallingdoorActivity
 import com.wdkl.app.ncs.callingdoor.fragment.*
@@ -12,6 +13,8 @@ interface CallingdoorComponent {
 
     fun inject(activity: AppUpdateActivity)
 
+    fun inject(activity: AppTextActivity)
+
     fun inject(fragment: MainFragment)
 
     fun inject(fragment: QrCodeFragment)

+ 63 - 0
android_door/src/main/h10_3128/java/com/wdkl/app/ncs/callingdoor/helper/DrawingView.java

@@ -0,0 +1,63 @@
+package com.wdkl.app.ncs.callingdoor.helper;
+
+import android.content.Context;
+import android.graphics.Canvas;
+import android.graphics.Color;
+import android.graphics.Paint;
+import android.graphics.Path;
+import android.util.AttributeSet;
+import android.view.MotionEvent;
+import android.view.View;
+
+public class DrawingView extends View {
+    private Paint paint;
+    private Path path;
+
+    public DrawingView(Context context) {
+        super(context);
+        init();
+    }
+
+    public DrawingView(Context context, AttributeSet attrs) {
+        super(context, attrs);
+        init();
+    }
+
+    private void init() {
+        paint = new Paint();
+        paint.setColor(Color.RED);
+        paint.setStyle(Paint.Style.STROKE);
+        paint.setStrokeWidth(20);
+
+        path = new Path();
+    }
+
+    @Override
+    protected void onDraw(Canvas canvas) {
+        super.onDraw(canvas);
+        canvas.drawPath(path, paint);
+    }
+
+    @Override
+    public boolean onTouchEvent(MotionEvent event) {
+        float x = event.getX();
+        float y = event.getY();
+
+        switch (event.getAction()) {
+            case MotionEvent.ACTION_DOWN:
+                path.moveTo(x, y);
+                break;
+            case MotionEvent.ACTION_MOVE:
+                path.lineTo(x, y);
+                break;
+            case MotionEvent.ACTION_UP:
+                // 可以在此处进行一些额外的操作
+                break;
+        }
+
+        invalidate(); // 刷新视图
+
+        return true;
+    }
+}
+

+ 17 - 1
android_door/src/main/h10_3128/java/com/wdkl/app/ncs/callingdoor/helper/SerialPortHelper.java

@@ -31,7 +31,15 @@ public class SerialPortHelper {
             }
         //}
     }
-
+    /*
+     * 呼叫和通话状态
+     * data: 0 -- 正常,  1 -- 呼叫中, 2 -- 通话中
+     */
+    public static void setCallStatus(String data) {
+        //if (Build.MODEL.equals("rk3128")) {
+        SerialPortUtil.getInstance().sendCommand(SerialPortUtil.CALL_STATUS, data, "F");
+        //}
+    }
     /**
      * 门灯控制开关
      *
@@ -66,4 +74,12 @@ public class SerialPortHelper {
             SerialPortUtil.getInstance().systemRestart();
         }
     }
+    //网卡断电
+    public static void netOff(boolean off) {
+        if (off) {
+            SerialPortUtil.getInstance().sendCommand(SerialPortUtil.RTLRESET, "1", "F");
+        } else {
+            SerialPortUtil.getInstance().sendCommand(SerialPortUtil.RTLRESET, "0", "F");
+        }
+    }
 }

+ 3 - 0
android_door/src/main/h10_3128/java/com/wdkl/app/ncs/callingdoor/helper/SoundPoolManager.java

@@ -53,6 +53,9 @@ public class SoundPoolManager {
         soundID.put(3, soundPool.load(BaseApplication.appContext, R.raw.mic_test, 1));
         soundID.put(4, soundPool.load(BaseApplication.appContext, R.raw.test_start, 1));
         soundID.put(5, soundPool.load(BaseApplication.appContext, R.raw.reinforced, 1));
+
+        soundID.put(6, soundPool.load(BaseApplication.appContext, R.raw.test_start2,  1));
+        soundID.put(7, soundPool.load(BaseApplication.appContext, R.raw.test_start3,  1));
         soundPool.setOnLoadCompleteListener(new SoundPool.OnLoadCompleteListener() {
             @Override
             public void onLoadComplete(SoundPool soundPool, int sampleId, int status) {

+ 6 - 0
android_door/src/main/h10_3128/res/drawable/shape_main_hos_txt_bg.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="#ff3a78ef" />
+    <corners
+        android:radius="18dp" />
+</shape>

+ 189 - 0
android_door/src/main/h10_3128/res/layout/test_lay.xml

@@ -0,0 +1,189 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layout>
+<RelativeLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical"
+    android:background="@color/white"
+    >
+
+    <RelativeLayout
+        android:id="@+id/text_top"
+        android:layout_width="match_parent"
+        android:layout_height="50dp"
+        android:background="@color/main_color"
+        >
+        <LinearLayout
+            android:id="@+id/view_title_layout_img"
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:gravity="center"
+            android:clickable="true"
+            >
+        <ImageView
+
+            android:layout_width="15dp"
+            android:layout_height="25dp"
+            android:layout_marginLeft="30dp"
+            android:clickable="true"
+            android:background="@mipmap/integ_arrow_icon"
+            android:layout_centerVertical="true"
+            />
+        </LinearLayout>
+
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:textSize="28sp"
+            android:text="测试界面"
+            android:layout_centerHorizontal="true"
+            android:layout_centerVertical="true"
+            android:textColor="@color/white"/>
+
+
+    </RelativeLayout>
+
+
+
+    <com.wdkl.app.ncs.callingdoor.helper.DrawingView
+        android:id="@+id/slayout"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:background="@color/white"
+        android:visibility="gone"
+        />
+
+    <View
+        android:id="@+id/color_view"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:background="@color/black"
+        android:clickable="true"
+        android:visibility="gone"
+        />
+    <!--<Button
+        android:id="@+id/btn_test"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="Start"
+        android:textSize="28sp"/>-->
+
+    <LinearLayout
+        android:id="@+id/text_mian"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:orientation="vertical"
+        android:layout_below="@+id/text_top"
+        >
+        <RelativeLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content">
+            <SurfaceView
+                android:id="@+id/camera_preview_surface"
+                android:layout_width="160dp"
+                android:layout_height="160dp" />
+
+            <Button
+                android:id="@+id/btn_sos_test"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_margin="10dp"
+                android:layout_toRightOf="@id/camera_preview_surface"
+                android:text="门灯"
+                android:textSize="28sp"/>
+
+            <Button
+                android:id="@+id/btn_reset"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_margin="10dp"
+                android:layout_toRightOf="@id/btn_sos_test"
+                android:text="重置"
+                android:textSize="28sp"/>
+
+            <Button
+                android:id="@+id/btn_net_off"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_margin="10dp"
+                android:layout_toRightOf="@id/btn_reset"
+                android:text="网络开关"
+                android:textSize="28sp"/>
+
+            <Button
+                android:id="@+id/btn_color"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_margin="10dp"
+                android:layout_toRightOf="@id/btn_net_off"
+                android:text="屏幕颜色"
+                android:textSize="28sp"/>
+
+            <Button
+                android:id="@+id/btn_cm"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_margin="10dp"
+                android:layout_toRightOf="@id/btn_color"
+                android:text="屏幕触摸"
+                android:textSize="28sp"/>
+
+            <TextView
+                android:id="@+id/tv_ip"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="10dp"
+                android:layout_toRightOf="@id/camera_preview_surface"
+                android:layout_below="@id/btn_reset"
+                android:textSize="20sp"
+                android:text="IP:"/>
+        </RelativeLayout>
+
+        <TextView
+            android:id="@+id/tv_camera"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="10dp"
+            android:textSize="20sp"
+            android:visibility="gone"/>
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="10dp"
+            android:textSize="28sp"
+            android:text="请按任意按键开始测试"
+            android:textColor="@color/red_color"/>
+
+        <TextView
+            android:id="@+id/tv_test_info"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="10dp"
+            android:textSize="24sp"/>
+    </LinearLayout>
+
+    <Button
+        android:id="@+id/btn_fist"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:padding="10dp"
+        android:layout_alignParentBottom="true"
+        android:layout_centerHorizontal="true"
+        android:textColor="@color/white"
+        android:text="退出测试"
+        android:background="@drawable/shape_main_hos_txt_bg"
+        android:textSize="28sp"
+        android:visibility="gone"/>
+
+
+
+
+
+
+
+
+</RelativeLayout>
+</layout>

BIN
android_door/src/main/h10_3128/res/mipmap-mdpi/integ_arrow_icon.png


BIN
android_door/src/main/h10_3128/res/mipmap-xhdpi/integ_arrow_icon.png


BIN
android_door/src/main/h10_3128/res/mipmap-xxhdpi/integ_arrow_icon.png


BIN
android_door/src/main/h10_3128/res/raw/test_start2.mp3


BIN
android_door/src/main/h10_3128/res/raw/test_start3.mp3


+ 3 - 1
bedlib/src/main/java/serialporttest/utils/SerialPortUtil.java

@@ -109,7 +109,7 @@ public class SerialPortUtil {
                         int size = inputStream.read(buffer);
                         if (size > 0 && isOpenSerialPortUtil) {
                             data = new String(buffer, 0, size);
-                            //Log.d("aaaa", "data==" + data);
+                            Log.d("aaaa", "data==" + data);
 
                             if (systemVersionIsO()) {//安卓7.0.1 or 8.1.0 版用
                                 //addByData(data);//my do
@@ -504,6 +504,8 @@ public class SerialPortUtil {
      */
     public static final String NET_STATUS = "NETRESET";
 
+    public static final String RTLRESET = "RTLRESET";
+
     /**
      * 心跳控制<br>
      * 若MCU在10秒内没有收到信号,将自动重启Android.  随机数为“W”时将关闭心跳<br>

+ 2 - 2
build.gradle

@@ -44,11 +44,11 @@ buildscript {
      */
     ext.support_library_version = "28.0.0"
 
-    ext.app_device_type = "mk_h10_a133_1"
+    ext.app_device_type = "mk_h10_z_3128_1"
 
     if (app_device_type == "mk_h10_z_3128_1") {
         //rk3128 10寸门口机
-        ext.app_version_code = 57
+        ext.app_version_code = 58
         ext.app_version = "1.2.8"
     } else if (app_device_type == "mk_h10_a133_1") {
         //志合a133 10寸门口机

+ 2 - 0
middleware/src/main/code/com/wdkl/ncs/android/middleware/common/Constant.java

@@ -12,6 +12,8 @@ public class Constant {
 
     //数据接口端口:
     public static int URL_PORT = 8006;
+    //1--测试模式
+    public  static boolean IS_TEXT = false;
 
     //TCP服务端口
     public static int TCP_PORT = 5080;