xxx
yy1717
2020-11-25 8c69444d8129193511eca990b6d97be5c36232ea
xxx
2个文件已修改
22 ■■■■ 已修改文件
app/src/main/java/safeluck/drive/evaluation/MainActivity.java 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/safeluck/drive/evaluation/app.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/safeluck/drive/evaluation/MainActivity.java
@@ -93,6 +93,7 @@
    private ScheduledExecutorService scheduledExecutorService = Executors.newSingleThreadScheduledExecutor();
   private AuthMapViewmodel authMapViewmodel;
    String des ="蓝牙关闭";
    private ICEventListener icEventListener = new ICEventListener() {
        @Override
        public void onCEvent(String topic, int msgCode, int resultCode, Object obj) {
@@ -117,10 +118,12 @@
            if (msgCode == Constant.ID_SM_BLUETOOTH_BRIEF){
                if (tv_ble_status != null){
                    try {
                        JSONObject jsonObject = new JSONObject((String) obj);
                        int bleStatus = jsonObject.getInt("bluetooth_stauts");
                        String mac = jsonObject.getString("bluetooth_addr");
                        String des ="蓝牙关闭";
                        String str = (String) obj;
                        Log.i(TAG,"shou=="+str);
                        JSONObject jsonObject = new JSONObject(str);
                        int bleStatus = jsonObject.getInt("bluetooth_status");
                        switch (bleStatus){
                            case 0:
                                des ="蓝牙关闭";
@@ -134,10 +137,17 @@
                            case 3:
                                authMapViewmodel.setAuthValue(3);
                                des ="蓝牙连接";
                                String mac = jsonObject.getString("bluetooth_addr");
                                SPUtils.put(getApplicationContext(),SPUtils.BLUETOOTH_MAC,mac);
                                break;
                        }
                        tv_ble_status.setText(des);
                        tv_ble_status.post(new Runnable() {
                            @Override
                            public void run() {
                                tv_ble_status.setText(des);
                            }
                        });
                    } catch (JSONException e) {
                        e.printStackTrace();
                    }
app/src/main/java/safeluck/drive/evaluation/app.java
@@ -138,7 +138,7 @@
            //发送蓝牙配置消息
            String mac= (String) SPUtils.get(getAppContext(),SPUtils.BLUETOOTH_MAC,"");
            if (!TextUtils.isEmpty(mac)){
                AYSdk.getInstance().sendCmd(Constant.ID_MS_BLUETOOTH_NAME,mac);
            }