lss
2022-05-17 49248e3bdff0458f8f6f4156d1425bd6f6074e32
HDL_ON/Common/ApiUtlis.cs
@@ -153,16 +153,34 @@
                        MainPage.Log($"读取房间数据失败:Code:{roomResult.Code}; msg:{roomResult.message}");
                    }
                    //===================设备=======================
                    var deviceResult = Ins.HttpRequest.GetDeviceList();
                    var deviceResult = Ins.HttpRequest.GetDeviceList("30","1");
                    if (deviceResult.Code == StateCode.SUCCESS)
                    {
                        endTime = DateTime.Now.AddSeconds(100);
                        endTime = DateTime.Now.AddSeconds(5);
                        MainPage.Log($"读取设备信息成功");
                        var deviceList = Newtonsoft.Json.JsonConvert.DeserializeObject<DevcieApiPack>(deviceResult.Data.ToString());
                        if (deviceList == null)
                        {
                            deviceList = new DevcieApiPack();
                        }
                        try
                        {
                            while (deviceList.totalPage != deviceList.pageNo)
                            {
                                var deviceResult2 = Ins.HttpRequest.GetDeviceList("30", Convert.ToInt32(deviceList.pageNo) + 1 + "");
                                if (deviceResult2.Code == StateCode.SUCCESS)
                                {
                                    var deviceList2 = Newtonsoft.Json.JsonConvert.DeserializeObject<DevcieApiPack>(deviceResult.Data.ToString());
                                    deviceList.pageNo = deviceList2.pageNo;
                                    deviceList.list.AddRange(deviceList2.list);
                                }
                            }
                        }catch(Exception ex)
                        {
                        }
                        string delFile = "";
                        if (FunctionList.List.GetDeviceFunctionList().Count > 0)
                        {
@@ -170,11 +188,11 @@
                            for (int i = 0; i < FunctionList.List.GetDeviceFunctionList().Count;)
                            {
                                var localFunction = FunctionList.List.GetDeviceFunctionList()[i];
                                if (SPK.MusicSpkList().Contains(localFunction.spk))
                                {
                                    i++;
                                    continue;
                                }
                                //if (SPK.MusicSpkList().Contains(localFunction.spk))
                                //{
                                //    i++;
                                //    continue;
                                //}
                                var newFunction = deviceList.list.Find((obj) => obj.deviceId == localFunction.deviceId);
                                if (delFile == localFunction.savePath)
@@ -266,7 +284,8 @@
                    //======================获取可视对讲设备列表====================
                    bool isInterphoneType_HDL = false;//是否为HDLLinphone可视对讲
                    var videoInfo= VideoSend.GetVideoInfoList();
                    bool isInterphoneType_FREEVIEW = false;//是否为全视通可视对讲
                    var videoInfo = VideoSend.GetVideoInfoList();
                    if (videoInfo.Code == StateCode.SUCCESS)
                    {
                        string videoList = videoInfo.Data.ToString();
@@ -281,6 +300,17 @@
                                isInterphoneType_HDL = true;
                                DB_ResidenceData.Instance.SupportFacePass = true;
                                DB_ResidenceData.Instance.SaveResidenceData();
                                Entity.DB_ResidenceData.Instance.SupportFVDevice = true;
                            }
                            else if (video.interphoneType == InterphoneType.FREEVIEW.ToString())
                            {//为全视通可视对讲
                                Entity.DB_ResidenceData.Instance.SupportVisitorManage = true;
                                Entity.DB_ResidenceData.Instance.SupportFVDevice = true;
                                isInterphoneType_FREEVIEW = true;
                            }
                        }
                    }
@@ -293,14 +323,24 @@
                        {
                            //HDLLinphone可视对讲,获取Sip账号并初始化SDK
                            HDLLinphone.Current.GetHDLSipInfoAndInitSDK(DB_ResidenceData.Instance.CurrentRegion.id);
                        }
                        else
                        {
                            Utlis.WriteLine("当前住宅不支持HDL可视对讲,退出登录所有账号");
                            //当前住宅不支持HDL可视对讲
                            HDLLinphone.Current.LogoutAllAccount();
                        }
                    }
                    //======================登录全视通====================
                    if (isInterphoneType_FREEVIEW)
                    {
                        //登录全视通
                        Shared.IOS.HDLFVSDK.Video.Init("", DB_ResidenceData.Instance.CurrentRegion.id);
                    }
                    //======================安防====================
                    GetSecurityList();
@@ -369,8 +409,6 @@
                    if (DB_ResidenceData.Instance.CurrentRegion != null)
                    {
                        #region 读取本地数据
                        //读取音乐信息
                        UI.Music.A31MusicModel.ReadMusicStates();
                        //搜索网关
                        DriverLayer.Control.Ins.SearchLoaclGateway();
                        //重新连接mqtt