Added warning for long names in DeckCtrl config gen - #17
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.
util deck-ctrl bingenandbinflashsilently truncated the product name whenit didn't fit the deck info page, so a config could be flashed with a name
nobody intended.
The info page stores the name in a 15 byte field, of which the last byte is the
null terminator — 14 usable characters (see the "Deck Information Format" table
in the crazyflie-firmware deckctrl protocol docs).
examples/deckctrl/cam.yamlhas
WiFi camera deck(16 characters), and the deck on my desk reads back asWiFi camera de.Both commands now warn:
The warning goes to stderr so it doesn't corrupt the hex dump
bingenwrites tostdout, and
binflashprints it before touching the probe. The limit itself isunchanged and nothing is rejected — a configuration that was already flashed
still works.
stored_name()is now the single source of truth for the truncation, used byboth
to_bytes()and the warning, so the message can't drift from what actuallygets written. It also cuts on a character boundary, where the old code could
split a multi-byte character and write invalid UTF-8 to the deck. Generated
bytes are unchanged for ASCII names.
Worth a follow-up: the deck-ctrl-firmware README describes this field as 14
bytes ending at 0x14 and omits the production date and checksum rows entirely,
so it disagrees with the protocol spec and looks stale.