Capacitor.JS

Sunmi Scan Head (lite) SDK for Capacitor.js

Sunmi Barcode Scanner bindings for Capacitor - version compatible with RFID plugin

@kduma-autoid/capacitor-sunmi-scanhead-lite

Sunmi Scan Head (lite) bindings for Capacitor.

This lite version is created for compatibility with Sunmi UHF RFID plugin (@kduma-autoid/capacitor-sunmi-uhf), which uses the same service name. It differs from the original version in that it uses packaged library (SunmiScannerSdk-release-v1.1.8.aar) instead of decompiled code, and due to that it lacks few features - like reading advancedFormats.

Install

npm install @kduma-autoid/capacitor-sunmi-scanhead-lite
npx cap sync

Configuration

You can disable auto binding of the service by setting bindOnLoad to false in the plugin configuration in capacitor.config.ts.

/// <reference types="@kduma-autoid/capacitor-sunmi-scanhead-lite" />
import { CapacitorConfig } from '@capacitor/cli';

const config: CapacitorConfig = {
  appId: "com.company.app",
  ...
  plugins: {
    SunmiScanHead: {
      bindOnLoad: true
    }
  }
}
export default config;

API

bindService()

bindService() => Promise<void>

bind scan service


unBindService()

unBindService() => Promise<void>

unbind scan service


scan()

scan() => Promise<void>

Start scanner


stop()

stop() => Promise<void>

Stop scanner


getScannerModel()

getScannerModel() => Promise<GetScannerModelResponse>

Get scanner model

Returns: Promise<GetScannerModelResponse>


clearConfig()

clearConfig() => Promise<ClearConfigResponse>

Clear scanner configuration (reset to default)

Returns: Promise<ClearConfigResponse>


setTrigger(...)

setTrigger(options?: SetTriggerOptions | undefined) => Promise<void>

Enable or disable trigger button

ParamType
optionsSetTriggerOptions

beep()

beep() => Promise<void>

Play a beep sound


vibrate()

vibrate() => Promise<void>

Vibrate


createWriteContext(...)

createWriteContext(options?: CreateWriteContextOptions | undefined) => Promise<void>

Prepares transaction for writing settings to scanner


commitWriteContext()

commitWriteContext() => Promise<void>

Write settings to scanner


discardWriteContext()

discardWriteContext() => Promise<void>

Discard transaction for writing settings to scanner


getOutputType()

getOutputType() => Promise<GetOutputTypeResponse>

Gets current output mode

Returns: Promise<GetOutputTypeResponse>


setOutputType(...)

setOutputType(options: SetOutputTypeOptions) => Promise<void>

Set output mode

ParamType
optionsSetOutputTypeOptions

getTriggerMethod()

getTriggerMethod() => Promise<GetTriggerMethodResponse>

Gets current scan mode

Returns: Promise<GetTriggerMethodResponse>


setTriggerMethod(...)

setTriggerMethod(options: SetTriggerMethodOptions) => Promise<void>

Set scan mode

ParamType
optionsSetTriggerMethodOptions

getScanResultCodeID()

getScanResultCodeID() => Promise<GetScanResultCodeIDResponse>

Gets current variant of code type returned with scan result

Returns: Promise<GetScanResultCodeIDResponse>


setScanResultCodeID(...)

setScanResultCodeID(options?: SetScanResultCodeIDOptions | undefined) => Promise<void>

Selects variant of code type returned with scan result


isAdvancedFormatEnabled()

isAdvancedFormatEnabled() => Promise<IsAdvancedFormatEnabledResponse>

Checks if advanced formatting options provided in configuration are enabled

Returns: Promise<IsAdvancedFormatEnabledResponse>


setAdvancedFormatEnabled(...)

setAdvancedFormatEnabled(options?: SetAdvancedFormatEnabledOptions | undefined) => Promise<void>

Enable or disable advanced formatting options provided in configuration


getAdvancedFormats()

getAdvancedFormats() => Promise<GetAdvancedFormatEnabledResponse>

Gets advanced formatting options (character replacement arrays) provided in configuration

Returns: Promise<GetAdvancedFormatEnabledResponse>


setAdvancedFormats(...)

setAdvancedFormats(options: SetAdvancedFormatOptions) => Promise<void>

Sets advanced formatting options (character replacement arrays) provided in configuration

ParamType
optionsSetAdvancedFormatOptions

clearAdvancedFormats()

clearAdvancedFormats() => Promise<void>

Clears all advanced formatting options


addAdvancedFormat(...)

addAdvancedFormat(options: AddAdvancedFormatOptions) => Promise<void>

Adds new advanced formatting option

ParamType
optionsAddAdvancedFormatOptions

updateAdvancedFormat(...)

updateAdvancedFormat(options: UpdateAdvancedFormatOptions) => Promise<void>

Updates advanced formatting option


removeAdvancedFormat(...)

removeAdvancedFormat(options: RemoveAdvancedFormatOptions) => Promise<void>

Removes advanced formatting option


isBeep()

isBeep() => Promise<IsBeepResponse>

Checks if sound prompts on scan are enabled

Returns: Promise<IsBeepResponse>


setBeep(...)

setBeep(options?: SetBeepOptions | undefined) => Promise<void>

Enable or disable sound prompts on scan

ParamType
optionsSetBeepOptions

isVibrate()

isVibrate() => Promise<IsVibrateResponse>

Checks if vibration prompts on scan are enabled

Returns: Promise<IsVibrateResponse>


setVibrate(...)

setVibrate(options?: SetVibrateOptions | undefined) => Promise<void>

Enable or disable vibration prompts on scan

ParamType
optionsSetVibrateOptions

isOutputBroadcastEnabled()

isOutputBroadcastEnabled() => Promise<IsOutputBroadcastEnableResponse>

Checks if scan result broadcast is enabled

Returns: Promise<IsOutputBroadcastEnableResponse>


setOutputBroadcastEnabled(...)

setOutputBroadcastEnabled(options?: SetOutputBroadcastEnabledOutput | undefined) => Promise<void>

Enable or disable scan result broadcast


getBroadcastConfiguration()

getBroadcastConfiguration() => Promise<GetBroadcastConfigurationResponse>

Get broadcast configuration

Warning: This method only reads what you have wrote to write context, as there is no way to read those settings from system at this moment (If you know how, please make a PR)

Returns: Promise<GetBroadcastConfigurationResponse>


setBroadcastConfiguration(...)

setBroadcastConfiguration(options?: SetBroadcastConfigurationOptions | undefined) => Promise<void>

Set broadcast configuration


getOutputEncodingCode()

getOutputEncodingCode() => Promise<GetOutputEncodingCodeResponse>

Get current output encoding/character set setting

Returns: Promise<GetOutputEncodingCodeResponse>


setOutputEncodingCode(...)

setOutputEncodingCode(options?: SetOutputEncodingCodeOptions | undefined) => Promise<void>

Set output encoding/character set setting


isVirtualFloatingScanButton()

isVirtualFloatingScanButton() => Promise<IsVirtualFloatingScanButtonResponse>

Checks if virtual floating scan button is enabled

Returns: Promise<IsVirtualFloatingScanButtonResponse>


setVirtualFloatingScanButton(...)

setVirtualFloatingScanButton(options?: SetVirtualFloatingScanButtonOptions | undefined) => Promise<void>

Enable or disable the virtual floating scan button


getCenterFlagScan()

getCenterFlagScan() => Promise<GetCenterFlagScanResponse>

Gets current center point decoding mode

Returns: Promise<GetCenterFlagScanResponse>


setCenterFlagScan(...)

setCenterFlagScan(options?: SetCenterFlagScanOptions | undefined) => Promise<void>

Sets center point decoding mode

ParamType
optionsSetCenterFlagScanOptions

isFlash()

isFlash() => Promise<IsFlashResponse>

Checks if scanner illumination is enabled

Returns: Promise<IsFlashResponse>


setFlash(...)

setFlash(options?: SetFlashOptions | undefined) => Promise<void>

Controls scanner illumination

Hardware support limited

ParamType
optionsSetFlashOptions

getScene()

getScene() => Promise<GetSceneResponse>

Gets current scanning scene preset

Returns: Promise<GetSceneResponse>


setScene(...)

setScene(options?: SetSceneOptions | undefined) => Promise<void>

Sets scanning scene preset

Hardware support limited

ParamType
optionsSetSceneOptions

isRemoveGroupSeparator()

isRemoveGroupSeparator() => Promise<IsRemoveGroupSeparatorResponse>

Checks if the removal of group separator characters is enabled

Returns: Promise<IsRemoveGroupSeparatorResponse>


setRemoveGroupSeparator(...)

setRemoveGroupSeparator(options?: SetRemoveGroupSeparatorOptions | undefined) => Promise<void>

Enables or disables the removal of group separator characters

Hardware support limited


getPrefix()

getPrefix() => Promise<GetPrefixResponse>

Gets the prefix which is prepended to the barcode data

Returns: Promise<GetPrefixResponse>


setPrefix(...)

setPrefix(options?: SetPrefixOptions | undefined) => Promise<void>

Sets the prefix to be prepended to the barcode data

ParamType
optionsSetPrefixOptions

getPrefixCharactersRemoved()

getPrefixCharactersRemoved() => Promise<GetPrefixCharactersRemovedResponse>

Gets the number of characters which are removed from the beginning of the barcode data

Returns: Promise<GetPrefixCharactersRemovedResponse>


setPrefixCharactersRemoved(...)

setPrefixCharactersRemoved(options?: SetPrefixCharactersRemovedOptions | undefined) => Promise<void>

Sets the prefix characters to be removed from the barcode data

Hardware support limited


getSuffix()

getSuffix() => Promise<GetSuffixResponse>

Gets the suffix which is appended to the barcode data

Returns: Promise<GetSuffixResponse>


setSuffix(...)

setSuffix(options?: SetSuffixOptions | undefined) => Promise<void>

Sets the suffix to be appended to the barcode data

ParamType
optionsSetSuffixOptions

getSuffixCharactersRemoved()

getSuffixCharactersRemoved() => Promise<GetSuffixCharactersRemovedResponse>

Gets the number of characters which are removed from the end of the barcode data

Returns: Promise<GetSuffixCharactersRemovedResponse>


setSuffixCharactersRemoved(...)

setSuffixCharactersRemoved(options?: SetSuffixCharactersRemovedOptions | undefined) => Promise<void>

Sets the suffix characters to be removed from the barcode data

Hardware support limited


getBarcodesList()

getBarcodesList() => Promise<GetBarcodesListResponse>

Gets the list of barcodes, and its statuses.

Returns: Promise<GetBarcodesListResponse>


getBarcode(...)

getBarcode(options: GetBarcodeOptions) => Promise<GetBarcodeResponse>

Gets the status of a barcode

ParamType
optionsGetBarcodeOptions

Returns: Promise<GetBarcodeResponse>


setBarcode(...)

setBarcode(options: SetBarcodeOptions) => Promise<void>

Sets the status of a barcode

ParamType
optionsSetBarcodeOptions

getBarcodeConfig(...)

getBarcodeConfig(options: GetBarcodeConfigOptions) => Promise<GetBarcodeConfigResponse>

Gets the configuration of a barcode symbology

ParamType
optionsGetBarcodeConfigOptions

Returns: Promise<GetBarcodeConfigResponse>


getCheckCharMode(...)

getCheckCharMode(options: GetCheckCharModeOptions) => Promise<GetCheckCharModeResponse>
ParamType
optionsGetCheckCharModeOptions

Returns: Promise<GetCheckCharModeResponse>


setCheckCharMode(...)

setCheckCharMode(options: SetCheckCharModeOptions) => Promise<void>
ParamType
optionsSetCheckCharModeOptions

getCheckCharType(...)

getCheckCharType(options: GetCheckCharTypeOptions) => Promise<GetCheckCharTypeResponse>
ParamType
optionsGetCheckCharTypeOptions

Returns: Promise<GetCheckCharTypeResponse>


setCheckCharType(...)

setCheckCharType(options: SetCheckCharTypeOptions) => Promise<void>
ParamType
optionsSetCheckCharTypeOptions

getDoubleCode(...)

getDoubleCode(options: GetDoubleCodeOptions) => Promise<GetDoubleCodeResponse>
ParamType
optionsGetDoubleCodeOptions

Returns: Promise<GetDoubleCodeResponse>


setDoubleCode(...)

setDoubleCode(options: SetDoubleCodeOptions) => Promise<void>
ParamType
optionsSetDoubleCodeOptions

getFormatCode(...)

getFormatCode(options: GetFormatCodeOptions) => Promise<GetFormatCodeResponse>
ParamType
optionsGetFormatCodeOptions

Returns: Promise<GetFormatCodeResponse>


setFormatCode(...)

setFormatCode(options: SetFormatCodeOptions) => Promise<void>
ParamType
optionsSetFormatCodeOptions

getInverseCode(...)

getInverseCode(options: GetInverseCodeOptions) => Promise<GetInverseCodeResponse>
ParamType
optionsGetInverseCodeOptions

Returns: Promise<GetInverseCodeResponse>


setInverseCode(...)

setInverseCode(options: SetInverseCodeOptions) => Promise<void>
ParamType
optionsSetInverseCodeOptions

isExtendCode1(...)

isExtendCode1(options: IsExtendCode1Options) => Promise<IsExtendCode1Response>
ParamType
optionsIsExtendCode1Options

Returns: Promise<IsExtendCode1Response>


setExtendCode1(...)

setExtendCode1(options: SetExtendCode1Options) => Promise<void>
ParamType
optionsSetExtendCode1Options

isExtendCode2(...)

isExtendCode2(options: IsExtendCode2Options) => Promise<IsExtendCode2Response>
ParamType
optionsIsExtendCode2Options

Returns: Promise<IsExtendCode2Response>


setExtendCode2(...)

setExtendCode2(options: SetExtendCode2Options) => Promise<void>
ParamType
optionsSetExtendCode2Options

isExtendToCode(...)

isExtendToCode(options: IsExtendToCodeOptions) => Promise<IsExtendToCodeResponse>
ParamType
optionsIsExtendToCodeOptions

Returns: Promise<IsExtendToCodeResponse>


setExtendToCode(...)

setExtendToCode(options: SetExtendToCodeOptions) => Promise<void>
ParamType
optionsSetExtendToCodeOptions

isMicroCode(...)

isMicroCode(options: IsMicroCodeOptions) => Promise<IsMicroCodeResponse>
ParamType
optionsIsMicroCodeOptions

Returns: Promise<IsMicroCodeResponse>


setMicroCode(...)

setMicroCode(options: SetMicroCodeOptions) => Promise<void>
ParamType
optionsSetMicroCodeOptions

isStartEndType(...)

isStartEndType(options: IsStartEndTypeOptions) => Promise<IsStartEndTypeResponse>
ParamType
optionsIsStartEndTypeOptions

Returns: Promise<IsStartEndTypeResponse>


setStartEndType(...)

setStartEndType(options: SetStartEndTypeOptions) => Promise<void>
ParamType
optionsSetStartEndTypeOptions

isSystemCharZero(...)

isSystemCharZero(options: IsSystemCharZeroOptions) => Promise<IsSystemCharZeroResponse>
ParamType
optionsIsSystemCharZeroOptions

Returns: Promise<IsSystemCharZeroResponse>


setSystemCharZero(...)

setSystemCharZero(options: SetSystemCharZeroOptions) => Promise<void>
ParamType
optionsSetSystemCharZeroOptions

getMaxLen(...)

getMaxLen(options: GetMaxLenOptions) => Promise<GetMaxLenResponse>
ParamType
optionsGetMaxLenOptions

Returns: Promise<GetMaxLenResponse>


setMaxLen(...)

setMaxLen(options: SetMaxLenOptions) => Promise<void>
ParamType
optionsSetMaxLenOptions

getMinLen(...)

getMinLen(options: GetMinLenOptions) => Promise<GetMinLenResponse>
ParamType
optionsGetMinLenOptions

Returns: Promise<GetMinLenResponse>


setMinLen(...)

setMinLen(options: SetMinLenOptions) => Promise<void>
ParamType
optionsSetMinLenOptions

getStartEndFormat(...)

getStartEndFormat(options: GetStartEndFormatOptions) => Promise<GetStartEndFormatResponse>
ParamType
optionsGetStartEndFormatOptions

Returns: Promise<GetStartEndFormatResponse>


setStartEndFormat(...)

setStartEndFormat(options: SetStartEndFormatOptions) => Promise<void>
ParamType
optionsSetStartEndFormatOptions

addListener('onScanResult', ...)

addListener(eventName: 'onScanResult', listenerFunc: OnScanResultListener) => Promise<PluginListenerHandle>

Listens for barcode scanner result events.

ParamType
eventName'onScanResult'
listenerFuncOnScanResultListener

Returns: Promise<PluginListenerHandle>


addListener('onScanStart', ...)

addListener(eventName: 'onScanStart', listenerFunc: OnScanStartListener) => Promise<PluginListenerHandle>

Listens for barcode scanner start events.

ParamType
eventName'onScanStart'
listenerFuncOnScanStartListener

Returns: Promise<PluginListenerHandle>


addListener('onScanStop', ...)

addListener(eventName: 'onScanStop', listenerFunc: OnScanStopListener) => Promise<PluginListenerHandle>

Listens for barcode scanner stop events.

ParamType
eventName'onScanStop'
listenerFuncOnScanStopListener

Returns: Promise<PluginListenerHandle>


removeAllListeners()

removeAllListeners() => Promise<void>

Removes all listeners


Interfaces

GetScannerModelResponse

PropTypeDescription
idnumberNumeric identifier of the scanner model
nameScannerModelNameString identifier of the scanner model

ClearConfigResponse

PropTypeDescription
clearedbooleanStatus of the operation

SetTriggerOptions

PropTypeDescriptionDefault
enabledbooleanEnable or disable trigger buttontrue

CreateWriteContextOptions

PropTypeDescriptionDefault
typeWriteContextType | WriteContextTypeSelects write context type you want to createWriteContextType.Service, WriteContextType.Decoders

GetOutputTypeDisabledResponse

PropTypeDescription
modeOutputMode.DisabledNo direct output

GetOutputTypeKeystrokeResponse

PropTypeDescription
modeOutputMode.KeystrokeVirtual Keyboard output
intervalnumberTime to sleep between keystrokes
tabbooleanSend a tab keystroke after the barcode
enterbooleanSend an enter keystroke after the barcode
spacebooleanSend a space keystroke after the barcode Hardware support limited

GetOutputTypeDirectFillResponse

PropTypeDescription
modeOutputMode.DirectFill | OutputMode.DirectFillWithReplaceFill in EditText directly
tabbooleanSend a tab keystroke after the barcode
enterbooleanSend an enter keystroke after the barcode
spacebooleanSend a space keystroke after the barcode Hardware support limited
asEventbooleanConvert characters into keys

SetOutputTypeDisabledOptions

PropTypeDescription
modeOutputMode.DisabledNo direct output

SetOutputTypeKeystrokeOptions

PropTypeDescriptionDefault
modeOutputMode.KeystrokeVirtual Keyboard output
intervalnumberTime to sleep between keystrokes0
tabbooleanSend a tab keystroke after the barcodefalse
enterbooleanSend an enter keystroke after the barcodetrue
spacebooleanSend a space keystroke after the barcode Hardware support limitedfalse

SetOutputTypeDirectFillOptions

PropTypeDescriptionDefault
modeOutputMode.DirectFill | OutputMode.DirectFillWithReplaceFill in EditText directly
tabbooleanSend a tab keystroke after the barcodefalse
enterbooleanSend an enter keystroke after the barcodetrue
spacebooleanSend a space keystroke after the barcode Hardware support limitedfalse
asEventbooleanConvert characters into keysfalse

GetTriggerMethodTriggerPulseResponse

PropTypeDescription
modeScanMode.Trigger | ScanMode.Pulse
timeoutnumberTimeout after which the scanner will stop scanning if no barcode is detected

GetTriggerMethodContinuousLongPressResponse

PropTypeDescription
modeScanMode.Continuous | ScanMode.LongPress
timeoutnumberTimeout after which the scanner will stop scanning if no barcode is detected
sleepnumberTime to sleep between scans

SetTriggerMethodTriggerPulseOptions

PropTypeDescriptionDefault
modeScanMode.Trigger | ScanMode.Pulse
timeoutnumberTimeout after which the scanner will stop scanning if no barcode is detected5000

SetTriggerMethodContinuousLongPressOptions

PropTypeDescriptionDefault
modeScanMode.Continuous | ScanMode.LongPress
timeoutnumberTimeout after which the scanner will stop scanning if no barcode is detected5000
sleepnumberTime to sleep between scans500

GetScanResultCodeIDResponse

PropTypeDescription
typeScanResultCodeIDEnumSelects variant of code type returned with scan result

SetScanResultCodeIDOptions

PropTypeDescriptionDefault
typeScanResultCodeIDEnumSelects variant of code type returned with scan resultScanResultCodeIDEnum.None

IsAdvancedFormatEnabledResponse

PropTypeDescription
enabledbooleanEnable or disable advanced formatting options provided in configuration

SetAdvancedFormatEnabledOptions

PropTypeDescriptionDefault
enabledbooleanEnable or disable advanced formatting options provided in configurationtrue

GetAdvancedFormatEnabledResponse

PropTypeDescription
formatsMap<string, string>List of advanced formatting options - characters replacement

Map

PropType
sizenumber
MethodSignature
clear() => void
delete(key: K) => boolean
forEach(callbackfn: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any) => void
get(key: K) => V | undefined
has(key: K) => boolean
set(key: K, value: V) => this

SetAdvancedFormatOptions

PropTypeDescriptionDefault
formatsMap<string, string>List of advanced formatting options - characters replacement

AddAdvancedFormatOptions

PropTypeDescription
searchstringValue to search for
replacementstringValue to replace with

UpdateAdvancedFormatOptions

PropTypeDescription
old_searchstringPrevious search value
searchstringNew search value
replacementstringValue to replace with

RemoveAdvancedFormatOptions

PropTypeDescription
searchstringValue to search for

IsBeepResponse

PropTypeDescription
enabledbooleanEnable or disable sound prompts on scan

SetBeepOptions

PropTypeDescriptionDefault
enabledbooleanEnable or disable sound prompts on scantrue

IsVibrateResponse

PropTypeDescription
enabledbooleanEnable or disable vibration prompts on scan

SetVibrateOptions

PropTypeDescriptionDefault
enabledbooleanEnable or disable vibration prompts on scantrue

IsOutputBroadcastEnableResponse

PropTypeDescription
enabledbooleanEnable or disable scan result broadcast

SetOutputBroadcastEnabledOutput

PropTypeDescriptionDefault
enabledbooleanEnable or disable scan result broadcasttrue

GetBroadcastConfigurationResponse

PropTypeDescription
scanned_intentstringIntent name broadcasted when a barcode is scanned
start_intentstring | falseIntent name broadcasted when scanner starts scanning Set to false to disable
end_intentstring | falseIntent name broadcasted when scanner stops scanning Set to false to disable
intent_data_keystringIntent extra key for barcode plain text data in scan result intent (scanned_intent)
intent_byte_keystringIntent extra key for barcode base64 encoded data in scan result intent (scanned_intent)

SetBroadcastConfigurationOptions

PropTypeDescriptionDefault
scanned_intentstringIntent name broadcasted when a barcode is scannedcom.sunmi.scanner.ACTION_DATA_CODE_RECEIVED
start_intentstring | falseIntent name broadcasted when scanner starts scanning Set to false to disablecom.sunmi.scanner.ACTION_SCAN_START
end_intentstring | falseIntent name broadcasted when scanner stops scanning Set to false to disablecom.sunmi.scanner.ACTION_SCAN_END
intent_data_keystringIntent extra key for barcode plain text data in scan result intent (scanned_intent)data
intent_byte_keystringIntent extra key for barcode base64 encoded data in scan result intent (scanned_intent)source_byte

GetOutputEncodingCodeResponse

PropTypeDescription
encodingOutputEncodingCodeEnumSet output encoding/character set setting

SetOutputEncodingCodeOptions

PropTypeDescriptionDefault
encodingOutputEncodingCodeEnumSet output encoding/character set settingOutputEncodingCodeEnum.UTF8

IsVirtualFloatingScanButtonResponse

PropTypeDescription
enabledbooleanEnable or disable virtual floating scan button

SetVirtualFloatingScanButtonOptions

PropTypeDescriptionDefault
enabledbooleanEnable or disable virtual floating scan buttontrue

GetCenterFlagScanResponse

PropTypeDescription
modeCenterDecodingSettingEnumSelects center point decoding mode

SetCenterFlagScanOptions

PropTypeDescriptionDefault
modeCenterDecodingSettingEnumSelects center point decoding modeCenterDecodingSettingEnum.Disabled

IsFlashResponse

PropTypeDescription
enabledbooleanEnable or disable scanner illumination

SetFlashOptions

PropTypeDescriptionDefault
enabledbooleanEnable or disable scanner illuminationtrue

GetSceneResponse

PropTypeDescription
sceneSpecificSceneEnumSelects scanning scene preset

SetSceneOptions

PropTypeDescriptionDefault
sceneSpecificSceneEnumSelects scanning scene presetSpecificSceneEnum.Default

IsRemoveGroupSeparatorResponse

PropTypeDescription
enabledbooleanEnable or disable the removal of group separator characters

SetRemoveGroupSeparatorOptions

PropTypeDescriptionDefault
enabledbooleanEnable or disable the removal of group separator characterstrue

GetPrefixResponse

PropTypeDescription
contentstring | falsePrefix content to be prepended to the barcode data When set to false, the prefix will be disabled

SetPrefixOptions

PropTypeDescriptionDefault
contentstring | falsePrefix content to be prepended to the barcode data When set to false, the prefix will be disabledfalse

GetPrefixCharactersRemovedResponse

PropTypeDescription
lengthnumberNumber of characters to be removed from the beginning of the barcode data

SetPrefixCharactersRemovedOptions

PropTypeDescriptionDefault
lengthnumberNumber of characters to be removed from the beginning of the barcode data0

GetSuffixResponse

PropTypeDescription
contentstring | falseSuffix content to be appended to the barcode data When set to false, the suffix will be disabled

SetSuffixOptions

PropTypeDescriptionDefault
contentstring | falseSuffix content to be appended to the barcode data When set to false, the suffix will be disabledfalse

GetSuffixCharactersRemovedResponse

PropTypeDescription
lengthnumberNumber of characters to be removed from the end of the barcode data

SetSuffixCharactersRemovedOptions

PropTypeDescriptionDefault
lengthnumberNumber of characters to be removed from the end of the barcode data0

GetBarcodesListResponse

PropTypeDescription
listMap<string, boolean>List of barcodes, and its statuses. Key is barcode symbology name, value is status: true if enabled, false if disabled.

GetBarcodeResponse

PropTypeDescription
enabledbooleanBarcode status

GetBarcodeOptions

PropTypeDescription
namestringBarcode symbology name

SetBarcodeOptions

PropTypeDescription
namestringBarcode symbology name
enabledbooleanBarcode status

GetBarcodeConfigResponse

PropType
checkCharModenumber
checkCharTypenumber
doubleCodenumber
formatCodenumber
inverseCodenumber
isExtendCode1boolean
isExtendCode2boolean
isExtendToCodeboolean
isMicroCodeboolean
isStartEndTypeboolean
isSystemCharZeroboolean
maxLennumber
minLennumber

GetBarcodeConfigOptions

PropTypeDescription
namestringBarcode symbology name

GetCheckCharModeResponse

PropType
valuenumber

GetCheckCharModeOptions

PropTypeDescription
namestringBarcode symbology name

SetCheckCharModeOptions

PropTypeDescription
namestringBarcode symbology name
valuenumber

GetCheckCharTypeResponse

PropType
valuenumber

GetCheckCharTypeOptions

PropTypeDescription
namestringBarcode symbology name

SetCheckCharTypeOptions

PropTypeDescription
namestringBarcode symbology name
valuenumber

GetDoubleCodeResponse

PropType
valuenumber

GetDoubleCodeOptions

PropTypeDescription
namestringBarcode symbology name

SetDoubleCodeOptions

PropTypeDescription
namestringBarcode symbology name
valuenumber

GetFormatCodeResponse

PropType
valuenumber

GetFormatCodeOptions

PropTypeDescription
namestringBarcode symbology name

SetFormatCodeOptions

PropTypeDescription
namestringBarcode symbology name
valuenumber

GetInverseCodeResponse

PropType
valuenumber

GetInverseCodeOptions

PropTypeDescription
namestringBarcode symbology name

SetInverseCodeOptions

PropTypeDescription
namestringBarcode symbology name
valuenumber

IsExtendCode1Response

PropType
valueboolean

IsExtendCode1Options

PropTypeDescription
namestringBarcode symbology name

SetExtendCode1Options

PropTypeDescription
namestringBarcode symbology name
valueboolean

IsExtendCode2Response

PropType
valueboolean

IsExtendCode2Options

PropTypeDescription
namestringBarcode symbology name

SetExtendCode2Options

PropTypeDescription
namestringBarcode symbology name
valueboolean

IsExtendToCodeResponse

PropType
valueboolean

IsExtendToCodeOptions

PropTypeDescription
namestringBarcode symbology name

SetExtendToCodeOptions

PropTypeDescription
namestringBarcode symbology name
valueboolean

IsMicroCodeResponse

PropType
valueboolean

IsMicroCodeOptions

PropTypeDescription
namestringBarcode symbology name

SetMicroCodeOptions

PropTypeDescription
namestringBarcode symbology name
valueboolean

IsStartEndTypeResponse

PropType
valueboolean

IsStartEndTypeOptions

PropTypeDescription
namestringBarcode symbology name

SetStartEndTypeOptions

PropTypeDescription
namestringBarcode symbology name
valueboolean

IsSystemCharZeroResponse

PropType
valueboolean

IsSystemCharZeroOptions

PropTypeDescription
namestringBarcode symbology name

SetSystemCharZeroOptions

PropTypeDescription
namestringBarcode symbology name
valueboolean

GetMaxLenResponse

PropType
valuenumber

GetMaxLenOptions

PropTypeDescription
namestringBarcode symbology name

SetMaxLenOptions

PropTypeDescription
namestringBarcode symbology name
valuenumber

GetMinLenResponse

PropType
valuenumber

GetMinLenOptions

PropTypeDescription
namestringBarcode symbology name

SetMinLenOptions

PropTypeDescription
namestringBarcode symbology name
valuenumber

GetStartEndFormatResponse

PropType
valuenumber

GetStartEndFormatOptions

PropTypeDescription
namestringBarcode symbology name

SetStartEndFormatOptions

PropTypeDescription
namestringBarcode symbology name
valuenumber

PluginListenerHandle

PropType
remove() => Promise<void>

Type Aliases

ScannerModelName

ScannerModel | string

GetOutputTypeResponse

GetOutputTypeDisabledResponse | GetOutputTypeKeystrokeResponse | GetOutputTypeDirectFillResponse

SetOutputTypeOptions

SetOutputTypeDisabledOptions | SetOutputTypeKeystrokeOptions | SetOutputTypeDirectFillOptions

GetTriggerMethodResponse

GetTriggerMethodTriggerPulseResponse | GetTriggerMethodContinuousLongPressResponse

SetTriggerMethodOptions

SetTriggerMethodTriggerPulseOptions | SetTriggerMethodContinuousLongPressOptions

OnScanResultListener

Callback to receive scan results broadcasted by the scanner

(scan: { data: string; source_bytes: string; }): void

OnScanStartListener

Callback to receive scan start event broadcasted by the scanner

(): void

OnScanStopListener

Callback to receive scan stop event broadcasted by the scanner

(): void

Enums

ScannerModel

MembersValue
NONE"NONE"
SUPER_N1365_Y1825"SUPER_N1365_Y1825"
NLS_2096"NLS_2096"
ZEBRA_4710"ZEBRA_4710"
HONEYWELL_3601"HONEYWELL_3601"
HONEYWELL_6603"HONEYWELL_6603"
ZEBRA_4750"ZEBRA_4750"
ZEBRA_1350"ZEBRA_1350"
HONEYWELL_6703"HONEYWELL_6703"
HONEYWELL_3603"HONEYWELL_3603"
NLS_CM47"NLS_CM47"
NLS_3108"NLS_3108"
ZEBRA_965"ZEBRA_965"
SM_SS_1100"SM_SS_1100"
NLS_CM30"NLS_CM30"
HONEYWELL_4603"HONEYWELL_4603"
ZEBRA_4770"ZEBRA_4770"
NLS_2596"NLS_2596"
SM_SS_1103"SM_SS_1103"
SM_SS_1101"SM_SS_1101"
HONEYWELL_5703"HONEYWELL_5703"
UNKNOWN"UNKNOWN"

WriteContextType

MembersValueDescription
Service"service"Service write context type, permits reading and writing of scanner related settings
Decoders"decoders"Decoder write context type, permits enabling or disabling of barcode symbologies, and changing its settings

OutputMode

MembersValueDescription
DirectFill"direct-fill"Fill in EditText directly
DirectFillWithReplace"direct-fill-with-replace"Fill and overwrite in EditText directly
Keystroke"keystroke"Virtual Keyboard output
Disabled"disabled"No direct output

ScanMode

MembersValueDescription
Trigger"trigger"Trigger Mode: Short press to scan, and release to stop scanning
Continuous"continuous"Continuous Mode: Short press to start scanning, and short press to stop scanning
Pulse"pulse"Pulse Mode: Short press to start scanning until timeout
LongPress"long-press"Long Press Mode: Long press to scan continuously, release to stop Hardware support limited

ScanResultCodeIDEnum

MembersValueDescription
None"none"
SunmiId"sunmi-id"
AimId"aim-id"Hardware support limited
SymbolId"symbol-id"Hardware support limited

OutputEncodingCodeEnum

MembersValueDescription
UTF8"UTF8"
GBK"GBK"
ISO88591"ISO88591"
SHIFTJIS"SHIFTJIS"
Auto"Auto"Auto detect encoding/compatibility mode
WINDOWS1256"WINDOWS1256"
WINDOWS874"WINDOWS874"Hardware support limited
Unicode"Unicode"Hardware support limited
Big5"Big5"Hardware support limited
ASCII"ASCII"Hardware support limited
GB2312"GB2312"Hardware support limited
GB18030"GB18030"Hardware support limited

CenterDecodingSettingEnum

MembersValueDescription
Disabled"disabled"
CenterOnly"center-only"
CenterFirst"center-first"Hardware support limited

SpecificSceneEnum

MembersValue
Default"default"
ReflectiveDMBarcode"reflective-dm-barcode"
ReflectiveQRDMBarcode"reflective-qr-dm-barcode"
SpecialColourBarcode"special-colour-barcode"
DpmBarcode"dpm-barcode"
MobileScreenScene"mobile-screen-scene"