Added deck command for listing decks with revision and serial - #18
Merged
Merged
Conversation
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.
Adds a
deckcommand with alistsub-command, showing the decks attached tothe Crazyflie with their board revision and serial number:
Decks are found through their identity memory, and both kinds are covered:
OneWire— name and revision from the memory elements, serial is the1-wire ROM id of the memory chip (8 bytes).
DeckCtrl— name and revision parsed from the info page at address 0(magic validated), serial is the unique CPU id of the controller (12 bytes).
The serial number is reported in the memory info packet, so a deck whose memory
can't be read is still listed with its serial and
?in the fields thatcouldn't be read. The reason is printed on stderr, so it doesn't disturb
--csvoutput.--csvemitsname,revision,serial. Documentation indocs/deck.md.Tested against a Crazyflie with one deck of each kind attached.
On the table formatting
param listandlog listalready printcol | colwith a dashed rule, butwith hardcoded column widths that overflow when a value is longer than the
column. This PR adds
print_table()inutils::display, which sizes columnsto their content, and uses it for
deck list.Converting
param,log,memandlpsto a shared table renderer is afollow-up — possibly using
tabledinstead of hand-rolling it, which wouldalso fix display width for wide characters. Deliberately left out of this PR.