Exemple #1
0
        ///  <summary>
        ///  Finds and displays the number of Input buffers
        ///  (the number of Input reports the host will store).
        ///  </summary>

        public static void GetInputReportBufferSize(
            ref Boolean exclusiveAccess
            , ref SafeFileHandle hidHandle
            , ref Hid MyHid
            , ref string txtInputReportBufferSize

            )
        {
            Int32   numberOfInputBuffers = 0;
            Boolean success;

            try
            {
                //  Get the number of input buffers.

                success = MyHid.GetNumberOfInputBuffers(hidHandle, ref numberOfInputBuffers);

                //  Display the result in the text box.

                txtInputReportBufferSize = Convert.ToString(numberOfInputBuffers);
            }
            catch (Exception ex)
            {
                DisplayException("GetInputReportBufferSize", ex);
                //throw;
            }
        }
        ///  <summary>
        ///  Get number of input reports that can be queued.
        ///  </summary>
        private int GetInputReportBufferSize()
        {
            Int32   numberOfInputBuffers = 0;
            Boolean success = false;

            try
            {
                success = MyHid.GetNumberOfInputBuffers(hidHandle, ref numberOfInputBuffers);

                Debug.WriteLineIf(WRITE_DEBUG_INFO && success,
                                  "Max size of input report queue: " + numberOfInputBuffers.ToString());
            }
            catch (Exception ex)
            {
                Debug.WriteLineIf(WRITE_DEBUG_INFO, ex.Message);
            }

            return(numberOfInputBuffers);
        }
        private void GetInputReportBufferSize()
        {
            Int32   numberOfInputBuffers = 0;
            Boolean success;

            try
            {
                //  Get the number of input buffers.

                success = MyHid.GetNumberOfInputBuffers(hidHandle, ref numberOfInputBuffers);

                Tracer.Trace("Number of Input Buffers = " + numberOfInputBuffers);
            }
            catch (Exception ex)
            {
                Tracer.Error(ex);
                throw;
            }
        }