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

enable user to update baud of configured Serial port #107

Closed
wants to merge 1 commit into from

Conversation

soundanalogous
Copy link
Member

The delay here could be tricky. Users have to understand that if they call board.serialBaud(newBaudRate) they will need to wait at least 200ms before they can write to the serial port.

The delay is necessary for updating the baud rate for HW serial. There is actually no delay (other than the time required to transmit the command to the Arduino) for SW serial, but it's probably easier to say the delay exists regardless.

@soundanalogous
Copy link
Member Author

@dtex please test in your GPS code with firmata/arduino#270

* @param {number} portId The serial port to update the baud of.
* @param {number} newBaud The new baud rate to set.
*/
Board.prototype.serialBaud = function(portId, newBaud) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

an alternate name could be serialUpdateBaud to avoid any confusion as to whether or not this sets the initial baud or is used only for updating the baud rate.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should also check that the Firmata protocol version is at least 2.6.

@dtex
Copy link
Contributor

dtex commented Jan 17, 2016

Might the delay vary across platforms? Do we want to add an optional callback in the signature so the users can just think about that?

@soundanalogous
Copy link
Member Author

I'm not sure if the delay will be necessary or will vary on non-arduino platforms since I only really use arduino.

@rwaldron
Copy link
Collaborator

rwaldron commented Feb 4, 2016

@dtex @soundanalogous any further testing needed or is this ready to go?

@soundanalogous
Copy link
Member Author

This is not ready. It may be some time as I still need to revise at the protocol level.

@soundanalogous
Copy link
Member Author

I'm going to redo this in SerialFirmata v2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants