IDTech Android SDK Guide  1.00.133
API reference for SecureMag
com.idtechproducts.device.IDT_SecureMag Class Reference

Public Member Functions

 IDT_SecureMag (OnReceiverListener callback, Context context)
 
boolean device_setDeviceType (ReaderInfo.DEVICE_TYPE deviceType)
 
void setIDT_Device (FirmwareUpdateTool fwTool)
 
DEVICE_TYPE device_getDeviceType ()
 
void registerListen ()
 
void unregisterListen ()
 
void release ()
 
String config_getSDKVersion ()
 
String config_getXMLVersionInfo ()
 
String phone_getInfoManufacture ()
 
String phone_getInfoModel ()
 
void log_setVerboseLoggingEnable (boolean enable)
 
void log_setSaveLogEnable (boolean enable)
 
int log_deleteLogs ()
 
boolean device_isConnected ()
 
int device_startRKI ()
 
int device_getFirmwareVersion (StringBuilder version)
 
int config_getSerialNumber (StringBuilder serialNumber)
 
String device_getResponseCodeString (int errorCode)
 
int device_sendDataCommand (String cmd, boolean calcLRC, String data, ResDataStruct respData, int timeout)
 
int device_sendDataCommand (String cmd, boolean calcLRC, String data, ResDataStruct respData)
 
int device_reviewAllSetting (ResDataStruct respData)
 
int device_enableTDES (ResDataStruct respData)
 
int device_enableAES (ResDataStruct respData)
 
int device_getKSN (ResDataStruct ksn)
 
int device_enableErrorNotification (ResDataStruct respData, boolean enable)
 
int device_enableExpDate (ResDataStruct respData, boolean enable)
 
int device_setEnhancedMode (ResDataStruct respData, boolean enable)
 
int device_switchToKeyboardMode (ResDataStruct respData)
 
int device_switchToHidMode (ResDataStruct respData)
 
int msr_defaultAllSetting ()
 
int msr_cancelMSRSwipe ()
 
int msr_startMSRSwipe ()
 

Static Public Member Functions

static IDT_Device getSDKInstance ()
 
static void useUSBIntentFilter ()
 
static IDT_Device getIDT_Device ()
 

Constructor & Destructor Documentation

◆ IDT_SecureMag()

com.idtechproducts.device.IDT_SecureMag.IDT_SecureMag ( OnReceiverListener  callback,
Context  context 
)

It is the constructor of the main class IDT_BTMag. When it is called, the SDK will create the Instance for IDT_BTMag device. The interface OnReceiverListner needs to be implemented in the application.

Parameters
callbackOnReceiverListener callback
contextApplication context

Member Function Documentation

◆ config_getSDKVersion()

String com.idtechproducts.device.IDT_SecureMag.config_getSDKVersion ( )

READER CONFIG API LIST Get the version of SDK.

Parameters
sdkVersionfor version string.
Returns
success or error code.
See also
ErrorCode

◆ config_getSerialNumber()

int com.idtechproducts.device.IDT_SecureMag.config_getSerialNumber ( StringBuilder  serialNumber)

Get the serial number of device.

Parameters
serialNumberreturns Serial Number string.
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode

◆ config_getXMLVersionInfo()

String com.idtechproducts.device.IDT_SecureMag.config_getXMLVersionInfo ( )

Get XML configuration version.

Returns
the version info.

◆ device_enableAES()

int com.idtechproducts.device.IDT_SecureMag.device_enableAES ( ResDataStruct  respData)

enable AES encryption.

Parameters
respDataresponse data from reader
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode

◆ device_enableErrorNotification()

int com.idtechproducts.device.IDT_SecureMag.device_enableErrorNotification ( ResDataStruct  respData,
boolean  enable 
)

To enable or disable MSR error notification.

Parameters
respDataresponse data from reader
enableto enable or disable the notification
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode

◆ device_enableExpDate()

int com.idtechproducts.device.IDT_SecureMag.device_enableExpDate ( ResDataStruct  respData,
boolean  enable 
)

To enable or disable Expiration date in MSR data

Parameters
respDataresponse data from reader
enableto enable or disable expiration date
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode

◆ device_enableTDES()

int com.idtechproducts.device.IDT_SecureMag.device_enableTDES ( ResDataStruct  respData)

enable TDES encryption.

Parameters
respDataresponse data from reader
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode

◆ device_getDeviceType()

DEVICE_TYPE com.idtechproducts.device.IDT_SecureMag.device_getDeviceType ( )

Gets type of device

◆ device_getFirmwareVersion()

int com.idtechproducts.device.IDT_SecureMag.device_getFirmwareVersion ( StringBuilder  version)

start Auto Config to search the profile.

Parameters
strXMLFilenameInput the customized XML file as the templates to search the profile.
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode stop Auto Config.
Returns
null. DEVICE INFO API Get the firmware version of device.
Parameters
versionfor version string.
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode

◆ device_getKSN()

int com.idtechproducts.device.IDT_SecureMag.device_getKSN ( ResDataStruct  ksn)

Get the Account DUKPT Key KSN of device.

Parameters
10-byteKSN
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode

◆ device_getResponseCodeString()

String com.idtechproducts.device.IDT_SecureMag.device_getResponseCodeString ( int  errorCode)

Get Response Code String

Interpret a response code and return string description.

Parameters
errorCodeError code, range 0x0000 - 0xFFFF, example 0x0300
Returns
Verbose error description

◆ device_isConnected()

boolean com.idtechproducts.device.IDT_SecureMag.device_isConnected ( )

set XML Configuration File Name with the full path.

Parameters
xmlFilename,XMLConfiguration File Name.
Returns
none Load XML Configuration File.
Parameters
xmlFilename,XMLConfiguration File Name.
Returns
none connect the device with Profile.
Parameters
profile,theprofile is the one which is the result from Auto config.
Returns
true: success, false: fail. get the status if the device connected.
true: connected, false: disconnected

◆ device_reviewAllSetting()

int com.idtechproducts.device.IDT_SecureMag.device_reviewAllSetting ( ResDataStruct  respData)

/** Review All Configuration Settings

it returns the current values for all the parameters that can be set using the Set Configuration command. Each parameter is returned as a TLV data object.

Parameters
respDataReturns TLV in ResDataStruct.resData. Status Code in ResDataStruct.statusCode.
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode

◆ device_sendDataCommand() [1/2]

int com.idtechproducts.device.IDT_SecureMag.device_sendDataCommand ( String  cmd,
boolean  calcLRC,
String  data,
ResDataStruct  respData,
int  timeout 
)

Send a NSData object to device

Sends a command represented by the provide NSData object to the device through the accessory protocol.

Parameters
cmdNSData representation of command to execute
calcLRCIf TRUE, this will wrap command with start/length/lrc/sum/end: '{STX}{Len_Low}{Len_High} data {CheckLRC} {CheckSUM} {ETX}'
dataCommand data (if applicable) for IDG, not used for NGA
responseReturns response ResDataStruct.respData
timeoutCommand timeout in seconds
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode

◆ device_sendDataCommand() [2/2]

int com.idtechproducts.device.IDT_SecureMag.device_sendDataCommand ( String  cmd,
boolean  calcLRC,
String  data,
ResDataStruct  respData 
)

Send a NSData object to device

Sends a command represented by the provide NSData object to the device through the accessory protocol.

Parameters
cmdNSData representation of command to execute
calcLRCIf TRUE, this will wrap command with start/length/lrc/sum/end: '{STX}{Len_Low}{Len_High} data {CheckLRC} {CheckSUM} {ETX}'
dataCommand data (if applicable) for IDG, not used for NGA
responseReturns response ResDataStruct.respData
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode

◆ device_setDeviceType()

boolean com.idtechproducts.device.IDT_SecureMag.device_setDeviceType ( ReaderInfo.DEVICE_TYPE  deviceType)

Defines connection Bluetooth

Parameters
deviceTypeDEVICE_TYPE.DEVICE_BTMAG

◆ device_setEnhancedMode()

int com.idtechproducts.device.IDT_SecureMag.device_setEnhancedMode ( ResDataStruct  respData,
boolean  enable 
)

To enable or disable Enhanced Encryption mode

Parameters
respDataresponse data from reader
enableto enable or disable enhanced encryption mode
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode

◆ device_startRKI()

int com.idtechproducts.device.IDT_SecureMag.device_startRKI ( )

Start remote key injection.

Returns
success or error code.
See also
ErrorCode

◆ device_switchToHidMode()

int com.idtechproducts.device.IDT_SecureMag.device_switchToHidMode ( ResDataStruct  respData)

switch to HID-USB Mode.

Parameters
respDataresponse data from reader
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode

◆ device_switchToKeyboardMode()

int com.idtechproducts.device.IDT_SecureMag.device_switchToKeyboardMode ( ResDataStruct  respData)

switch to Keyboard Mode.

Parameters
respDataresponse data from reader
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode

◆ getSDKInstance()

static IDT_Device com.idtechproducts.device.IDT_SecureMag.getSDKInstance ( )
static

Returns an instance of the currently initialized IDT_Device class.

Returns
IDT_Device instance

◆ log_deleteLogs()

int com.idtechproducts.device.IDT_SecureMag.log_deleteLogs ( )

delete the log in the root path of SD card.

Returns
number of log files deleted
See also
log_setSaveLogEnable

◆ log_setSaveLogEnable()

void com.idtechproducts.device.IDT_SecureMag.log_setSaveLogEnable ( boolean  enable)

Enable/Disable save the log into the root path of SD card.

Parameters
enableShowLog,trueenable save the log, the log includes the .txt text log and .wav signals file. false: disable save the log.
Returns
none
See also
deleteLogs

◆ log_setVerboseLoggingEnable()

void com.idtechproducts.device.IDT_SecureMag.log_setVerboseLoggingEnable ( boolean  enable)

Enable/Disable Verbose Logging show in the logcat view window.

Parameters
enableShowLog,trueenable to show the log in the logcat view window. false: disable to show the log in the logcat view window.
Returns
none

◆ msr_cancelMSRSwipe()

int com.idtechproducts.device.IDT_SecureMag.msr_cancelMSRSwipe ( )

Get single setting of Mask and Encryption by Function ID.

Parameters
funcIDfunction ID.
0x49:Leading PAN digits to display(0x00~0x06).
0x4A:Last PAN digits to display(0x00~0x04).
0x4B:Mask ASCII code track data(0x20~0x7E).
0x4C:Encryption type ('1'-'2'). '1' 3DES, '2' AES.
0x50:Mask or display expiration date(0x30 or 0x31);0x31:don't mask expiration date.
0x7E:Security Level ID.
0x84:Encryption Option (Forced encryption or not)
Bit 0 : T1 force encrypt
Bit 1 : T2 force encrypt
Bit 2 : T3 force encrypt
Bit 3 : T3 force encrypt when card type is 0

0x86:Masked / clear data sending option Bit 0 : T1 mask allowed
Bit 1 : T2 mask allowed
Bit 2 : T3 mask allowed

NOTE:
UniPay support 0x49,0x50,0x4C,0x7E,0x84 and 0x86.
UniPay II support 0x49,0x50,0x4A, 0x4B, 0x4C,0x7E,0x84 and 0x86.

Parameters
responseresponse[0] for setting data.
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode Set single setting of Mask and Encryption by Function ID.
Parameters
funcIDfunction ID.
0x49:Leading PAN digits to display(0x00~0x06).
0x4A:Last PAN digits to display(0x00~0x04).
0x4B:Mask ASCII code track data(0x20~0x7E).
0x4C:Encryption type ('1'-'2'). '1' 3DES, '2' AES.
0x50:Mask or display expiration date(0x30 or 0x31);0x31:don't mask expiration date.
0x7E:Security Level ID.
0x84:Encryption Option (Forced encryption or not)
Bit 0 : T1 force encrypt
Bit 1 : T2 force encrypt
Bit 2 : T3 force encrypt
Bit 3 : T3 force encrypt when card type is 0

0x86:Masked / clear data sending option Bit 0 : T1 mask allowed
Bit 1 : T2 mask allowed
Bit 2 : T3 mask allowed

NOTE:
UniPay support 0x49,0x50,0x4C,0x7E,0x84 and 0x86.
UniPay II support 0x49,0x50,0x4A, 0x4B, 0x4C,0x7E,0x84 and 0x86.

Parameters
setDatafor setting data.
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode Disable MSR swipe card.

Cancels MSR swipe request.

Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode

◆ msr_defaultAllSetting()

int com.idtechproducts.device.IDT_SecureMag.msr_defaultAllSetting ( )

Default all setting of Mask and Encryption.

Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode

◆ msr_startMSRSwipe()

int com.idtechproducts.device.IDT_SecureMag.msr_startMSRSwipe ( )

Enable MSR swipe card. Returns encrypted MSR data or function key value by call back function. The function swipeMSRData in interface OnReceiverListener will be called if swiping card data received.

See also
OnReceiverListener
Returns
success or error code. Values can be parsed with device_getResponseCodeString
See also
ErrorCode

◆ phone_getInfoManufacture()

String com.idtechproducts.device.IDT_SecureMag.phone_getInfoManufacture ( )

Get manufacture version.

Returns
the manufacture info

◆ phone_getInfoModel()

String com.idtechproducts.device.IDT_SecureMag.phone_getInfoModel ( )

Get phones's model number information.

Returns
the model number information.

◆ registerListen()

void com.idtechproducts.device.IDT_SecureMag.registerListen ( )

General API:registerListen.

registerListen to enable SDK detect the phone jack plug in/off notification

◆ release()

void com.idtechproducts.device.IDT_SecureMag.release ( )

release, make the SDK in the idle status.

◆ setIDT_Device()

void com.idtechproducts.device.IDT_SecureMag.setIDT_Device ( FirmwareUpdateTool  fwTool)

For System Use Only

Parameters
fwToolParameter for firmware update

◆ unregisterListen()

void com.idtechproducts.device.IDT_SecureMag.unregisterListen ( )

unregisterListen to disable the detect

◆ useUSBIntentFilter()

static void com.idtechproducts.device.IDT_SecureMag.useUSBIntentFilter ( )
static

Use USB Intent Filter For USB Devices, you may opt to incorporate an Intent Filter that will automatically start your application when a specific USB device is attached. The SDK must be informed to bypass it's normal Enumeration of USB Devices when an Intent Filter is being use. This function MUST be called BEFORE device_setDeviceType() is executed if a USB Intent Filter is being utilized. https://developer.android.com/guide/topics/connectivity/usb/host.html


The documentation for this class was generated from the following file: