public void SendData(byte[] data)
 {
     SpecifiedOutputReport oRep = new SpecifiedOutputReport(this);
     oRep.SendData(data);
     try
     {
         Write(oRep);
         if (DataSend != null)
         {
             DataSend(this, new DataSendEventArgs(data));
         }
     }catch (HidDeviceException)
     {
         Console.WriteLine("Device didn't respond.");
     }catch (Exception ex)
     {
         Console.WriteLine(ex.ToString());
     }
 }
Esempio n. 2
0
        public void SendData(byte[] data)
        {
            SpecifiedOutputReport oRep = new SpecifiedOutputReport(this);

            oRep.SendData(data);
            try
            {
                Write(oRep);
                if (DataSend != null)
                {
                    DataSend(this, new DataSendEventArgs(data));
                }
            }catch (HidDeviceException)
            {
                Console.WriteLine("Device didn't respond.");
            }catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
        }