Skip to content

Commit 4d73ca7

Browse files
authored
Merge pull request #27 from andrewhaighcell/fix/cdcacmserialdriver_enable_instantiation_from_probedevice
fix: add single argument constructor to cdcacmserialdriver so that it…
2 parents fae8c73 + 24552b8 commit 4d73ca7

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)