feat: add ping() method to verify connectivity and to 'fix' baud rate#165
Open
feat: add ping() method to verify connectivity and to 'fix' baud rate#165
Conversation
In the specific case of using the Notecard in 'req' mode on the AUX port, it can be challenging to deal with baud rate changes robustly. Specifically, consider the case where the host wants to talk at 460800 and the notecard is sitting at 115200, or vice-versa. How does the host send it the card.aux.serial request if it doesn't know what baud rate it's sitting at? This change implements a "ping()" request which attempts to verify the ability to communicate with the notecard. If on serial, and if it CANNOT communicate with the notecard, it will attempt to step through the most common baud rates until it can. And regardless, if it's on aux, it will change the baud rate to the one that was specified on begin().
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the specific case of using the Notecard in 'req' mode on the AUX port, it can be challenging to deal with baud rate changes robustly.
Specifically, consider the case where the host wants to talk at 460800 and the notecard is sitting at 115200, or vice-versa. How does the host send it the card.aux.serial request if it doesn't know what baud rate it's sitting at?
This change implements a "ping()" request which attempts to verify the ability to communicate with the notecard. If on serial, and if it CANNOT communicate with the notecard, it will attempt to step through the most common baud rates until it can. And regardless, if it's on aux, it will change the baud rate to the one that was specified on begin().