SendData() public method

public SendData ( int input ) : bool
input int
return bool
Example #1
0
 /// <summary>
 /// Send data to the HID device.
 /// This must be an array of bytes (0 to 255).
 /// The array must be indexed from 1 and have size OutputLength.
 /// </summary>
 /// <param name="name">The HID device name.</param>
 /// <param name="data">The data to send.</param>
 /// <returns>"True" or "False" for data consistency.</returns>
 public static Primitive Output(Primitive name, Primitive data)
 {
     try
     {
         HID_Device device = GetDevice(name);
         if (null == device)
         {
             return("False");
         }
         HIDOutputReport report   = new HIDOutputReport(device);
         int[]           sendData = new int[device.OutputReportLength];
         for (int i = 0; i < sendData.Length; i++)
         {
             sendData[i] = data[i + 1];
         }
         return(report.SendData(sendData));
     }
     catch (Exception ex)
     {
         Utilities.OnError(Utilities.GetCurrentMethod(), ex);
     }
     return("False");
 }