| | |
| | | /// </summary> |
| | | public class Packet |
| | | { |
| | | ///// <summary> |
| | | ///// 缓冲区大小 |
| | | ///// Link协议现在一个包的数据比较大,缓冲区太小存不完全部数据 2023-07-14 16:03:56 wxr |
| | | ///// </summary> |
| | | //public const int Size = 2000; |
| | | /// <summary> |
| | | /// 缓冲区大小 |
| | | /// Link协议现在一个包的数据比较大,缓冲区太小存不完全部数据 2023-07-14 16:03:56 wxr |
| | | /// </summary> |
| | | public const int Size = 1024 * 10; |
| | | |
| | | /// <summary> |
| | | /// 接收到的数据 |
| | |
| | | /// </summary> |
| | | public System.Net.EndPoint RemoteEndPoint; |
| | | |
| | | public Packet(int lenght) |
| | | public Packet() |
| | | { |
| | | this.Bytes = new byte[lenght]; |
| | | |
| | | this.Bytes = new byte[Size]; |
| | | RemoteEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Any, 0); |
| | | } |
| | | |
| | | |
| | | |
| | | public Packet(byte[] data, System.Net.EndPoint remoteEndPoint) |
| | | { |
| | | this.Bytes = data; |
| | |
| | | FunctionPage.UpdataStates(lightTeme); |
| | | ClassificationPage.UpdataInfo(lightTeme); |
| | | RGBPage.UpdataStates(lightTeme); |
| | | }else if(lightTeme.spk == SPK.LightCCT) |
| | | } |
| | | else if (lightTeme.spk == SPK.LightCCT) |
| | | { |
| | | lightTeme.SetAttrState(FunctionAttributeKey.OnOff, receiveBytes[1] > 0 ? "on" : "off"); |
| | | if (receiveBytes[1] > 0) |
| | |
| | | if (receiveBytes[9] > 128) |
| | | { |
| | | indoorTemp = 1 - (receiveBytes[9] - 128); |
| | | }else |
| | | } |
| | | else |
| | | { |
| | | indoorTemp = receiveBytes[9]; |
| | | } |