Esempio n. 1
0
 public PanelDeviceReport(IHidReport rep)
 {
     _Data       = rep.GetBytes();
     _ReadStatus = (PanelDevicReadStatus)rep.ReadStatus;
     _ReportId   = rep.ReportId;
     Tick        = rep.Tick;
 }
        public static Task WriteReportAsync(this IHidDevice device, IHidReport report)
        {
            if (device == null)
            {
                throw new ArgumentNullException($"{nameof(device)} is null");
            }

            return(device.WriteRawDataAsync(report.GetWholeData()));
        }
Esempio n. 3
0
        internal static byte[] GetWholeData(this IHidReport report)
        {
            if (report == null)
            {
                throw new ArgumentNullException($"{nameof(report)} is null");
            }

            byte[] result = new byte[report.Data.Count + 1];
            result[0] = report.ReportId;
            Array.Copy(report.Data.ToArray(), 0, result, 1, report.Data.Count);

            return(result);
        }