diff --git a/docs/api/lazerscanner.md b/docs/api/lazerscanner.md index 2a5d7a73..98ce59af 100644 --- a/docs/api/lazerscanner.md +++ b/docs/api/lazerscanner.md @@ -6,4 +6,35 @@ This documentation is a work in progress. ::: -Direct control over the scanner search. \ No newline at end of file +`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 + +: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. +::: \ No newline at end of file diff --git a/docs/api/scanner_callbacks.md b/docs/api/scanner_callbacks.md index fe6a0fe2..1ad6e4b6 100644 --- a/docs/api/scanner_callbacks.md +++ b/docs/api/scanner_callbacks.md @@ -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.