public static void Open(string portName, int baudRate, Parity parity, int dataBits, StopBits stopBits) { PortUtil portUtil = new PortUtil(portName, baudRate, parity, dataBits, stopBits); portUtil.Open(); //弹钱箱 byte[] cashDrawer = new byte[] { 0x1B, 0x70, 0x00, 0x30, 0xC0 }; portUtil.Write(cashDrawer); portUtil.Close(); }
public static void Open(string VID, string PID, string endpointId) { PortUtil portUtil = new PortUtil(VID, PID, endpointId); portUtil.Open(); //弹钱箱 byte[] cashDrawer = new byte[] { 0x1B, 0x70, 0x00, 0x30, 0xC0 }; portUtil.Write(cashDrawer); portUtil.Close(); }