>();
var device = repo.ReadOnlyTable().FirstOrDefault(o => o.Sn == sn && o.IEEE == ieee);
- data.AddRange(device.Address.HexToBytes().Reverse());
- data.AddRange(new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 });
- data.Add((byte)device.Endpoint);
- data.AddRange(new byte[] { 0x00, 0x00 });
+ if (format == 0)
+ {
+ data.Add((byte)(command.Count() + 1 + 2 + 6 + 1 + 2));//数据总长
+ data.Add(addressType);//地址模式
+ data.AddRange(device.Address.HexToBytes().Reverse());
+ data.AddRange(new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 });
+ data.Add((byte)device.Endpoint);
+ data.AddRange(new byte[] { 0x00, 0x00 });
+ data.AddRange(command);
+ }
+ else if (format == 1)
+ {
+ data.Add((byte)(command.Count() + 2 + 1));//数据总长
+ data.AddRange(device.Address.HexToBytes().Reverse());
+ data.Add((byte)device.Endpoint);
+ data.AddRange(command);
+ }
}
- data.AddRange(command);
}
- var head = BitConverter.GetBytes(data.Count() + 2).ToList();
+ var head = BitConverter.GetBytes(data.Count() + 2).ToList();//消息总长
if (BitConverter.IsLittleEndian)
{
head.Reverse();
diff --git a/projects/IoT/IoTServices/FBeeService/Views/Home/Gateway.cshtml b/projects/IoT/IoTServices/FBeeService/Views/Home/Gateway.cshtml
index 13725bb1..f8dde36f 100644
--- a/projects/IoT/IoTServices/FBeeService/Views/Home/Gateway.cshtml
+++ b/projects/IoT/IoTServices/FBeeService/Views/Home/Gateway.cshtml
@@ -66,6 +66,13 @@
饱和度:@item.Saturation
色温:@item.ColorTemperature
}
+ else if (item.DeviceId == 0x0163)
+ {
+ if (!string.IsNullOrEmpty(item.IRVersion))
+ {
+ 版本:@item.IRVersion
+ }
+ }
@if (new int[] { 0x0002, 0x0009, 0x0081, 0x0202, 0x0220, 0x0051 }.Contains(item.DeviceId))
@@ -79,7 +86,7 @@
}
@if (item.DeviceId == 0x0163)
{
- 查询
+ 版本
}
@if (item.DeviceId == 0x0220)
{
@@ -99,7 +106,6 @@
-
}
|
删除设备 |