-
Notifications
You must be signed in to change notification settings - Fork 4
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
aussedatlo
merged 10 commits into
develop
from
feature/DSDK-180-usb-service-discovery-service
Feb 21, 2024
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
30cb364
π¨ (core): Update feature to module
aussedatlo 317e0d9
βοΈ (core): New example with WebHid api getDevices
aussedatlo e86b287
π¨ (core): Remove TS compilerOptions types
aussedatlo 8b018d4
β¨ (core): New usb, device-model and discovery modules
aussedatlo 77d61ef
βοΈ (sample): Simple demo of device sdk usage in sample app
aussedatlo ac368a3
π₯ (core): Remove template transport module
aussedatlo 8933ec1
π¨ (core,lint): Move eslint mjs override in core config
aussedatlo f488afe
π¨ (core): Remove src folder from test script
aussedatlo fddc243
π (chore): Add build dependency to lint job
aussedatlo 5b4e22b
π (packages): Fix prettier CI job by adding prettierignore files
aussedatlo 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,16 @@ | ||
import { Container } from "inversify"; | ||
import { Observable } from "rxjs"; | ||
|
||
import { types as ConfigTypes } from "@internal/config/di/configTypes"; | ||
import { GetSdkVersionUseCase } from "@internal/config/usecase/GetSdkVersionUseCase"; | ||
import { discoveryDiTypes } from "@internal/discovery/di/discoveryDiTypes"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [ASK] |
||
import { | ||
ConnectUseCase, | ||
ConnectUseCaseArgs, | ||
} from "@internal/discovery/use-case/ConnectUseCase"; | ||
import type { StartDiscoveringUseCase } from "@internal/discovery/use-case/StartDiscoveringUseCase"; | ||
import type { StopDiscoveringUseCase } from "@internal/discovery/use-case/StopDiscoveringUseCase"; | ||
import { DiscoveredDevice } from "@internal/usb/model/DiscoveredDevice"; | ||
import { makeContainer, MakeContainerProps } from "@root/src/di"; | ||
|
||
export class DeviceSdk { | ||
|
@@ -27,4 +36,22 @@ export class DeviceSdk { | |
.get<GetSdkVersionUseCase>(ConfigTypes.GetSdkVersionUseCase) | ||
.getSdkVersion(); | ||
} | ||
|
||
startDiscovering(): Observable<DiscoveredDevice> { | ||
return this.container | ||
.get<StartDiscoveringUseCase>(discoveryDiTypes.StartDiscoveringUseCase) | ||
.execute(); | ||
} | ||
|
||
stopDiscovering() { | ||
return this.container | ||
.get<StopDiscoveringUseCase>(discoveryDiTypes.StopDiscoveringUseCase) | ||
.execute(); | ||
} | ||
|
||
connect(args: ConnectUseCaseArgs) { | ||
return this.container | ||
.get<ConnectUseCase>(discoveryDiTypes.ConnectUseCase) | ||
.execute(args); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import "reflect-metadata"; | ||
|
||
export * from "./api"; | ||
export * from "./transport"; |
15 changes: 15 additions & 0 deletions
15
packages/core/src/internal/device-model/data/DeviceModelDataSource.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { | ||
DeviceModel, | ||
DeviceModelId, | ||
} from "@internal/device-model/model/DeviceModel"; | ||
|
||
/** | ||
* Source of truth for the device models | ||
*/ | ||
export interface DeviceModelDataSource { | ||
getAllDeviceModels(): DeviceModel[]; | ||
|
||
getDeviceModel(params: { id: DeviceModelId }): DeviceModel; | ||
|
||
filterDeviceModels(params: Partial<DeviceModel>): DeviceModel[]; | ||
} |
Oops, something went wrong.
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.
This was discussed with @valpinkman :
It was making it mandatory to list all added types packages, which was not practical and causing issues with
@types/w3c-web-hid