-
Notifications
You must be signed in to change notification settings - Fork 184
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 are strings? #108
Labels
Comments
Yes, that's a big problem... maybe in a future major release we may change them, but in the meantime, it's a nice idea to use May you want to open a PR for that? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was pleasantly surprised the enumerator subpackage supports USB VID/PID numbers so it's possible to filter serial ports on them.
However, I found that VID and PID are stored as strings? That doesn't make a lot of sense to me, as these are 16-bit numbers and we have a Go type for this:
uint16
.strconv.ParseUint
works, but requires extra error handling and in general seems less reliable. Example code:Maybe this ship has sailed already (because of API breakage) but in my opinion changing this to use
uint16
would make the API easier to use.For reference: tinygo-org/tinygo#1956
The text was updated successfully, but these errors were encountered: