Skip to content

fix: Prevent serial port overwrite issue#71

Open
KozueNakanoSynchrobo wants to merge 1 commit intoYDLIDAR:masterfrom
smilerobotics:fix/KozueNakanoSynchrobo/prevent-port-overwrite-issue
Open

fix: Prevent serial port overwrite issue#71
KozueNakanoSynchrobo wants to merge 1 commit intoYDLIDAR:masterfrom
smilerobotics:fix/KozueNakanoSynchrobo/prevent-port-overwrite-issue

Conversation

@KozueNakanoSynchrobo
Copy link

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.

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.

1 participant