Differences

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

Link to this comparison view

Next revision
Previous revision
Next revision Both sides next revision
en:sdk_api [2016/02/04 17:23]
127.0.0.1 external edit
en:sdk_api [2018/12/14 15:30]
simba created
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|DeviceListener]]
 +</​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>​
 +\\
 +
 +=====getVersion=====
 +Get the SDK/​Firmware version. ​
 +<code java>
 +int getVersion(Version version)
 +</​code>​
 +===Parameters===
 +  * ''​version''​ : SDK/​Firmware version
 +<callout type="​info">​
 +[[references#​Version|Version]]
 +</​callout>​
 +===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''​ : Parameters
 +<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.
 +
 +\\
 +=====connectFtpServer=====
 +connect to the FTP server.
 +<code java>
 +int connectFtpServer(FirmwareOption option)
 +</​code>​
 +===Parameters===
 +  * ''​option'':​ Firmware file option.
 +<callout type="​info">​
 +[[references#​FirmwareOption|FirmwareOption]]
 +</​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>​
 +
 +\\
 +=====getFirmwareFileList=====
 +Get a list of file names for the FTP server.
 +<code java>
 +int getFirmwareFileList(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"/>​
 +<​uses-permission android:​name="​android.permission.WRITE_EXTERNAL_STORAGE"​ />
 +</​code>​
 +</​callout>​
 +
 +\\
 +=====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|FirmwareOption]]
 +</​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>​