コード例 #1
0
        /// <summary>
        /// Opens a radio device by its index to allow you to control the device using the other API functions.
        /// </summary>
        /// <param name="index">Radio device number that you would like to open from 1 to 255. If zero is specified, it will open thenext available device.</param>
        /// <param name="radio">G313Radio instance</param>
        /// <returns>Returns true if the operation is successful</returns>
        public bool TryOpen(int index, out G313Radio radio)
        {
            var handle = G313Api.OpenRadioDevice(index);

            if (handle == 0)
            {
                radio = null;
                return(false);
            }

            radio = new G313Radio(new IntPtr(handle));
            return(true);
        }