Device Visibility
The Standalone SDK allows integrators to retrieve key information about the connected scanner device. This feature provides visibility into device details such as firmware version, model number, and battery status — enabling better monitoring and diagnostics during integration or runtime.
Retrieving device information
To obtain device visibility data, call obtainDeviceVisibilityInfo() from the PgManager.
This method does not require any input parameters. You only need to define a callback using the IPgDeviceVisibilityCallback interface.
The callback provides:
onDeviceVisibilityInfoObtained(deviceVisibilityInfo: PgDeviceVisibilityInfo)– Returns the device visibility data.onError(error: PgError)– Called if the information cannot be retrieved.
Example:
PgManager.obtainDeviceVisibilityInfo(callback = object : IPgDeviceVisibilityCallback {
override fun onDeviceVisibilityInfoObtained(deviceVisibilityInfo: PgDeviceVisibilityInfo) {
// Handle retrieved device visibility information
}
override fun onError(error: PgError) {
// Handle error if device visibility info cannot be obtained
}
})PgDeviceVisibilityInfo
The result returned by onDeviceVisibilityInfoObtained() is wrapped in the PgDeviceVisibilityInfo class, which provides the following fields:
Field | Description |
|---|---|
| Serial number of the connected scanner. Returns an empty string if unavailable. |
| Firmware version of the connected device. Returns an empty string if unavailable. |
| Current battery level of the device (0–100). |
| Model number of the connected device. Returns an empty string if unavailable. |
| Version of the Barcode Scan Engine (BCE). Returns an empty string if unavailable. |
| Manufacturer name of the connected device. Returns an empty string if unavailable. |
| Version of the current Standalone SDK being used. |
Best Practices
Use Device Visibility as part of your diagnostic or status-check workflow.
Call
obtainDeviceVisibilityInfo()only when the scanner is connected.Cache the retrieved information for offline status reporting or audit logs.
Combine with other Standalone SDK features (e.g., trigger blocking or feedback) to maintain full runtime awareness of connected devices.