Skip to content

Commit 14e4046

Browse files
authored
Add new constructors to PortBase (#362)
***NO_CI***
1 parent be9c17d commit 14e4046

File tree

1 file changed

+46
-9
lines changed
  • nanoFramework.Tools.DebugLibrary.Net/PortDefinitions

1 file changed

+46
-9
lines changed

nanoFramework.Tools.DebugLibrary.Net/PortDefinitions/PortBase.cs

Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,41 +10,78 @@
1010

1111
namespace nanoFramework.Tools.Debugger
1212
{
13+
// write intellisense documentation for this class
1314
public abstract partial class PortBase : PortMessageBase
1415
{
16+
17+
#region creating serial instances
18+
1519
public static PortBase CreateInstanceForSerial()
1620
{
1721
return new PortSerialManager(true, null);
1822
}
1923

2024
public static PortBase CreateInstanceForSerial(List<string> portExclusionList)
2125
{
22-
return new PortSerialManager(true, portExclusionList);
26+
return new PortSerialManager(
27+
true,
28+
portExclusionList);
29+
}
30+
public static PortBase CreateInstanceForSerial(bool startDeviceWatchers)
31+
{
32+
return new PortSerialManager(
33+
startDeviceWatchers,
34+
null);
2335
}
2436

25-
public static PortBase CreateInstanceForSerial(bool startDeviceWatchers, int bootTime = 1000)
37+
public static PortBase CreateInstanceForSerial(
38+
bool startDeviceWatchers,
39+
int bootTime = 1000)
2640
{
27-
return new PortSerialManager(startDeviceWatchers, null, bootTime);
41+
return new PortSerialManager(
42+
startDeviceWatchers,
43+
null,
44+
bootTime);
2845
}
2946

30-
public static PortBase CreateInstanceForSerial(bool startDeviceWatchers, List<string> portExclusionList = null, int bootTime = 1000)
47+
public static PortBase CreateInstanceForSerial(
48+
bool startDeviceWatchers,
49+
List<string> portExclusionList = null,
50+
int bootTime = 1000)
3151
{
32-
return new PortSerialManager(startDeviceWatchers, portExclusionList, bootTime);
52+
return new PortSerialManager(
53+
startDeviceWatchers,
54+
portExclusionList,
55+
bootTime);
3356
}
3457

58+
#endregion
59+
60+
#region creating tcp/ip instances
61+
3562
public static PortBase CreateInstanceForNetwork(bool startDeviceWatchers)
3663
{
3764
return new PortTcpIpManager(startDeviceWatchers);
3865
}
3966

40-
public static PortBase CreateInstanceForNetwork(bool startDeviceWatchers, int discoveryPort)
67+
public static PortBase CreateInstanceForNetwork(
68+
bool startDeviceWatchers,
69+
int discoveryPort)
4170
{
42-
return new PortTcpIpManager(startDeviceWatchers, discoveryPort);
71+
return new PortTcpIpManager(
72+
startDeviceWatchers,
73+
discoveryPort);
4374
}
4475

45-
public static PortBase CreateInstanceForComposite(IEnumerable<PortBase> ports, bool startDeviceWatchers)
76+
#endregion
77+
78+
public static PortBase CreateInstanceForComposite(
79+
IEnumerable<PortBase> ports,
80+
bool startDeviceWatchers)
4681
{
47-
return new PortCompositeDeviceManager(ports, startDeviceWatchers);
82+
return new PortCompositeDeviceManager(
83+
ports,
84+
startDeviceWatchers);
4885
}
4986
}
5087
}

0 commit comments

Comments
 (0)