Example #1
0
        /// <summary>
        /// This changes the current protocol used by a device. After changing the protocol, setting new parameters is required.
        /// </summary>
        /// <param name="deviceId">Id of device to change</param>
        /// <param name="protocol">The new protocol to use</param>
        /// <returns>Success or error code</returns>
        public static unsafe bool tdSetProtocol(int deviceId, string protocol)
        {
            char *protocolChar = stringToChar(protocol);
            bool  returnValue  = UnmanagedImport.tdSetProtocol(deviceId, protocolChar);

            Marshal.FreeHGlobal((IntPtr)protocolChar);
            return(returnValue);
        }