Skip to content

Commit a1d38fc

Browse files
author
jantje
committed
#711 added 76800 as baud rate
1 parent f296347 commit a1d38fc

File tree

1 file changed

+74
-74
lines changed

1 file changed

+74
-74
lines changed

io.sloeber.core/src/io/sloeber/core/api/SerialManager.java

+74-74
Original file line numberDiff line numberDiff line change
@@ -9,84 +9,84 @@
99
import cc.arduino.packages.discoverers.NetworkDiscovery;
1010

1111
public class SerialManager {
12-
static ISerialUser otherSerialUser = null; // If someone else uses the
13-
// serial port he can register
14-
// here so we can
15-
// request him to disconnect
16-
// when we need the serial port
17-
18-
static Set<IProject> fProjects = new HashSet<>();
19-
20-
/**
21-
* This method is used to register a serial user. A serial user is alerted
22-
* when the serial port will be disconnected (for instance for a upload) The
23-
* serial user is requested to act appropriately Only 1 serial user can be
24-
* registered at a given time. No check is done.
25-
*
26-
* @param serialUser
27-
*/
28-
public static void registerSerialUser(ISerialUser serialUser) {
29-
otherSerialUser = serialUser;
30-
}
31-
32-
/**
33-
* This method is to unregister a serial user.
34-
*/
35-
public static void UnRegisterSerialUser() {
36-
otherSerialUser = null;
37-
}
38-
39-
public static boolean StopSerialMonitor(String mComPort) {
40-
if (otherSerialUser != null) {
41-
return otherSerialUser.PauzePort(mComPort);
12+
static ISerialUser otherSerialUser = null; // If someone else uses the
13+
// serial port he can register
14+
// here so we can
15+
// request him to disconnect
16+
// when we need the serial port
17+
18+
static Set<IProject> fProjects = new HashSet<>();
19+
20+
/**
21+
* This method is used to register a serial user. A serial user is alerted
22+
* when the serial port will be disconnected (for instance for a upload) The
23+
* serial user is requested to act appropriately Only 1 serial user can be
24+
* registered at a given time. No check is done.
25+
*
26+
* @param serialUser
27+
*/
28+
public static void registerSerialUser(ISerialUser serialUser) {
29+
otherSerialUser = serialUser;
4230
}
43-
return false;
44-
}
4531

46-
public static void StartSerialMonitor(String mComPort) {
47-
if (otherSerialUser != null) {
48-
otherSerialUser.ResumePort(mComPort);
32+
/**
33+
* This method is to unregister a serial user.
34+
*/
35+
public static void UnRegisterSerialUser() {
36+
otherSerialUser = null;
4937
}
5038

51-
}
52-
53-
public static String[] listComPorts() {
54-
List<String> serialList = Serial.list();
55-
String[] outgoing = new String[serialList.size()];
56-
serialList.toArray(outgoing);
57-
return outgoing;
58-
}
59-
60-
@SuppressWarnings("nls")
61-
public static String[] listBaudRates() {
62-
63-
String[] outgoing = { "921600", "460800", "230400", "115200", "57600", "38400", "31250", "28800", "19200",
64-
"14400", "9600", "4800", "2400", "1200", "300" };
65-
return outgoing;
66-
}
67-
68-
@SuppressWarnings("nls")
69-
public static String[] listLineEndings() {
70-
String[] outgoing = { "none", "CR", "NL", "CR/NL" };
71-
return outgoing;
72-
}
73-
74-
@SuppressWarnings("nls")
75-
public static String getLineEnding(int selectionIndex) {
76-
switch (selectionIndex) {
77-
default:
78-
case 0:
79-
return "";
80-
case 1:
81-
return "\r";
82-
case 2:
83-
return "\n";
84-
case 3:
85-
return "\r\n";
39+
public static boolean StopSerialMonitor(String mComPort) {
40+
if (otherSerialUser != null) {
41+
return otherSerialUser.PauzePort(mComPort);
42+
}
43+
return false;
8644
}
87-
}
8845

89-
public static String[] listNetworkPorts() {
90-
return NetworkDiscovery.getList();
91-
}
46+
public static void StartSerialMonitor(String mComPort) {
47+
if (otherSerialUser != null) {
48+
otherSerialUser.ResumePort(mComPort);
49+
}
50+
51+
}
52+
53+
public static String[] listComPorts() {
54+
List<String> serialList = Serial.list();
55+
String[] outgoing = new String[serialList.size()];
56+
serialList.toArray(outgoing);
57+
return outgoing;
58+
}
59+
60+
@SuppressWarnings("nls")
61+
public static String[] listBaudRates() {
62+
63+
String[] outgoing = { "921600", "460800", "230400", "115200", "76800", "57600", "38400", "31250", "28800",
64+
"19200", "14400", "9600", "4800", "2400", "1200", "300" };
65+
return outgoing;
66+
}
67+
68+
@SuppressWarnings("nls")
69+
public static String[] listLineEndings() {
70+
String[] outgoing = { "none", "CR", "NL", "CR/NL" };
71+
return outgoing;
72+
}
73+
74+
@SuppressWarnings("nls")
75+
public static String getLineEnding(int selectionIndex) {
76+
switch (selectionIndex) {
77+
default:
78+
case 0:
79+
return "";
80+
case 1:
81+
return "\r";
82+
case 2:
83+
return "\n";
84+
case 3:
85+
return "\r\n";
86+
}
87+
}
88+
89+
public static String[] listNetworkPorts() {
90+
return NetworkDiscovery.getList();
91+
}
9292
}

0 commit comments

Comments
 (0)