* Update SerialPort.Linux.cs
add ttyGSX devices to supported devices
* Apply suggestions from code review
Entry can only be ttyGSx. when its not ttySx
Co-Authored-By: Stephen Toub <stoub@microsoft.com>
* Update SerialPort.Linux.cs
ttyGSx creates a file in "/sys/class/tty/ttyGS0" named "dev" - use this file as an additional check
Co-authored-by: Stephen Toub <stoub@microsoft.com>
// checking for that for non-ttyS entries is incorrect as some uart
// devices are incorrectly filtered out
bool isTtyS = entry.Name.StartsWith("ttyS");
+ bool isTtyGS = !isTtyS && entry.Name.StartsWith("ttyGS");
if ((isTtyS &&
(File.Exists(entry.FullName + "/device/id") ||
Directory.Exists(entry.FullName + "/device/of_node"))) ||
(!isTtyS && Directory.Exists(entry.FullName + "/device/tty")) ||
- Directory.Exists(sysUsbDir + entry.Name))
+ Directory.Exists(sysUsbDir + entry.Name) ||
+ (isTtyGS && (File.Exists(entry.FullName + "/dev"))))
{
string deviceName = devDir + entry.Name;
if (File.Exists(deviceName))