Skip to content

Commit 17f02e3

Browse files
authored
Merge pull request #50 from DiebBlue/main
Thank you for the PR!
2 parents eea51b1 + 8045f06 commit 17f02e3

2 files changed

Lines changed: 16 additions & 15 deletions

File tree

UsbSerialForAndroid/driver/STM32SerialDriver.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,21 @@ public STM32SerialDriver(UsbDevice device)
2828
mPort = new STM32SerialPort(mDevice, 0, this);
2929
}
3030

31-
public class STM32SerialPort : CommonUsbSerialPort
31+
public static Dictionary<int, int[]> GetSupportedDevices()
32+
{
33+
return new Dictionary<int, int[]>
34+
{
35+
{
36+
UsbId.VENDOR_STM, new int[]
37+
{
38+
UsbId.STM32_STLINK,
39+
UsbId.STM32_VCOM
40+
}
41+
}
42+
};
43+
}
44+
45+
public class STM32SerialPort : CommonUsbSerialPort
3246
{
3347
readonly string TAG = nameof(STM32SerialDriver);
3448

@@ -292,20 +306,6 @@ void SetDtrRts()
292306
int value = (mRts ? 0x2 : 0) | (mDtr ? 0x1 : 0);
293307
SendAcmControlMessage(SET_CONTROL_LINE_STATE, value, null);
294308
}
295-
296-
public static Dictionary<int, int[]> GetSupportedDevices()
297-
{
298-
return new Dictionary<int, int[]>
299-
{
300-
{
301-
UsbId.VENDOR_STM, new int[]
302-
{
303-
UsbId.STM32_STLINK,
304-
UsbId.STM32_VCOM
305-
}
306-
}
307-
};
308-
}
309309
}
310310
}
311311
}

UsbSerialForAndroid/driver/UsbSerialProber.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public static ProbeTable GetDefaultProbeTable()
4646
probeTable.AddDriver(typeof(FtdiSerialDriver));
4747
probeTable.AddDriver(typeof(ProlificSerialDriver));
4848
probeTable.AddDriver(typeof(Ch34xSerialDriver));
49+
probeTable.AddDriver(typeof(STM32SerialDriver));
4950
return probeTable;
5051
}
5152

0 commit comments

Comments
 (0)