示例#1
0
        /// <summary>
        /// Opens a radio device by its serial number to allow you to control the device using the other API functions.
        /// </summary>
        /// <param name="serial">Radio device serial number that you would like to open. If NULL is specified, a demo receiver will beopened. The serial number is a null-terminated string.</param>
        /// <param name="radio">G313Radio instance</param>
        /// <returns>Returns true if the operation is successful</returns>
        public bool TryOpen(string serial, out G313Radio radio)
        {
            var handle = G313Api.Open(serial);

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

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