This commit is contained in:
hehaibing-1996
2024-06-25 13:49:02 +08:00
2 changed files with 26 additions and 5 deletions

View File

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@ -185,15 +186,21 @@ namespace WCS.BLL.Tool
color = 0x00;
break;
}
byte[] data1 = new byte[8];
byte[] data1 = new byte[8 + 3 * 6];
data1[0] = 0xff;
data1[1] = 0x02;
data1[2] = 0x00;
data1[3] = 0x0a;
data1[4] = (byte)lightid;
data1[5] = (byte)status;
data1[6] = color;
data1[7] = (byte)beestatus;
for (int i = 0; i < 7;i++)
{
data1[4 + i * 3] = (byte)(lightid + i);
data1[5 + i * 3] = (byte)status;
data1[6 + i * 3] = color;
}
//data1[4] = (byte)lightid;
//data1[5] = (byte)status;
//data1[6] = color;
data1[25] = (byte)beestatus;
byte[] data2 = Crc16(data1, data1.Length, true);
return data2;
}
@ -218,6 +225,7 @@ namespace WCS.BLL.Tool
public static byte[] InstoreWarnLight(int lightid)
{
byte[] data1 = new byte[8];
byte[] data1 = new byte[8 + 3 * 6];
data1[0] = 0xff;
data1[1] = 0x02;
data1[2] = 0x00;
@ -225,6 +233,15 @@ namespace WCS.BLL.Tool
data1[4] = (byte)lightid;
data1[5] = 0x03;
data1[6] = 0x02;
for (int i = 0; i < 7; i++)
{
data1[4 + i * 3] = (byte)(lightid + i);
data1[5 + i * 3] = 0x03;
data1[6 + i * 3] = 0x02;
}
//data1[4] = (byte)lightid;
//data1[5] = 0x03;
//data1[6] = 0x02;
//data1[7] = 0x02;
data1[7] = 0x00;
byte[] senddata1 = Tool.Helper.Crc16(data1, data1.Length, true);