Skip to content
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

✨ (core) [DSDK-180]: Add new USB discovery module #15

Merged
merged 10 commits into from
Feb 21, 2024

Conversation

alexandremgo
Copy link
Contributor

@alexandremgo alexandremgo commented Jan 29, 2024

πŸ“ Description

First implementation of the usb, device-model and discovery modules πŸ¦–.

Details

New usb module:

  • Setting up the module and DI
  • UsbHidTransport definition (like a data-source)
  • WebUsbHidTransport WebHid implementation
    • with a start and stop discovering, and connect
    • and a quick bonus exchange apdu
    • some unit tests

New device-model module:

  • Setting up the module and DI
  • DeviceModelDataSource definition
  • InMemoryDeviceModelDataSource implementation

New discovery modules

  • Setting up the module and DI
  • start and stop discovery uses cases
  • connect use case with an added (but should be removed, just for demo) apdu exchange

PS: some unit-tests are missing, sorry i don't think i will have the time to add them.
PS 2: i forgot to move the errors definitions in their own file, sorry

Also added in the sample app a simple demo: start discovery, connect to device with a get-version apdu exchange in bonus

And finally, i updated pocs/web-hid-api/ to add a new example of WebHid api getDevices and to demonstrate that once a device of model/productId A is granted access, any other model/productId A device is also granted access, even if plugged in another USB port.

πŸ”₯ Web HID POC device SDK demo πŸ”₯
WebHID_DeviceSDK_NanoSP_NanoX.mp4

❓ Context

βœ… Checklist

Pull Requests must pass the CI and be code reviewed. Set as Draft if the PR is not ready.

  • Covered by automatic tests.
  • [ ] Impact of the changes:


🧐 Checklist for the PR Reviewers

  • The code aligns with the requirements described in the linked JIRA or GitHub issue.
  • The PR description clearly documents the changes made and explains any technical trade-offs or design decisions.
  • There are no undocumented trade-offs, technical debt, or maintainability issues.
  • The PR has been tested thoroughly, and any potential edge cases have been considered and handled.
  • Any new dependencies have been justified and documented.

Copy link

vercel bot commented Jan 29, 2024

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Comments Updated (UTC)
device-sdk-ts-sample βœ… Ready (Inspect) Visit Preview πŸ’¬ Add feedback Feb 14, 2024 1:11pm

@alexandremgo alexandremgo force-pushed the feature/DSDK-180-usb-service-discovery-service branch from 2a92c6c to cddbc09 Compare January 29, 2024 19:32
@alexandremgo alexandremgo force-pushed the feature/DSDK-180-usb-service-discovery-service branch from e5caded to d3bdc5f Compare February 1, 2024 14:12
@alexandremgo alexandremgo force-pushed the feature/DSDK-180-usb-service-discovery-service branch from b30291b to 80d2f65 Compare February 2, 2024 17:07
@alexandremgo alexandremgo force-pushed the feature/DSDK-180-usb-service-discovery-service branch from 80d2f65 to b4e2019 Compare February 2, 2024 17:14
@alexandremgo alexandremgo force-pushed the feature/DSDK-180-usb-service-discovery-service branch from 678b81d to 37e630c Compare February 6, 2024 16:19
@alexandremgo alexandremgo force-pushed the feature/DSDK-180-usb-service-discovery-service branch from 37e630c to eed5f2e Compare February 7, 2024 09:39
@alexandremgo alexandremgo force-pushed the feature/DSDK-180-usb-service-discovery-service branch from eed5f2e to 538432d Compare February 7, 2024 15:16
@alexandremgo alexandremgo force-pushed the feature/DSDK-180-usb-service-discovery-service branch from 538432d to dada1e2 Compare February 7, 2024 16:17
@aussedatlo aussedatlo force-pushed the feature/DSDK-180-usb-service-discovery-service branch 6 times, most recently from 18d1fec to 27229f8 Compare February 21, 2024 09:22
@aussedatlo aussedatlo changed the title [DSDK-180][POC] First implementation of the USB Module ✨ (core): Add new USB discovery module [DSDK-180] Feb 21, 2024
@aussedatlo aussedatlo force-pushed the feature/DSDK-180-usb-service-discovery-service branch from 27229f8 to bf597d8 Compare February 21, 2024 09:45
@aussedatlo aussedatlo changed the title ✨ (core): Add new USB discovery module [DSDK-180] ✨ (core) [DSDK-180]: Add new USB discovery module Feb 21, 2024
@aussedatlo aussedatlo marked this pull request as ready for review February 21, 2024 11:01
To demonstrate that once a device of model/productId A is granted access, any other model/productId A device is also granted access, even if plugged in another USB port.
It was making it mandatory to list all added types packages, which was not practical and causing issues with @types/w3c-web-hid
- in usb: UsbHidTransport and its WebHid implementation
- in device-model: DeviceModelDataSource and its in-memory implementation
- discovery: start and stop discovery uses cases, and connect use case
avoid lint errors in sample when using core imports
@aussedatlo aussedatlo force-pushed the feature/DSDK-180-usb-service-discovery-service branch from c3ed33e to 5b4e22b Compare February 21, 2024 11:02
@aussedatlo aussedatlo merged commit da49397 into develop Feb 21, 2024
1 of 2 checks passed
@valpinkman valpinkman deleted the feature/DSDK-180-usb-service-discovery-service branch April 17, 2024 16:25
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.

5 participants