Skip to content

Commit 2fdc791

Browse files
committed
Add a getBaudRates() API to get a list of supported baud rates
1 parent 9587661 commit 2fdc791

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/Controller.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,6 @@ class Controller {
7272
zmax: 0
7373
};
7474

75-
// User-defined baud rates
76-
baudRates = [];
77-
7875
// Available controllers
7976
availableControllers = [];
8077

@@ -164,13 +161,10 @@ class Controller {
164161
});
165162

166163
this.socket.on('startup', (data) => {
167-
const { availableControllers, baudRates } = { ...data };
164+
const { availableControllers } = { ...data };
168165

169166
this.availableControllers = ensureArray(availableControllers);
170167

171-
// User-defined baud rates
172-
this.baudRates = ensureArray(baudRates);
173-
174168
if (callback) {
175169
callback(null);
176170

@@ -338,6 +332,14 @@ class Controller {
338332
}
339333
this.socket.emit('getPorts', callback);
340334
}
335+
// Gets a list of supported baud rates.
336+
// @param {function} [callback] Called once completed.
337+
getBaudRates(callback) {
338+
if (!this.socket) {
339+
return;
340+
}
341+
this.socket.emit('getBaudRates', callback);
342+
}
341343
// Gets the machine state.
342344
// @return {string|number} Returns the machine state.
343345
getMachineState() {

0 commit comments

Comments
 (0)