Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
en:sdk_api [2018/09/17 09:51]
michael [BS2EncryptKey]
en:sdk_api [2019/01/02 10:46]
simba
Line 1: Line 1:
 +======SDK API======
 +=====initialize=====
 +Initialize the SDK. 
 +<code java>
 +void initialize(Context context, DeviceListener listener) ​
 +</​code>​
 +=== Parameters === 
 +  * ''​context''​ : application context.
 +  * ''​listener''​ : A callback listener that receives callback data from the device.
 +<callout type="​info">​
 +[[references#​DeviceListener|Refer to DeviceListener Class]]
 +</​callout>​
 +<callout type="​info"​ icon="​true">​
 + If this function is not called, the SDK will not work properly.\\ It should be called as soon as possible after running the application.
 +</​callout>​
 +\\
  
 +=====run=====
 +Run the SDK service. ​
 +<code java>
 +int run()
 +</​code>​
 +=== Return Code ===
 +Returns "​SUCCESS"​ if successfully launched; returns the corresponding error code if an error occurs. ​
 +<callout type="​info"​ icon="​true">​
 +The SDK was developed for use with a single application.\\ It requires caution because it is not used concurrently in other applications. ​
 +</​callout>​
 +\\
 +
 +=====getVersions=====
 +Get the SDK/​Firmware versions. ​
 +<code java>
 +int getVersions(Versions versions)
 +</​code>​
 +===Parameters===
 +  * ''​versions''​ : version information(SDK / Firmware / Fingerprint library / Card library)
 +<callout type="​info">​
 +[[references#​Version|Refer to Version Class]]
 +</​callout>​
 +===Return Code===
 +Returns "​SUCCESS"​ if successfully launched; returns the corresponding error code if an error occurs.
 +
 +\\
 +=====getDeviceInfo=====
 +Get the device information.
 +<code java>
 +int getDeviceInfo(Device device)
 +</​code>​
 +===Parameters===
 +  * ''​device''​ : device information
 +<callout type="​info">​
 +[[references#​Device |Refer to Device Class]]
 +</​callout>​
 +===Return Code===
 +Returns "​SUCCESS"​ if successfully launched; returns the corresponding error code if an error occurs.
 +
 +\\
 +=====setAutoStartApplication=====
 +Automatically launch the application when Android starts.
 +<code java>
 +int setAutoStartApplication(boolean enable)
 +</​code>​
 +===Return Code ===
 +Returns "​SUCCESS"​ if successfully launched; returns the corresponding error code if an error occurs. ​
 +
 +\\
 +=====setCardType=====
 +Set the RF card type.
 +<code java>
 +int setCardType(int cardType)
 +</​code>​
 +===Parameters===
 +  * ''​cardType''​ : RF Card type
 +<WRAP group 50%>
 +^  No.  ^ Description ​ ^
 +|  1  |HIGH_FREQUENCY ​ |
 +|  2  |HIGH_FREQUENCY_ICLASS ​ |
 +|  3  |LOW_FREQUENCY ​ |
 +|  4  |LOW_FREQUENCY_PROX ​ |
 +</​WRAP>​
 +===Return Code===
 +Returns "​SUCCESS"​ if successfully launched; returns the corresponding error code if an error occurs.
 +<callout type="​info"​ icon="​true">​
 +It is set up automatically on the device. Used only when card type change is required.
 +</​callout>​
 +
 +\\
 +=====connectFtpServer=====
 +connect to the FTP server.
 +<code java>
 +int connectFtpServer(FirmwareOption option)
 +</​code>​
 +===Parameters===
 +  * ''​option'':​ Firmware file option.
 +<callout type="​info">​
 +[[references#​FirmwareOption|Refer to FirmwareOption Class]]
 +</​callout>​
 +===Return Code===
 +Returns "​SUCCESS"​ if successfully launched; returns the corresponding error code if an error occurs.
 +<callout type="​info"​ icon="​true">​
 +To use the firmware upgrade function, you need to build an FTP server.\\ The API acts as an FTP client.\\ \\
 +To use the API, Android applications require the following permissions:​
 +<code xml>
 +<​uses-permission android:​name="​android.permission.INTERNET"/>​
 +<​uses-permission android:​name="​android.permission.WRITE_EXTERNAL_STORAGE"​ />
 +</​code>​
 +</​callout>​
 +
 +\\
 +=====disconnectFtpServer=====
 +Disconnects to the FTP server.
 +<code java>
 +int disconnectFtpServer()
 +</​code>​
 +===Return Code===
 +Returns "​SUCCESS"​ if successfully launched; returns the corresponding error code if an error occurs.
 +<callout type="​info"​ icon="​true">​
 +To use the firmware upgrade function, you need to build an FTP server.\\ The API acts as an FTP client.\\ \\
 +To use the API, Android applications require the following permissions: ​
 +<code xml>
 +<​uses-permission android:​name="​android.permission.INTERNET"/>​
 +<​uses-permission android:​name="​android.permission.WRITE_EXTERNAL_STORAGE"​ />
 +</​code>​
 +</​callout>​
 +
 +\\
 +=====getFtpFileList=====
 +Get a list of file names for the FTP server.
 +<code java>
 +int getFtpFileList(ArrayList<​String>​ fileList)
 +</​code>​
 +===Parameters===
 +  * ''​fileList'':​ List of file names
 +===Return Code===
 +Returns "​SUCCESS"​ if successfully launched; returns the corresponding error code if an error occurs.
 +<callout type="​info"​ icon="​true">​
 +To use the firmware upgrade function, you need to build an FTP server.\\ The API acts as an FTP client.\\ \\
 +To use the API, Android applications require the following permissions: ​
 +<code xml>
 +<​uses-permission android:​name="​android.permission.INTERNET"/>​
 +</​code>​
 +</​callout>​
 +
 +\\
 +=====getUsbFileList=====
 +Get a list of firmware file names for USB.
 +<code java>
 +int getUsbFileList(ArrayList<​String>​ fileList)
 +</​code>​
 +===Parameters===
 +  * ''​fileList'':​ file name list
 +===Return Code===
 +Returns "​SUCCESS"​ if successfully launched; returns the corresponding error code if an error occurs.
 +
 +\\
 +=====upgradeFirmware=====
 +Copy the upgrade file to the specified firmware file.
 +<code java>
 +int upgradeFirmware(FirmwareOption option)
 +</​code>​
 +===Parameters===
 +  * ''​option'':​ Firmware File Option
 +<callout type="​info">​
 +[[references#​FirmwareOption|Refer to FirmwareOption Class]]
 +</​callout>​
 +===Return Code===
 +Returns "​SUCCESS"​ if successfully launched; returns the corresponding error code if an error occurs.
 +<callout type="​info"​ icon="​true">​
 +To use the firmware upgrade function, you need to build an FTP server.\\ The API acts as an FTP client.\\ \\
 +To use the API, Android applications require the following permissions: ​
 +<code xml>
 +<​uses-permission android:​name="​android.permission.INTERNET"/>​
 +<​uses-permission android:​name="​android.permission.WRITE_EXTERNAL_STORAGE"​ />
 +</​code>​
 +</​callout>​
 +
 +\\
 +=====rebootDevice=====
 +Reboot the device.
 +<code java>
 +int rebootDevice()
 +</​code>​
 +===Return Code===
 +Returns "​SUCCESS"​ if successfully launched; returns the corresponding error code if an error occurs.
 +<callout type="​info"​ icon="​true">​
 +The firmware will be upgraded at device reboot.
 +</​callout>​