How to develop the underlying hardware how to write an interface document
These days in the supermarket RFID clearing system of the upper computer program to write, with the vb.net. The bottom is used by others to develop a good SDK, why write this article? Recently, because of the functional limitations of the device at hand, I looked for other companies on the Internet RFID card reader, because I was to do the upper development, so I need equipment vendors to provide the underlying SDK two development package, find a lot of equipment providers, but also with them to obtain their own SDK, but overall, I still think the first use of this device manufacturers provide the most detailed SDK, now briefly explain the following:
First, function Description:
1, the directory structure is clear:
2, the function return value, the parameter uses the table explanation, clear concise:
3, Parameter type description detailed:
4, variable in each host computer programming environment corresponding variable type (take vb.net as an example):
5, error code details:
Appendix 3. Rfidlib API error Code table
Error code |
Description |
0 |
No error indicates that the API call was successful. |
-1 |
Unknown error |
-2 |
Communication with the reader hardware failed |
-3 |
API the incoming parameter is wrong |
-4 |
API the value of the passed-in parameter is not supported, such as the parameter value can only be 0-5, if passed in 6 will return the error. |
-5 |
Timeout, the command sent to the reader, the data is not returned within the set time. |
-6 |
API failed to request memory |
-7 |
Function not turned on |
-8 |
Keep |
-9 |
Keep |
-10 |
Keep |
-11 |
Keep |
-12 |
Incorrect packet length returned by the card reader |
-13 |
Keep |
-14 |
Keep |
-15 |
Keep |
-16 |
Keep |
-17 |
Card reader return operation failed identity packet, available API Rdr_getreaderlastreturnerror Gets the error code for the failure. |
-18 |
Keep |
-19 |
Keep |
-20 |
Keep |
-21 |
Inventory The Stop trigger occurs, for example: Suppose 1 seconds is set to inventory The maximum reading time, if the reader is not finished reading all the tags in 1 seconds, the card readers will terminate the inventory, then the API will return the error to tell the application, there may be a label is not finished reading. |
-22 |
The label Operations Command does not support |
-23 |
Configuration entries for incoming rdr_setconfig or rdr_getconfig are not supported. |
-24 |
Keep |
-25 |
TCP socket error, the API returned this error indicates that the TCP connection is disconnected. |
-26 |
The buffer passed in by the application layer is too small. |
-27 |
The data returned from the card reader is incorrect. |
6, General function Introduction:
6.1. General function Introduction
Serial number |
Function description |
Introduced |
1 |
Comport_enum |
Enumerate the serial ports that the Windows operating system has loaded |
2 |
Comport_getenumitem |
Gets the name of the serial port enumerated to |
3 |
Rdr_loadreaderdrivers |
Load all device driver libraries |
4 |
Rdr_getloadedreaderdrivercount |
Gets the number of device drivers that have been loaded |
5 |
Rdr_getloadedreaderdriveropt |
Gets the loaded device-driven parameter values that contain the parameters of the driver category, name, ID, and supported interface types. Drive category is divided into reader (reader Class), Mtgate (Conference Registration category), Lsgate (library security category). |
6 |
Hid_enum |
Enumerates the USB devices that are connected to the computer and requires an incoming device-driven name. |
7 |
Hid_getenumitem |
Gets the information that has been enumerated to the USB device, such as serial number, drive path, and so on. |
8 |
Rdr_open |
Open the communication interface and create the device driver instance. All of the following APIs require an incoming driver instance handle |
9 |
Rdr_close |
Close the communication interface and destroy the device driver instance. |
10 |
Rdr_createinvenparamspeclist |
Create a data node for the rdr_taginventory inventory parameter list |
11 |
Rdr_taginventory |
Inventory all tags in RF sensing |
12 |
Rdr_gettagdatareportcount |
Get the number of label data reports counted to |
13 |
Rdr_gettagdatareport |
Get the Tagged data report for inventory |
14 |
Rdr_tagdisconnect |
Disconnecting from a label |
15 |
Rdr_disconnectalltags |
To disconnect all the label connections |
16 |
Rdr_getreaderlastreturnerror |
Gets the last error code returned by the device |
17 |
Rdr_setacessantenna |
Sets the read-write antenna number. For a multi-antenna reader, you must first call the function to open the antenna where you want to read and write the label. |
18 |
Rdr_getreaderinfor |
Get the device information, the string output, the meaning of the information parameters, please see the relevant device-driven "user manual". |
19 |
Rdr_systemreset |
To control the device restart, which is not supported by all devices, see the user manual for the relevant device driver. |
20 |
Rdr_loadfactorydefault |
Control device restore factory settings, this feature is not supported by all devices, please see the relevant device-driven "user manual" |
21st |
Rdr_openrftransmitter |
Turn on the RF output, which is not supported by all devices, see the user manual for the relevant device driver |
22 |
Rdr_closerftransmitter |
Turn off the RF output, which is not supported by all devices, see the user manual for the relevant device driver |
23 |
Rdr_setcommuimmetimeout |
Causes the API to time out immediately, and the function can be used to quickly exit the thread. After the function is called, the rdr_resetcommuimmetimeout recovery time-out flag needs to be called before the thread exits. |
24 |
Rdr_resetcommuimmetimeout |
Recovery Timeout Flag |
25 |
Rdr_getantennainterfacecount |
Get the number of antenna interfaces |
26 |
Rdr_getoutputcount |
Get the number of output ports |
27 |
Rdr_getoutputname |
Get the output port name |
28 |
Rdr_createsetoutputoperations |
Create an operation set data node for the output port, and call Rdr_addoneoutputoperation to add the operation of the output port to the operation set. |
29 |
Rdr_addoneoutputoperation |
Join the output port operation |
30 |
Rdr_setoutput |
The output port output high and low level is controlled according to the operation of the output port. |
31 |
Rdr_configblockwrite |
Configure information Write operations function |
32 |
Rdr_configblockread |
Configuration information read Operation function |
33 |
Rdr_configblocksave |
Configuration information save Operation function |
34 |
Rdr_creaters485node |
Creates a RS485 node instance handle on the basis of an open serial communication interface layer. |
35 |
Rdr_detectnoise |
RF Noise Detection |
36 |
Rdr_getgpicount |
Get the number of universal input ports |
37 |
Rdr_getgpisstatus |
Get the status of the universal input port |
38 |
Rdr_exespecialcontrolcmd |
Perform special instructions for the device, which special instructions the device supports, refer to the driver's "User manual" of the device. |
39 |
Rdr_seteventhandler |
Setting up event handlers |
40 |
Dnode_destroy |
Frees the memory created by the dynamic library, such as: rdr_createinvenparamspeclist |
7. Operation Flowchart
8, the serial port parameters for example understand:
How to develop the underlying hardware how to write an interface document