Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect Marlin position reports in inch mode #3

Closed
wants to merge 16 commits into from
Prev Previous commit
Next Next commit
Add a getBaudRates() API to get a list of supported baud rates
cheton committed Oct 21, 2017
commit 2fdc7918bdf1cd904e7d329ed6c35669e9f470b8
16 changes: 9 additions & 7 deletions src/Controller.js
Original file line number Diff line number Diff line change
@@ -72,9 +72,6 @@ class Controller {
zmax: 0
};

// User-defined baud rates
baudRates = [];

// Available controllers
availableControllers = [];

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

this.socket.on('startup', (data) => {
const { availableControllers, baudRates } = { ...data };
const { availableControllers } = { ...data };

this.availableControllers = ensureArray(availableControllers);

// User-defined baud rates
this.baudRates = ensureArray(baudRates);

if (callback) {
callback(null);

@@ -338,6 +332,14 @@ class Controller {
}
this.socket.emit('getPorts', callback);
}
// Gets a list of supported baud rates.
// @param {function} [callback] Called once completed.
getBaudRates(callback) {
if (!this.socket) {
return;
}
this.socket.emit('getBaudRates', callback);
}
// Gets the machine state.
// @return {string|number} Returns the machine state.
getMachineState() {