| | |
| | | public string currentUserDisplayMethod = string.Empty;//当前用户显示方式 |
| | | //本地所有账户列表 |
| | | public List<Shared.Phone.UserCenter.MemberInfoRes> localAllAccountList = new List<Shared.Phone.UserCenter.MemberInfoRes> { }; |
| | | |
| | | /// <summary> |
| | | /// 是否常开模式[当数据获取失败,返回空] |
| | | /// 是否常开模式 |
| | | /// ture:常开; false:关闭 |
| | | /// </summary> |
| | | public Dictionary<string, bool> IsDoorLockNormallyMode = new Dictionary<string, bool> { };//是否冻结子账户 |
| | | public bool IsDoorLockNormallyMode = false; |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | public string LocalTempPassword = string.Empty;//本地生成的临时密码 |
| | | public Dictionary<string, bool> IsFreezeAccount = new Dictionary<string, bool> { };//是否冻结子账户 |
| | | public Dictionary<string, bool> HasRemoteUnlockAccess = new Dictionary<string, bool> { };//是否给子账户拥有远程开锁的条件 |
| | | public Dictionary<string, bool> IsFailedToGetDoorLockInfo = new Dictionary<string, bool> { };//是否获取门锁数据失败 |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | public string RemoteUnlockPassword = string.Empty;//远程开锁密码 |
| | | |
| | | public static int RemoteUnlockCount = 5;//远程开锁次数限制 |
| | | public static int failedCount = 3;//远程开锁失败次数 |
| | | public static DateTime maxValue = DateTime.MaxValue; |
| | | public static DateTime minValue = DateTime.MinValue; |
| | | |
| | | #region 临时密码信息 |
| | | /// <summary> |
| | | /// 用户管理发送数据回复 |
| | | /// </summary> |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | public TempPasswordObject tempPasswordObject; |
| | | /// <summary> |
| | | /// 临时密码本地对象 |
| | |
| | | //访问接口 |
| | | if (UserCenterResourse.UserInfo.AuthorityNo == 1) |
| | | { |
| | | result1 = await CommonPage.Instance.RequestHttpsZigbeeBytesResultAsync(RequestName, byteData); |
| | | result1 = CommonPage.Instance.RequestHttpsZigbeeBytesResultAsync(RequestName, byteData); |
| | | } |
| | | else |
| | | { |
| | | result1 = await CommonPage.Instance.RequestZigbeeHttpsByAdmin(RequestName, byteData); |
| | | result1 = CommonPage.Instance.RequestZigbeeHttpsByAdmin(RequestName, byteData); |
| | | } |
| | | if (result1 != null) |
| | | { |
| | |
| | | return await System.Threading.Tasks.Task.Run((Func<System.Threading.Tasks.Task<List<Shared.Phone.UserCenter.MemberInfoRes>>>)(async () => |
| | | { |
| | | var pra = new Shared.Phone.UserCenter.MemberListInfoPra(); |
| | | string result = await UserCenterLogic.GetResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountByDistributedMark", false, pra); |
| | | string result = UserCenterLogic.GetResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountByDistributedMark", false, pra); |
| | | if (result == null) |
| | | { |
| | | return null; |
| | | } |
| | | var listInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Shared.Phone.UserCenter.MemberInfoRes>>(result); |
| | | return listInfo; |
| | | })); |
| | |
| | | /// <summary> |
| | | /// 门锁操作事件通知 |
| | | /// </summary> |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | public DoorLockOperatingEventNotificationCommand doorLockOperatingEventNotificationCommand; |
| | | /// <summary> |
| | | /// 门锁操作事件通知 |
| | |
| | | /// <summary> |
| | | /// 门锁编程事件通知 |
| | | /// </summary> |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | public DoorLockProgrammingEventNotificationCommand doorLockProgrammingEventNotificationCommand; |
| | | /// <summary> |
| | | /// 门锁编程事件通知 |
| | |
| | | /// <summary> |
| | | /// 编程事件触发源 |
| | | /// 常用: |
| | | /// 0:Keypad(键盘/密码);3:RFID(射频卡);15:指纹 |
| | | /// 0:Keypad(键盘/密码);3:RFID(射频卡);15:指纹 58:face 59:静脉 |
| | | ///不常用: |
| | | /// 1:RF(Zigbee无线);2:Manual(手动);255:Indeterminate(不确定) |
| | | /// </summary> |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "SetWritableValue_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; |
| | | var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<SetWritableValueResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (tempData == null) |
| | |
| | | }); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 网关版本信息,网关反馈信息 |
| | | /// </summary> |
| | | public SetWritableValueResponAllData setWritableValueResponAllData; |
| | | /// <summary> |
| | | /// 网关版本信息,网关反馈信息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class SetWritableValueResponAllData |
| | | { |
| | | /// <summary> |
| | | /// 错误信息 |
| | | /// </summary> |
| | | public string errorMessageBase; |
| | | /// <summary> |
| | | /// 网关信息错误反馈 |
| | | /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para> |
| | | /// </summary> |
| | | public ErrorResponData errorResponData; |
| | | /// <summary> |
| | | /// 网关版本信息 |
| | | /// </summary> |
| | | public SetWritableValueResponData setWritableValueResponData; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置可写属性的值的数据 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class SetWritableValueResponData |
| | | { |
| | | /// <summary> |
| | | /// 配置属性所在的cluster |
| | | /// </summary> |
| | | public int Cluster; |
| | | /// <summary> |
| | | /// 0:配置成功(若配置成功,下面的AttributeId字段不存在) |
| | | ///<para>134:不支持该属性</para> |
| | | ///<para>135:无效的属性值</para> |
| | | ///<para>141:无效的数据类型</para> |
| | | /// </summary> |
| | | public int Status; |
| | | |
| | | } |
| | | #endregion |
| | | #endregion |
| | | |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | |
| | | } |
| | | if (topic == gatewayID + "/" + "ZbDataPassthrough") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; |
| | | gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); |
| | | var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); |
| | | |
| | | if (gatewayTemp.clientDataPassthroughResponseData == null) |
| | | if (clientDataPassthroughResponseData == null) |
| | | { |
| | | result = new DefaultControlResponseAllData { errorMessageBase = "网关返回的数据为空" }; |
| | | } |
| | | else |
| | | {
|
| | | if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null) |
| | | { |
| | | if (clientDataPassthroughResponseData?.PassData != null) |
| | | { |
| | | var data = gatewayTemp.clientDataPassthroughResponseData.PassData; |
| | | var data = clientDataPassthroughResponseData.PassData; |
| | | if (data.Length == 16) |
| | | { |
| | | var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString(); |
| | |
| | | var sbString = new System.Text.StringBuilder(); |
| | | foreach (var userId in userIdList) |
| | | { |
| | | string temp = Convert.ToString(userId, 16); |
| | | switch (temp.Length) |
| | | var tempBytes = new byte[2]; |
| | | for (int i = 0; i < 2; i++) |
| | | { |
| | | case 1: |
| | | userIdStr = "0" + temp + "00"; |
| | | break; |
| | | case 2: |
| | | userIdStr = temp + "00"; |
| | | break; |
| | | case 3: |
| | | var thirdBit = temp.Substring(temp.Length - 2, 1); |
| | | userIdStr = temp + "0" + thirdBit; |
| | | break; |
| | | case 4: |
| | | userIdStr = temp; |
| | | break; |
| | | tempBytes[i] = (byte)(userId >> (i * 8) & 0xff); |
| | | } |
| | | sbString.Append(userIdStr.ToString().ToUpper()); |
| | | var curV1 = Convert.ToString(tempBytes[0], 16); |
| | | var curV2 = Convert.ToString(tempBytes[1], 16); |
| | | if (curV1.Length == 1) |
| | | { |
| | | curV1 = "0" + curV1; |
| | | } |
| | | if (curV2.Length == 1) |
| | | { |
| | | curV2 = "0" + curV2; |
| | | } |
| | | |
| | | userIdStr = (curV1 + curV2).ToUpper(); |
| | | } |
| | | data = dataLength + dataComand1 + dataComand2 + dataSerialNum + addDataLength + |
| | | delUserTypeStr + sbString; |
| | | delUserTypeStr + userIdStr; |
| | | } |
| | | catch { }; |
| | | |
| | |
| | | delUserTypeStr = "21"; |
| | | break; |
| | | } |
| | | var sbString = new System.Text.StringBuilder(); |
| | | string temp = Convert.ToString(userId, 16); |
| | | |
| | | switch (temp.Length) |
| | | var tempBytes = new byte[2]; |
| | | for (int i = 0; i < 2; i++) |
| | | { |
| | | case 1: |
| | | userIdStr = "0" + temp + "00"; |
| | | break; |
| | | case 2: |
| | | userIdStr = temp + "00"; |
| | | break; |
| | | case 3: |
| | | var thirdBit = temp.Substring(temp.Length - 2, 1); |
| | | userIdStr = temp + "0" + thirdBit; |
| | | break; |
| | | case 4: |
| | | userIdStr = temp; |
| | | break; |
| | | tempBytes[i] = (byte)(userId >> (i * 8) & 0xff); |
| | | } |
| | | sbString.Append(userIdStr.ToString().ToUpper()); |
| | | var curV1 = Convert.ToString(tempBytes[0], 16); |
| | | var curV2 = Convert.ToString(tempBytes[1], 16); |
| | | if (curV1.Length == 1) |
| | | { |
| | | curV1 = "0" + curV1; |
| | | } |
| | | if (curV2.Length == 1) |
| | | { |
| | | curV2 = "0" + curV2; |
| | | } |
| | | |
| | | userIdStr = (curV1 + curV2).ToUpper(); |
| | | |
| | | data = dataLength + dataComand1 + dataComand2 + dataSerialNum + addDataLength + |
| | | delUserTypeStr + sbString; |
| | | delUserTypeStr + userIdStr; |
| | | } |
| | | catch { }; |
| | | |
| | |
| | | /// <summary> |
| | | /// 用户管理发送数据回复 |
| | | /// </summary> |
| | | public DefaultControlResponseAllData defaultControlResponseAllData; |
| | | [System.Serializable] |
| | | public class DefaultControlResponseAllData |
| | | { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | |
| | | } |
| | | if (topic == gatewayID + "/" + "ZbDataPassthrough") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; |
| | | gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); |
| | | var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); |
| | | |
| | | if (gatewayTemp.clientDataPassthroughResponseData == null) |
| | | if (clientDataPassthroughResponseData == null) |
| | | { |
| | | result = new VerifyPasswordResponseAllData { errorMessageBase = "网关返回的数据为空" }; |
| | | } |
| | | else |
| | | { |
| | | if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null) |
| | | if (clientDataPassthroughResponseData?.PassData != null) |
| | | { |
| | | var data = gatewayTemp.clientDataPassthroughResponseData.PassData; |
| | | var data = clientDataPassthroughResponseData.PassData; |
| | | if (data.Length == 12) |
| | | { |
| | | var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString(); |
| | |
| | | /// <summary> |
| | | /// 用户管理发送数据回复 |
| | | /// </summary> |
| | | public VerifyPasswordResponseAllData verifyPasswordResponseAllData; |
| | | [System.Serializable] |
| | | public class VerifyPasswordResponseAllData |
| | | { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | |
| | | } |
| | | else if (topic == gatewayID + "/" + "ZbDataPassthrough") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; |
| | | gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); |
| | | var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); |
| | | |
| | | if (gatewayTemp.clientDataPassthroughResponseData == null) |
| | | if (clientDataPassthroughResponseData == null) |
| | | { |
| | | result = new RemoteResponseAllData { errorMessageBase = "网关返回的数据为空" }; |
| | | } |
| | | else |
| | | { |
| | | if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null) |
| | | if (clientDataPassthroughResponseData?.PassData != null) |
| | | { |
| | | var data = gatewayTemp.clientDataPassthroughResponseData.PassData; |
| | | var data = clientDataPassthroughResponseData.PassData; |
| | | if (data.Length == 16) |
| | | { |
| | | var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString(); |
| | |
| | | /// <summary> |
| | | /// 远程回复数据 |
| | | /// </summary> |
| | | public RemoteResponseAllData remoteResponseAllData; |
| | | [System.Serializable] |
| | | public class RemoteResponseAllData |
| | | { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | |
| | | } |
| | | if (topic == gatewayID + "/" + "ZbDataPassthrough") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; |
| | | gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); |
| | | var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); |
| | | |
| | | if (gatewayTemp.clientDataPassthroughResponseData == null) |
| | | if (clientDataPassthroughResponseData == null) |
| | | { |
| | | result = new TempPasswordResponseAllData { errorMessageBase = "网关返回的数据为空" }; |
| | | } |
| | | else |
| | | { |
| | | if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null) |
| | | if (clientDataPassthroughResponseData?.PassData != null) |
| | | { |
| | | var data = gatewayTemp.clientDataPassthroughResponseData.PassData; |
| | | var data = clientDataPassthroughResponseData.PassData; |
| | | if (data.Length == 16) |
| | | { |
| | | var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString(); |
| | |
| | | /// <summary> |
| | | /// 临时密码回复数据 |
| | | /// </summary> |
| | | public TempPasswordResponseAllData tempPasswordResponseAllData; |
| | | [System.Serializable] |
| | | public class TempPasswordResponseAllData |
| | | { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "ZbDataPassthrough") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; |
| | | gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); |
| | | var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); |
| | | |
| | | if (gatewayTemp.clientDataPassthroughResponseData == null) |
| | | if (clientDataPassthroughResponseData == null) |
| | | { |
| | | result = new KeyPasswordInfo { errorMessageBase = "网关返回的数据为空" }; |
| | | } |
| | | else |
| | | { |
| | | if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null) |
| | | if (clientDataPassthroughResponseData?.PassData != null) |
| | | { |
| | | var data = gatewayTemp.clientDataPassthroughResponseData.PassData; |
| | | var data = clientDataPassthroughResponseData.PassData; |
| | | if (data.Length == 20) |
| | | { |
| | | var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString(); |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | |
| | | } |
| | | if (topic == gatewayID + "/" + "ZbDataPassthrough") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; |
| | | gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); |
| | | var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); |
| | | |
| | | if (gatewayTemp.clientDataPassthroughResponseData == null) |
| | | if (clientDataPassthroughResponseData == null) |
| | | { |
| | | result = new VolumeResponseAllData { errorMessageBase = "网关返回的数据为空" }; |
| | | } |
| | | else |
| | | { |
| | | if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null) |
| | | if (clientDataPassthroughResponseData?.PassData != null) |
| | | { |
| | | var data = gatewayTemp.clientDataPassthroughResponseData.PassData; |
| | | var data = clientDataPassthroughResponseData.PassData; |
| | | if (data.Length == 14) |
| | | { |
| | | var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString(); |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | |
| | | } |
| | | if (topic == gatewayID + "/" + "ZbDataPassthrough") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; |
| | | gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); |
| | | var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); |
| | | |
| | | if (gatewayTemp.clientDataPassthroughResponseData == null) |
| | | if (clientDataPassthroughResponseData == null) |
| | | { |
| | | result = new DefaultControlResponseAllData { errorMessageBase = "网关返回的数据为空" }; |
| | | } |
| | | else |
| | | { |
| | | if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null) |
| | | if (clientDataPassthroughResponseData?.PassData != null) |
| | | { |
| | | var data = gatewayTemp.clientDataPassthroughResponseData.PassData; |
| | | var data = clientDataPassthroughResponseData.PassData; |
| | | if (data.Length == 16) |
| | | { |
| | | var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString(); |
| | |
| | | /// <summary> |
| | | /// 音量回复数据 |
| | | /// </summary> |
| | | public VolumeResponseAllData volumeResponseAllData; |
| | | [System.Serializable] |
| | | public class VolumeResponseAllData |
| | | { |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | |
| | | } |
| | | if (topic == gatewayID + "/" + "ZbDataPassthrough") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; |
| | | gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); |
| | | var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); |
| | | |
| | | if (gatewayTemp.clientDataPassthroughResponseData == null) |
| | | if (clientDataPassthroughResponseData == null) |
| | | { |
| | | result = new OpenModeResponseAllData { errorMessageBase = "网关返回的数据为空" }; |
| | | } |
| | | else |
| | | { |
| | | if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null) |
| | | if (clientDataPassthroughResponseData?.PassData != null) |
| | | { |
| | | var data = gatewayTemp.clientDataPassthroughResponseData.PassData; |
| | | var data = clientDataPassthroughResponseData.PassData; |
| | | if (data.Length == 12) |
| | | { |
| | | var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString(); |
| | |
| | | |
| | | if (topic == gatewayID + "/" + "Error_Respon") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | if (temp == null) |
| | | { |
| | |
| | | } |
| | | if (topic == gatewayID + "/" + "ZbDataPassthrough") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; |
| | | gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); |
| | | var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); |
| | | |
| | | if (gatewayTemp.clientDataPassthroughResponseData == null) |
| | | if (clientDataPassthroughResponseData == null) |
| | | { |
| | | result = new DefaultControlResponseAllData { errorMessageBase = "网关返回的数据为空" }; |
| | | } |
| | | else |
| | | { |
| | | if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null) |
| | | if (clientDataPassthroughResponseData?.PassData != null) |
| | | { |
| | | var data = gatewayTemp.clientDataPassthroughResponseData.PassData; |
| | | var data = clientDataPassthroughResponseData.PassData; |
| | | if (data.Length == 16) |
| | | { |
| | | var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString(); |
| | |
| | | /// <summary> |
| | | /// 常开模式 回复数据 |
| | | /// </summary> |
| | | public OpenModeResponseAllData openModeResponseAllData; |
| | | [System.Serializable] |
| | | public class OpenModeResponseAllData |
| | | { |