Sfoglia il codice sorgente

刷卡机修改

Lishi
xxe 2 anni fa
parent
commit
69f386d457
2 ha cambiato i file con 13 aggiunte e 2 eliminazioni
  1. +1
    -0
      HKControl/Main.cs
  2. +12
    -2
      UHFHelper/UHF_RS485_Helper.cs

+ 1
- 0
HKControl/Main.cs Vedi File

@@ -146,6 +146,7 @@ namespace HKControl

private void Control(int num, string add)
{
Debug.WriteLine($"{num} 号出餐口控制");
SiemensDicitonary[num].Write(add, true);
Thread.Sleep(1000);
SiemensDicitonary[num].Write(add, false);


+ 12
- 2
UHFHelper/UHF_RS485_Helper.cs Vedi File

@@ -258,8 +258,18 @@ namespace UHFHelper
/// </summary>
public void OpenBeep(int addr)
{
byte[] sendData = new byte[] { 0x07, (byte)addr, 0x33, 0x08, 0x02, 0x03, 0x33, 0xB1 };

//byte[] sendData = new byte[] { 0x07, (byte)addr, 0x33, 0x08, 0x02, 0x03, 0x33, 0xB1 };
byte[] data1 = new byte[6] { 0x07, (byte)addr, 0x33, 0x08, 0x02, 0x03 };
//生成crc校验码
byte[] data2 = CRC16.ToCRC16(data1);
byte[] data3 = new byte[data1.Length + data2.Length];
data1.CopyTo(data3, 0);
data2.CopyTo(data3, data1.Length);
if (_serialPort != null)
{
_serialPort.DiscardInBuffer();
_serialPort.Write(data3, 0, data3.Length);
}
}
}



Caricamento…
Annulla
Salva