| | |
| | | } |
| | | new System.Threading.Thread(() => |
| | | { |
| | | SendPmSensorStatuComand(device); |
| | | SendPm2P5Comand(device); |
| | | //读取Pm2.5传感器的温度数据 |
| | | HdlDeviceAttributeLogic.Current.SendTemperatureStatuComand(device); |
| | | //读取Pm2.5传感器的湿度数据 |
| | |
| | | /// SendFanStatuComand |
| | | /// </summary> |
| | | /// <param name="device">设备</param> |
| | | private void SendPmSensorStatuComand(CommonDevice device) |
| | | private void SendPm2P5Comand(CommonDevice device) |
| | | { |
| | | if (device == null) |
| | | { |
| | |
| | | |
| | | #endregion |
| | | |
| | | #region ■ 空气质量传感器_______________________________ |
| | | /// <summary> |
| | | /// SendAirQualitySensorComand |
| | | /// </summary> |
| | | /// <param name="device">设备</param> |
| | | public void SendAirQualitySensorComand(CommonDevice device) |
| | | { |
| | | if (device == null) |
| | | { |
| | | return; |
| | | } |
| | | new System.Threading.Thread(() => |
| | | { |
| | | SendSwitchStatuComand(device); |
| | | //空气质量传感器的PM2.5数据 |
| | | SendPm2P5Comand(device); |
| | | //空气质量传感器的CO2数据[2021.01.13产品要求暂时去掉] |
| | | //SendCO2Comand(device); |
| | | //空气质量传感器的温度数据 |
| | | HdlDeviceAttributeLogic.Current.SendTemperatureStatuComand(device); |
| | | //空气质量传感器的湿度数据 |
| | | HdlDeviceAttributeLogic.Current.SendHumidityStatuComand(device); |
| | | System.Threading.Thread.Sleep(300); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// SendCO2Comand |
| | | /// </summary> |
| | | /// <param name="device">设备</param> |
| | | private void SendCO2Comand(CommonDevice device) |
| | | { |
| | | if (device == null) |
| | | { |
| | | return; |
| | | } |
| | | var jObject = new Newtonsoft.Json.Linq.JObject |
| | | { |
| | | { "DeviceAddr",device.DeviceAddr }, |
| | | { "Epoint", device.DeviceEpoint }, |
| | | { "Cluster_ID", (int)Cluster_ID.CO2}, |
| | | { "Command", 108 } |
| | | }; |
| | | var attriBute = new Newtonsoft.Json.Linq.JArray |
| | | { |
| | | new Newtonsoft.Json.Linq.JObject |
| | | { |
| | | { "AttriButeId", (int)AttriButeId.MeasuredValue} |
| | | } |
| | | }; |
| | | var data = new Newtonsoft.Json.Linq.JObject { { "AttriBute", attriBute } }; |
| | | jObject.Add("Data", data); |
| | | device.Gateway?.Send("GetDeviceStatus", jObject.ToString()); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ■ 晾衣架_______________________________ |
| | | /// <summary> |
| | | /// SendAirerComand |