Example #1
0
        private bool OSExclusiveAccess(IConnection connection)
        {
            var isLtoFlashPort = connection.Type == INTV.Core.Model.Device.ConnectionType.Serial;

            if (isLtoFlashPort)
            {
                var portIdString = SerialPortConnection.GetSerialPortIdFromDevTtyPath(connection.Name);
                if (!string.IsNullOrEmpty(portIdString))
                {
                    var portIdParts = portIdString.Split('-');
                    if (portIdParts.Length >= 3)
                    {
                        var vendorAndName = portIdParts[1];
                        isLtoFlashPort = vendorAndName.StartsWith(SanitizedVendorName + '_' + SanitizedProductName);
                    }
                }
            }
            return(isLtoFlashPort);
        }