Skip to content

Commit

Permalink
Add lazerscanner ref #130
Browse files Browse the repository at this point in the history
  • Loading branch information
DaSpood committed Mar 29, 2024
1 parent feb8ea9 commit 6c99984
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
33 changes: 32 additions & 1 deletion docs/api/lazerscanner.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,35 @@
This documentation is a work in progress.
:::

Direct control over the scanner search.
`LazerScanner` is the main scanner factory and the core of the library. It is in charge of finding
scanner providers and scanner devices. Most users will let the [`ScannerService`](scanner_service)
handle its own instance of `LazerScanner`, but should you need it, you can use its static methods
directly.

:::{method} discoverProviders(Context ctx, ProviderDiscoveredCallback cb) -> void

Discovers scanner providers through service intent and retrieves them through reflection.
The providers are cached and do not need to be discovered again unless new entries are expected, it
is a costly operation.

:param Context ctx: a context used to retrieve a `PackageManager`
:param ProviderDiscoveredCallback cb: The callback used whenever a provider is found.
Automatically wrapped by a `ProviderDiscoveredCallbackProxy`, for which a public overload exists
:::

:::{method} getProviderCache() -> List<String>

:returns: the list of provider keys from the current provider cache, including bluetooth ones if
available (the cache needs to have been initialized first).
:::

:::{method} getLaserScanner(Context ctx, ScannerConnectionHandler handler, ScannerSearchOptions options) -> void

Search for new laser scanners with available providers. The scanner is provided through a callback.
There is a specific callback when no scanner is available.

:param Context ctx: a context used to retrieve a `PackageManager`
:param ScannerConnectionHandler handler: The callback used whenever a scanner is found.
Automatically wrapped by a `ScannerConnectionHandlerProxy`, for which a public overload exists.
:param ScannerSearchOptions options: The options used to refine the search.
:::
2 changes: 1 addition & 1 deletion docs/api/scanner_callbacks.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Called when the command failed, either through or SDK error or negative answer (
Called when the command's expected answer did not arrive in time (usually only with BT scanners).
:::

## The `ScannerConnectionHandler` interface and `ScannerCommandCallbackProxy` class
## The `ScannerConnectionHandler` interface and `ScannerConnectionHandlerProxy` class

Callback used during the scanner search to retrieve created [`Scanner`](scanner) instances.

Expand Down

0 comments on commit 6c99984

Please sign in to comment.