CaptureHelper class
The primary developer-facing class for Socket Mobile CaptureSDK integration.
Call open with your AppInfo and optional event callbacks to start an SDK session. CaptureHelper manages the connection lifecycle, device map, event routing, and open-time buffering transparently.
Typical usage:
final helper = CaptureHelper();
await helper.open(appInfo,
onDeviceArrival: (device) { ... },
onDecodedData: (data, device) { ... },
);
Constructors
- CaptureHelper({Capture captureFactory()?})
- Creates a CaptureHelper.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- pendingIdentifierUuidForTest → String?
-
Exposes
_pendingIdentifierUuidfor test assertion.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addBluetoothDevice(
{required int mode}) → Future< int> -
Starts a Bluetooth device discovery scan for the given
mode. -
bleIdentifierForGuid(
String guid) → String? -
Exposes the BLE identifier for a device
guid, or null if not present. -
close(
) → Future< int> - Closes the SDK session and all open device handles.
-
connectDiscoveredDevice(
{required DiscoveredDeviceInfo device}) → Future< int> -
Connects to a previously discovered BLE
device. -
disconnectFromDiscoveredDevice(
{required DiscoveredDeviceInfo device}) → Future< int> -
Disconnects from a discovered BLE
device. -
getDevices(
) → List< CaptureHelperDevice> - Returns a snapshot of currently connected devices.
-
getDeviceUniqueIdentifier(
{required String guid}) → Future -
Returns the BLE unique device identifier for a device identified by
guid. -
getSocketCamDevice(
) → CaptureHelperDevice? - Returns the current SocketCam device, or null if none is connected.
-
getSocketCamEnabled(
) → Future - Returns the current SocketCam status byte.
-
getVersion(
) → Future - Returns the CaptureSDK service version string.
-
injectBleDeviceManagerForTest(
Capture bleDeviceManager) → void - Injects a Capture instance as the BLE device manager.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
open(
AppInfo appInfo, {void onDeviceArrival(CaptureHelperDevice)?, void onDeviceRemoval(CaptureHelperDevice)?, void onDecodedData(DecodedData, CaptureHelperDevice)?, void onError(CaptureException)?, void onBatteryLevel(int, CaptureHelperDevice)?, void onPowerState(int, CaptureHelperDevice)?, void onButtons(int, CaptureHelperDevice)?, void onSocketCamCanceled(CaptureHelperDevice)?, void onDiscoveredDevice(DiscoveredDeviceInfo)?, void onDiscoveryEnd(int)?, void onLogTrace(String)?}) → Future< int> -
Opens an SDK session using the provided
appInfo. -
removeBleDevice(
{required CaptureHelperDevice device}) → Future< int> - Removes a BLE device.
-
removeBleDeviceForTest(
{required String guid, required String identifierUuid}) → Future< int> -
Test-only entry point for removeBleDevice that accepts raw
guidandidentifierUuidstrings instead of a full CaptureHelperDevice. -
setSocketCamEnabled(
{required int enabled}) → Future< int> - Enables or disables SocketCam.
-
setSocketCamSymbologySelectorDisabled(
{required bool disabled}) → Future< int> - Enables or disables the SocketCam symbology selector overlay.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited