Global

Members

# BATTERY_CHIPS :int

Battery chip types
Type:
  • int
Properties
Name Type Description
BATTERY_CHIP_NONE int No info available
BATTERY_CHIP_BQ27421 int Chip BQ27421

# CONN_STATES :int

The connection states
Type:
  • int
Properties
Name Type Description
CONN_DISCONNECTED int Device is disconnected, no automatic connection attempts will be made
CONN_CONNECTING int The SDK is trying to connect to the device
CONN_CONNECTED int Device is connected

# ENCRYPTION_TYPE :int

Encryption type
Type:
  • int
Properties
Name Type Description
ALG_EH_AES256 int
ALG_EH_VOLTAGE int
ALG_EH_IDTECH int
ALG_EH_MAGTEK int
ALG_EH_AES128 int
ALG_PPAD_DUKPT int
ALG_PPAD_3DES_CBC int
ALG_EH_IDTECH_AES128 int
ALG_EH_MAGTEK_AES128 int
ALG_PPAD_DUKPT_SEPARATE_TRACKS int
ALG_PPAD_AES256_CBC int

# KEY_ENCRYPTION :int

The key encryption ID to be used when changing EMSR encryption type
Type:
  • int
Properties
Name Type Description
KEY_AUTHENTICATION int Authentication key
KEY_EH_AES256_LOADING int Encrypted head key loading(encryption) key (KEK), used to load other keys with
KEY_EH_AES256_ENCRYPTION1 int Encrypted head AES256 Data encryption key 1
KEY_EH_AES256_ENCRYPTION2 int Encrypted head AES256 Data encryption key 2 (present on EMSR firmware version 2.30 and above)
KEY_EH_AES256_ENCRYPTION3 int Encrypted head AES256 Data encryption key 3 (present on EMSR firmware version 2.30 and above)
KEY_EH_AES128_ENCRYPTION1 int Encrypted head AES128 Data encryption key 1 (present on EMSR firmware version 2.30 and above)
KEY_EH_AES128_ENCRYPTION2 int Encrypted head AES128 Data encryption key 2 (present on EMSR firmware version 2.30 and above)
KEY_EH_AES128_ENCRYPTION3 int Encrypted head AES128 Data encryption key 3 (present on EMSR firmware version 2.30 and above)
KEY_EH_TMK_AES int Encrypted head TMK key
KEY_EH_DUKPT_MASTER1 int Encrypted head 3DES DUKPT data encryption key 1
KEY_EH_DUKPT_MASTER2 int Encrypted head 3DES DUKPT data encryption key 2 (present on EMSR firmware version 2.30 and above)
KEY_EH_DUKPT_MASTER3 int Encrypted head 3DES DUKPT data encryption key 3 (present on EMSR firmware version 2.30 and above)
KEY_AUTH_FLAG_LOCK int This flag locks barcode, magnetic card and bluetooth usage, so it will be possible to use them only after authenticating

# SCAN_MODES :int

Available scan mode settings
Type:
  • int
Properties
Name Type Description
MODE_SINGLE_SCAN int The scan will be terminated after successful barcode recognition (default)
MODE_MULTI_SCAN int Scanning will continue unless either scan button is releasd, or stop scan function is called
MODE_MOTION_DETECT int For as long as scan button is pressed or stop scan is not called the engine will operate in low power scan mode trying to detect objects entering the area, then will turn on the lights and try to read the barcode. Supported only on Code engine.
MODE_SINGLE_SCAN_RELEASE int Pressing the button/start scan will enter aim mode, while a barcode scan will actually be performed upon button release/stop scan.
MODE_MULTI_SCAN_NO_DUPLICATES int Same as multi scan mode, but allowing no duplicate barcodes to be scanned

# SUPPORTED_DEVICE_TYPES :int

Supported device types
Type:
  • int
Properties
Name Type Description
DEVICE_TYPE_ALL int All device types, used when setting active device
DEVICE_TYPE_LINEA int Linea Pro 1,2,3,4,4s, LineaTab
DEVICE_TYPE_PRINTER int Any of the supported printers - PP-60, DPP-250, DPP-350, DPP-450
DEVICE_TYPE_PINPAD int Any of the supported pinpads - MPED-400, PPAD1, BP50, BP500
DEVICE_TYPE_ISERIAL int Transport device for connecting to other devices via bluetooth
DEVICE_TYPE_PRINTER_ZPL int Any of the supported zebra printers - DPP-450
DEVICE_TYPE_IHUB int Any of the supported iHUB devices
DEVICE_TYPE_HID_BARCODE int Any of the supported HID barcode devices
DEVICE_TYPE_USB_MSR int Any of the supported USB magnetic stripe reader devices
DEVICE_TYPE_HID_KEYBOARD int HID keyboard devices

# UPDATE_PHASE :int

The available update progress phases.
Type:
  • int
Properties
Name Type Description
UPDATE_INIT int Initializing update
UPDATE_ERASE int Erasing old firmware/preparing memory
UPDATE_WRITE int Writing data
UPDATE_FINISH int Update complete, this is the final phase
UPDATE_COMPLETING int Post-update operations

Methods

# barcodeData(barcode, type)

Callback from SDK when a barcode is scanned
Parameters:
Name Type Description
barcode string The scanned barcode
type int The barcode type

# barcodeDecimals(barcodes, type)

Callback from SDK when a barcode is scanned
Parameters:
Name Type Description
barcodes array The scanned barcode in decimal array. Need to combine them back into a string
type int The barcode type

# barcodeGetScanButtonMode(success, error)

Get the scan button mode
Parameters:
Name Type Description
success function The scan button mode will be passed in as boolean
error function The error reason will be passed in if available

# barcodeGetScanMode(success, error)

Get the current barcode scan mode, one of SCAN_MODES
Parameters:
Name Type Description
success function The scan mode will be passed in here, one of SCAN_MODES as Int
error function The error reason will be passed in if available

# barcodeNSData(barcode, type)

Callback from SDK when a barcode is scanned
Parameters:
Name Type Description
barcode string The scanned barcode in hex
type int The barcode type

# barcodeSetScanBeep(success, error, enabled, data)

Sets the sound, which is used upon successful barcode scan. This setting is not persistent and is best to configure it upon connect. A sample beep containing of 2 tones, each with 400ms duration, first one 2000Hz and second - 5000Hz will look int beepData[]=[2000,400,5000,400]
Parameters:
Name Type Description
success function beep successfully enabled/disabled and/or tone changed
error function pointer to NSError object, where error information is stored in case function fails. You can pass nil if you don't want that information
enabled bool turns on or off beeping
data array.<int> an array of integer values specifying pairs of tone(Hz) and duration(ms).

# barcodeSetScanButtonMode(scanButtonMode, success, error)

Enable or Disable scan button.
Parameters:
Name Type Description
scanButtonMode bool true or false
success function The success function to call when this function is successfully executed
error function The error reason will be passed in if available

# barcodeSetScanMode(scanMode, success, error)

Set a specific scan mode, one of SCAN_MODES
Parameters:
Name Type Description
scanMode int One of SCAN_MODES
success function The success function to call when this function is successfully executed
error function The error reason will be passed in if available

# barcodeStartScan(success, error)

Start scan engine. Can be used for on screen scan button
Parameters:
Name Type Description
success function The success function to call when this function is successfully executed
error function The error reason will be passed in if available

# barcodeStopScan(success, error)

Stop scan engine. If using an on screen scan button, call this after a barcode is read.
Parameters:
Name Type Description
success function The success function to call when this function is successfully executed
error function The error reason will be passed in if available

# connect()

Connect the hardware to the application

# connectionState(state)

Called by SDK to notify the current connection state
Parameters:
Name Type Description
state int The connection state CONN_STATES

# deviceButtonPressed(which)

Called when a hardware button is pressed on the scanner device.
Parameters:
Name Type Description
which int Button index

# deviceButtonReleased(which)

Called when a hardware button released on the scanner device.
Parameters:
Name Type Description
which int Button index

# disconnect()

Disconnect all hardware from application

# emsrConfigMaskedDataShowExpiration(success, error, showExpiration, showServiceCode, unmaskedDigitsAtStart, unmaskedDigitsAtEnd, unmaskedDigitsAfter)

Fine-tunes which part of the card data will be masked, and which will be sent in clear text for display/print purposes
Parameters:
Name Type Description
success function The success function to call when this function is successfully executed
error function The error reason will be passed in if available
showExpiration bool If set to TRUE, expiration date will be shown in clear text, otherwise will be masked
showServiceCode bool if set to TRUE, service code will be shown in clear text, otherwise will be masked
unmaskedDigitsAtStart int the number of digits to show in clear text at the start of the PAN, range from 0 to 6 (default is 4)
unmaskedDigitsAtEnd int the number of digits to show in clear text at the end of the PAN, range from 0, to 4 (default is 4)
unmaskedDigitsAfter int the number of digits to unmask after the PAN, i.e. 4 will give you the expiration, 7 will give expiration and service code (default is 0)

# emsrGetDeviceInfo(success, error)

Returns general information about the encrypted head - firmware version, ident, serial number
Parameters:
Name Type Description
success function The success function to call when this function is successfully executed
error function The error reason will be passed in if available

# emsrGetKeysInfo(success, error)

Returns information about the loaded keys in the encrypted head and tampered status. The returned object will have schema as below
Parameters:
Name Type Description
success function The success function to call when this function is successfully executed
error function The error reason will be passed in if available
Example
{
        "keys" : [
            {
                "keyID" : Int,
                "keyVersion" : Int,
                "dukptKSN" : String,
                "keyName" : String
            }
        ],
        "tampered" : Boolean
    }

# emsrGetKeyVersion(success, error, keyID)

Gets the key version from the keyID that is provided
Parameters:
Name Type Description
success function get key version as the parameter
error function the Error reason will be passed in if available
keyID int the ID of the key to get the version

# emsrIsTampered(success, error)

Check if encrypted head is tampered
Parameters:
Name Type Description
success function Called if execution success, with result of tampered state as Boolean
error function The error reason will be passed in if available

# emsrSetActiveHead(success, error, activeHead)

Set encryption active head. This should be called prior to set encryption type.
Parameters:
Name Type Description
success function The success function to call when this function is successfully executed
error function The error reason will be passed in if available
activeHead int The encrypted head to use. Usually 0 = Real, 1 = Emulated

# emsrSetEncryption(success, error, encryption, keyID, params)

Set encryption type
Parameters:
Name Type Description
success function The success function to call when this function is successfully executed
error function The error reason will be passed in if available
encryption int algorithm used
keyID int the ID of the key to use. The key needs to be suitable for the provided algorithm.
params dictionary optional algorithm parameters.

# firmwareUpdateProgress(phase, percent)

Called continuously while updating the device firmware to report the progress.
Parameters:
Name Type Description
phase int Update phase. One of UPDATE_PHASE
percent int The percent complete

# getBatteryInfo(success, error)

Get battery info
Parameters:
Name Type Description
success function The battery info will be passed in as key-value dictionary
error function The error reason will be passed in if available

# getConnectedDeviceInfo(deviceType, success, error)

Get the connected device info. Info will be passed to success function
Parameters:
Name Type Description
deviceType SUPPORTED_DEVICE_TYPES
success function The connected device info will be passed in as dictionary parameter
error function The error reason will be passed in if available

# getConnectedDevicesInfo(success, error)

Get the all connected devices info. Info will be passed to success function
Parameters:
Name Type Description
success function The connected device infos will be passed in as array parameter contains multiple device infos
error function The error reason will be passed in if available

# getFirmwareFileInformation(resourcePath, success, error)

Get information of a specific firmware file. Info will be passed to success function
Parameters:
Name Type Description
resourcePath string The path to resource file with "platforms/ios/www/resources" as the root folder, your files must be copied to here. If you have "platforms/ios/www/resources/test.txt", only pass "test.txt" as resourcePath parameter.
success function The success function to call when this function is successfully executed
error function The error reason will be passed in if available

# getPassThroughSync(success, error)

Get pass-thru sync enabled or disabled
Parameters:
Name Type Description
success function The result will be passed in as Boolean
error function The error reason will be passed in if available

# getUSBChargeCurrent(success, error)

Get current USB charge current
Parameters:
Name Type Description
success function The usb current will be passed in as Int
error function The error reason will be passed in if available

# magneticCardData(track1, track2, track3)

Callback from SDK when card is swiped, and the encryption is set to plain text.
Parameters:
Name Type Description
track1 string
track2 string
track3 string

# magneticCardEncryptedData(encryption, tracks, data, track1masked, track2masked, track3, source)

Called when a card is read and the head is encrypted.
Parameters:
Name Type Description
encryption int encryption algorithm used
tracks int contain information which tracks are successfully read and inside the encrypted data as bit fields, bit 1 corresponds to track 1, etc, so value of 7 means all tracks are read
data data contains the encrypted card data
track1masked string Masked track 1 info
track2masked string Masked track 2 info
track3 string Track 3 info
source int Source

# magneticCardIDTECH(data, track1masked, track2masked, track3masked, encryptedData, encryption)

Called when a card is read and the head is encrypted with IDTech key
Parameters:
Name Type Description
data data contains the whole encrypted card data block
track1masked string unencrypted track1 masked
track2masked string unencrypted track2 masked
track3masked string unencrypted track3 masked
encryptedData string encrypted data extracted from data
encryption int the encryption type of the encrypted data

# magneticCardPPADDUKPTSeparate(data, track1, track2, track3, pan, trackJIS, source)

Called when a card is read and the head is encrypted with PPAD & DUKPT separated key
Parameters:
Name Type Description
data data contains the whole encrypted card data block
track1 string encrypted data extracted from data
track2 string encrypted data extracted from data
track3 string encrypted data extracted from data
pan string encrypted data extracted from data
trackJIS string encrypted data extracted from data
source int Source

# magneticCardReadFailed(source, reason)

Called when device fails to read a card. Could be due to a bad swipe or the magnetic strip is corrupted.
Parameters:
Name Type Description
source int the track data source, one of the CARD_* constants
reason int card failed reason, one of the REASON_* constants

# playSound(beepData, success, error)

Plays a sound using the built-in speaker on the active device. A sample beep containing of 2 tones, each with 400ms duration, first one 2000Hz and second - 5000Hz will look int beepData[]={2000,400,5000,400}
Parameters:
Name Type Description
beepData array.<int> an array of integer values specifying pairs of tone(Hz) and duration(ms).
success function The success function to call when this function is successfully executed
error function The error reason will be passed in if available

# rfCardDetected(cardIndex, cardInfo)

Called when an wireless card is in the field. Should power off after successful read.
Parameters:
Name Type Description
cardIndex int
cardInfo key-value

# rfClose(success, error)

Power down the RF module, when not in use.
Parameters:
Name Type Description
success function The success function to call when this function is successfully executed
error function The error reason will be passed in if available

# rfInit(success, error)

Power on the RF module. Continuously leaving the RF module powered on will drain battery.
Parameters:
Name Type Description
success function The success function to call when this function is successfully executed
error function The error reason will be passed in if available

# sdkVersion(success, error)

SDK version
Parameters:
Name Type Description
success function The success function to call when this function is successfully executed and pass in the version number.
error function The error reason will be passed in if available

# setAutoOffWhenIdle(timeIdle, timeDisconnected, success, error)

Set IPC device sleep timer
Parameters:
Name Type Description
timeIdle int this is the idle time, connected or not, after which Linea will turn off. The default value is 5400 seconds (90 minutes)
timeDisconnected int this is the time with no active program connection, after which Linea will turn off. The default value is 30 seconds
success function The success function to call when this function is successfully executed
error function The error reason will be passed in if available

# setCharging(value, success, error)

Set sled's battery to charge iOS device.
Parameters:
Name Type Description
value bool true or false
success function The success function to call when this function is successfully executed
error function The error reason will be passed in if available

# setDeveloperKey(key, success, error)

This must be the first function that gets called, and a valid develop key must be passed in, and validated, BEFORE any other functions get executed.
Parameters:
Name Type Description
key string The developer key given by IPC
success function The success function which will receive the information dictionary.
error function The error reason will be passed in if available

# setPassThroughSync(value, success, error)

Set pass-thru sync
Parameters:
Name Type Description
value bool true or false
success function The success function to call when this function is successfully executed
error function The error reason will be passed in if available

# setUSBChargeCurrent(value, success, error)

Set the USB current
Parameters:
Name Type Description
value int Must be one of 500, 1000, 2100, 2400
success function The success function to call when this function is successfully executed
error function The error reason will be passed in if available

# updateFirmwareData(resourcePath, success, error)

Update firmware
Parameters:
Name Type Description
resourcePath string The path to resource file with "platforms/ios/www/resources" as the root folder, your files must be copied to here. If you have "platforms/ios/www/resources/test.txt", only pass "test.txt" as resourcePath parameter.
success function The success function to call when this function is successfully executed
error function The error reason will be passed in if available