-
Notifications
You must be signed in to change notification settings - Fork 89
Vid pid details #369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vid pid details #369
Conversation
mbed_lstools/linux.py
Outdated
full_sysfs_path = os.readlink(sysfs_path) | ||
path_parts = full_sysfs_path.split('/') | ||
|
||
end_index = -1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's more pythonic to use None
here.
mbed_lstools/linux.py
Outdated
usb_info_path = os.path.join(SYSFS_BLOCK_DEVICE_PATH, os.sep.join(usb_info_rel_path)) | ||
|
||
vendor_id = 'unknown' | ||
product_id = 'unknown' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to use None
here as well. I don't like string matching on "unknown" as an API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second thought, `"unknown"` is completely unnecessary, I'll just leave it as `None`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests look great!
Thanks for the feedback, I'll get those changes in soon |
Changes pushed! FYI I have firmware detection based on this working! When this gets merged I'll put up the firmware detection PR. |
@bridadan Let's have that firmware detection PR. |
This is part of the solution to #165. The next step would take place in the base class which would be responsible for altering the
device_type
field.This PR implements a mechanism for each OS (Windows, Linux, and Mac) to provide the Vendor ID and Product ID of the Mbed devices present on the system. These two data items are present in the results as
vendor_id
andproduct_id
respectively.Both the
vendor_id
andproduct_id
fields should be displayed as a 4 character, lower case hex string.FYI @theotherjimmy @jupe
Here is some sample output: