From ff3a882198b17860d0ab1602c489f68ccb957f95 Mon Sep 17 00:00:00 2001 From: xuxiuxi <xuxiuxi@454eff88-639b-444f-9e54-f578c98de674> Date: 星期三, 19 七月 2017 17:26:28 +0800 Subject: [PATCH] --- VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/DeviceMng.java | 22 +++++++++++++++------- 1 files changed, 15 insertions(+), 7 deletions(-) diff --git a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/DeviceMng.java b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/DeviceMng.java index 83d99d9..2e8b6e7 100644 --- a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/DeviceMng.java +++ b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/DeviceMng.java @@ -8,6 +8,7 @@ import cn.com.basic.face.base.MainActivity; import cn.com.basic.face.discern.common.CommonVariables; import cn.com.basic.face.fragment.DeviceFragment; +import cn.com.basic.face.service.sqlite.AttendanceDao; import cn.com.basic.face.util.AppApi; import org.xutils.http.RequestParams; @@ -35,6 +36,7 @@ public void run() { try { while (true) { + AttendanceDao.getInstance().reloadLeftList(null, 0, false); if (!BaseApplication.getInstance().deviceAvailable) { load (); } else { @@ -62,11 +64,12 @@ // return; // } RequestParams params = new RequestParams(AppApi.BASE_URL + AppApi.Query.DEVICE_QUERY); + params.addBodyParameter(Device.FieldNames.sn, authorationId); params.addBodyParameter(Device.FieldNames.type, CommonVariables.DeviceType.ANDROID_DEVICE); x.http().post(params, new BaseCommonCallBack() { public void success() { - List<Device> devices = resultBean.getListBeanOfType(Device.class); + List<Device> devices = resultBean.getList(Device.class); if (devices.size() > 0) { final Device device = devices.get(0); BaseApplication.getInstance().setAndroidDevice(device); @@ -80,7 +83,7 @@ params.addBodyParameter(Device.FieldNames.type, CommonVariables.DeviceType.CAMERA1); x.http().post(params, new BaseCommonCallBack() { public void success() { - List<Device> devices = resultBean.getListBeanOfType(Device.class); + List<Device> devices = resultBean.getList(Device.class); if (devices.size() > 0) { final Device camera1 = devices.get(0); BaseApplication.getInstance().setCamera1(camera1); @@ -95,7 +98,7 @@ params.addBodyParameter(Device.FieldNames.type, CommonVariables.DeviceType.CAMERA2); x.http().post(params, new BaseCommonCallBack() { public void success() { - List<Device> devices = resultBean.getListBeanOfType(Device.class); + List<Device> devices = resultBean.getList(Device.class); if (devices.size() > 0) { final Device camera2 = devices.get(0); BaseApplication.getInstance().setCamera2(camera2); @@ -134,7 +137,7 @@ // params.addBodyParameter(Device.FieldNames.type, CommonVariables.DeviceType.ANDROID_DEVICE); // x.http().post(params, new BaseCommonCallBack() { // public void success() { -// List<Device> places = resultBean.getListBeanOfType(Device.class); +// List<Device> places = resultBean.getList(Device.class); // if (places.size() > 0) { // BaseApplication.getInstance().setAndroidDevice(places.get(0)); // } else { @@ -188,7 +191,9 @@ // port = camera1.getString("fragment_device_right_camera1_port", ""); // } - return "rtsp://"+username+":"+password+"@"+ip+":"+port+"/h264/ch1/sub/av_stream"; +// return "rtsp://"+username+":"+password+"@"+ip+":"+port+"/h264/ch1/sub/av_stream"; +// return "rtsp://Admin:1234@192.168.1.22/h264"; + return "rtsp://admin:a1234567@192.168.1.132:554/h264/ch1/sub/av_stream"; } public String getCamera2Address() { @@ -207,11 +212,14 @@ // if (!"".equals(camera1.getString("fragment_device_right_camera1_ip", ""))) { // ip = camera1.getString("fragment_device_right_camera1_ip", ""); // } -// if (!"".equals(camera1.getString("fragment_device_right_camera1_port", ""))) { +// if (!"".equals(camera1.getString("fragment_device_right_camera1_port", ? +// ""))) { // port = camera1.getString("fragment_device_right_camera1_port", ""); // } - return "rtsp://"+username+":"+password+"@"+ip+":"+port+"/h264/ch1/sub/av_stream"; + //return "rtsp://"+username+":"+password+"@"+ip+":"+port+"/h264/ch1/sub/av_stream"; +// return "rtsp://admin:a1234567@192.168.1.68:554/h264/ch1/main/av_stream"; + return "rtsp://admin:a1234567@192.168.1.69:554/h264/ch1/sub/av_stream"; } } -- Gitblit v1.8.0