| | |
| | | var jObject = new JObject { { "DeviceAddr", device.DeviceAddr }, { "Epoint", 200 }, { "Cluster_ID", 64513 }, { "Command", 0 } };
|
| | | var data = new JObject { { "PassData", passData } };
|
| | | jObject.Add("Data", data);
|
| | | var result = HdlDeviceCommonLogic.Current.SendJobjectDataToGateway2(device, jObject.ToString(), "0409", 16, 9);
|
| | | //16:旧版本 18:新版本
|
| | | var result = HdlDeviceCommonLogic.Current.SendJobjectDataToGateway2(device, jObject.ToString(), "0409", 16, 9, new List<int> { 18 });
|
| | | if (result.ErrorMsg != null)
|
| | | {
|
| | | this.ShowTipMsg(result.ErrorMsg);
|
| | |
| | | {
|
| | | energyInfo.enable = false;
|
| | | }
|
| | | energyInfo.time = Convert.ToInt32(result.ReceiptData[12].ToString() + result.ReceiptData[13].ToString(), 16);
|
| | | energyInfo.level = Convert.ToInt32(result.ReceiptData[14].ToString() + result.ReceiptData[15].ToString(), 16);
|
| | |
|
| | | //新版本:07 0904 11 04 01 3C00 32
|
| | | if (result.ReceiptData.Length == 18)
|
| | | {
|
| | | energyInfo.time = Convert.ToInt32(result.ReceiptData[14].ToString() + result.ReceiptData[15].ToString() +
|
| | | result.ReceiptData[12].ToString() + result.ReceiptData[13].ToString(), 16);
|
| | |
|
| | | energyInfo.level = Convert.ToInt32(result.ReceiptData[16].ToString() + result.ReceiptData[17].ToString(), 16); |
| | | }
|
| | | //旧版本:07 0904 11 03 01 3C 32
|
| | | else
|
| | | {
|
| | | energyInfo.time = Convert.ToInt32(result.ReceiptData[12].ToString() + result.ReceiptData[13].ToString(), 16);
|
| | | energyInfo.level = Convert.ToInt32(result.ReceiptData[14].ToString() + result.ReceiptData[15].ToString(), 16);
|
| | | }
|
| | | return energyInfo;
|
| | | }
|
| | |
|
| | |
| | | /// </summary>
|
| | | /// <param name="panel">干接点对象</param>
|
| | | /// <returns></returns>
|
| | | public async Task<List<CommonDevice.AttributeDataObj>> GetDryContactConfigureInfo(CommonDevice device)
|
| | | public List<CommonDevice.AttributeDataObj> GetDryContactConfigureInfo(CommonDevice device)
|
| | | {
|
| | | //借用它的函数
|
| | | var panel = new Panel();
|
| | | panel.DeviceAddr = device.DeviceAddr;
|
| | | panel.DeviceEpoint = device.DeviceEpoint;
|
| | | panel.CurrentGateWayId = device.CurrentGateWayId;
|
| | |
|
| | | var result = HdlDeviceBindLogic.Current.ReadPanelConfigureInfoAsync(panel);
|
| | | panel = null;
|
| | | var result = HdlDeviceBindLogic.Current.ReadPanelConfigureInfoAsync(device);
|
| | |
|
| | | //共通错误检测
|
| | | string error = HdlCheckLogic.Current.CheckCommonErrorCode(result);
|
| | |
| | | /// </summary>
|
| | | private void SaveDryContactFunctionToLocaltion()
|
| | | {
|
| | | var file = Newtonsoft.Json.JsonConvert.SerializeObject(dicDryContactFunction);
|
| | |
|
| | | var bytes = System.Text.Encoding.UTF8.GetBytes(file);
|
| | | Common.Global.WriteFileByBytesByHomeId(DirNameResourse.DryContactFunctionFile, bytes);
|
| | | HdlFileLogic.Current.SaveFileContent(DirNameResourse.DryContactFunctionFile, dicDryContactFunction);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | /// </summary>
|
| | | private void LoadDryContactFunctionFromLocaltion()
|
| | | {
|
| | | if (Common.Global.IsExistsByHomeId(DirNameResourse.DryContactFunctionFile) == false)
|
| | | this.dicDryContactFunction = new Dictionary<string, DryContactFunctionInfo>();
|
| | |
|
| | | byte[] filebyte = HdlFileLogic.Current.ReadFileByteContent(DirNameResourse.DryContactFunctionFile);
|
| | | if (filebyte == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | byte[] filebyte = Common.Global.ReadFileByHomeId(DirNameResourse.DryContactFunctionFile);
|
| | | string strvalue = System.Text.Encoding.UTF8.GetString(filebyte);
|
| | | this.dicDryContactFunction = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<string, DryContactFunctionInfo>>(strvalue);
|
| | | }
|