fix: Prevent serial port overwrite issue#71
Open
KozueNakanoSynchrobo wants to merge 1 commit intoYDLIDAR:masterfrom
Open
fix: Prevent serial port overwrite issue#71KozueNakanoSynchrobo wants to merge 1 commit intoYDLIDAR:masterfrom
KozueNakanoSynchrobo wants to merge 1 commit intoYDLIDAR:masterfrom
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.
Proposal
This change fixes an issue where devices without a unique device_id were being overwritten in the port list, leaving only the last-found device's port.
Reason for Change
The current port search logic treats devices with an empty device_id (e.g., /dev/ttyTHS*) as having the same key. As a result, when multiple such devices were present, the information for all but the last one was lost in the list.
Change Description
The logic has been revised to use the port name itself as the map key when the device_id is empty. This ensures each port is uniquely identified, preventing data from being overwritten.
Effect of Change
With this fix, multiple ports like ttyTHS* will all be correctly displayed in the port list, allowing users to select the appropriate port.