private void Send_USB_TO_FATOOL_CMD_Data(byte Cmd, byte[] data) { if (!IsConnectionToFaDevice) { return; } byte[] TransmitData = USB_CDC_Packet_Forming_and_Decoding.CMD_Forming_For_Transmitting(Cmd, data); CommunicationPort.ComPortSendData(TransmitData); }
public bool USB_CDC_SendData_With_Packet(USB_CDC_Cmd cmd, byte[] sendingData) { byte[] TransmitData = USB_CDC_Packet_Forming_and_Decoding.CMD_Forming_For_Transmitting((byte)cmd, sendingData); if (cmd != USB_CDC_Cmd.Cmd_For_Connect_Detection) { //Information inforForm = new Information("L1 USB Sending Data"); //inforForm.Show(); //inforForm.infor_textBox.AppendText(HM_Utilitys.ByteArrayToHexString(TransmitData)); } if (!CommunicationPort.ComPortSendData(TransmitData)) { //fail to send return(false); } else { //success to send return(true); } }