This repository has been archived by the owner on Mar 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 114
Rewrite based around napi and context aware #127
Closed
Closed
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
2a0e65e
chore: update some deps
Julusian 81f61ba
wip: napi conversion tool
Julusian 702c9b7
wip: partial
Julusian 71f57de
wip: nothing useful
Julusian 29d40ff
wip: tidy up some devicelist stuff
Julusian 8f25425
feat: mostly working linux
Julusian 2da4a08
chore: remove dead events code
Julusian d2ba756
fix: classify devicelist
Julusian a3102a6
feat: finish linux, make worker-safe
Julusian 6a42cf0
feat: linux find
Julusian d22dd3d
fix: prebuild
Julusian 5b970fb
fix: tests
Julusian 4563d06
fix: segfault with rapid start and stop
Julusian 4573149
feat: move some more logic to the shared base
Julusian cdf53a2
feat: reimplement windows
Julusian b328c60
feat: reimplement mac
Julusian bc60591
wip: general refactoring
Julusian 5c67528
fix: memory leaks
Julusian 13e069a
fix: tiny mac leak
Julusian 16b9529
feat: build mac multi-arch binary
Julusian 9470516
fix: linux memory leak
Julusian 86ec291
chore: some comments
Julusian 859e50d
Merge remote-tracking branch 'upstream/master' into feat/napi
Julusian 954e582
chore: remove electron note from readme as it is simple with node-api
Julusian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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.
The reason I started using this project 6 years ago was because it was the only project that actually worked on Windows (and the other OS's). Although not my use case, it also seems like a lot of people use this with Electron so it would be good to have a compatible option there too.
The second criteria is documentation which looks to be available on https://github.com/node-usb/node-usb#usbdetection
A third criteria is it actually being able to be built and installed easily. This means prebuilds or ideally no C++ code necessary if that was even possible.
If those can be addressed(which some already are), then I could see this being deprecated in favor of
usb
.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.
@thegecko (repost that in this thread)
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.
@MadLittleMods I believe with the
v2.x.x
release ofnode-usb
, all of your criteria are now metThere 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.
@thegecko Tested and seems to work. I think we can move forward with deprecating as I'm running into a wall trying to get prebuilds to work anyway (#165 (comment)).
To note some differences and preemptively answer some peoples questions, how do we get
deviceName
,manufacturer
,serialNumber
when using theusb
package? Maybe I'm just not understanding how to get aUSBDevice
which seems to have those properties as described in the readme and somehow mixing the legacy API.usb-detection
usb
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.
The legacy API returns the raw USB data which doesn't undertake further blocking calls to obtain the strings (e.g. serial number, device name, etc.).
You can get these in a manner of ways:
getDeviceList()
or your legacy event and call getStringDescriptor for each of the string IDs