Skip to content

Commit 24552b8

Browse files
fix: add single argument constructor to cdcacmserialdriver so that it can be constructed by probedevice
1 parent fae8c73 commit 24552b8

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

UsbSerialForAndroid/driver/CdcAcmSerialDriver.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@ public CdcAcmSerialDriver(UsbDevice device, bool? enableAsyncReads = null)
3737
mPort = new CdcAcmSerialPort(device, 0, this, enableAsyncReads);
3838
}
3939

40+
// Additional constructor for ProbeDevice called by Reflection
41+
// Note that this defaults to enableAsyncReads = false as
42+
// there is no support for passing additional arguments from ProbeDevice
43+
public CdcAcmSerialDriver(UsbDevice device)
44+
{
45+
mDevice = device;
46+
bool enableAsyncReads = false; // For clarity of understanding
47+
mPort = new CdcAcmSerialPort(device, 0, this, enableAsyncReads);
48+
}
49+
4050
class CdcAcmSerialPort : CommonUsbSerialPort
4151
{
4252
private bool mEnableAsyncReads;

0 commit comments

Comments
 (0)