版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、目录简介411.11.21.3本手册使用范围4术语表和缩略语4概述4概述422.1 设备接口52.2装箱 52.3 程序安装52.4 52.5 技术指标5API 函数指南6驱动程序主要目录和文件6函数使用说明6库函数简介734通用函数简介7设备操作函数8显示控制函数9复位 RF(射频)模块10卡片操作104.14.24.34.44.54.5.1 Mifare 标准非接触卡操作函数10通用函数1556设备操作函数16显示控制操作函数1878. MIFARE 标准非接触卡操作函数22MIFARE 标准非接触卡操作流程图22MIFARE STANDARD 1K 卡片228.18.2Mifare St
2、andard 1K 卡片状态图23调用Mifare Standard 1K 卡片 API 函数流程图24操作函数说明258.3MIFARE STANDARD 4K37状态图和指令流程37操作流程图38函数说明39非 Mifare 4K 卡片操作458.4MIFARE ULTRALIGHT46Page 2 of 698.4.1 操作流程图468.4.28.4.3Mifare UltraLight 状态图47函数说明488.5MIFAREPRO 卡528.5.1 状态图和指令流程528.5.28.5.3操作流程图53函数说明549CPU 卡和 SAM 卡操作函数569.19.2CPU 卡操作函数5
3、6SAM 卡操作函数56非接触卡片的特性58MIFARE STANDARD 1K58MIFARE ULTRALIGHT62MIFARE STANDARD 4K64MIFARE LIGHT 卡介绍67附录1234Page 3 of 691 简介1.1本手册使用范围本手册描述了非接触式的使用及应用程序接口函数(API),所有 API 函数均可工作于 Windows 98、 Windows 2000、 Windows NT、 Windows XP、 Unix 和 Linux 等操作系统上。1.2术语表和缩略语CRC: 循环码校验 PCD:近耦合设备 PICC:近耦合集成电路卡 RWD: 读/写设备A
4、FI:应用领域识别号 RFID:射频识别号 VICC: 近距离集成电路卡UID:唯一识别号DSFID: 数据保存格式识别号RFU:保留1.3概述手册简介概述 API 函数指南通用函数设备操作函数Mifare Standard 1K 卡片操作函数 Mifare UltraLight 卡片操作函数 附录(非接触卡特性)概述RF 非接触式2通过 RS232串行接口能实现同 PC 机的连接。随机提供的接口函数库可满足用户二次开发的需要;其完善、可靠的接口函数,支持设备已广泛地应用于门禁、考勤及高速公路、油站、停车场、射频卡的全部功能。目前该等系统中。Page 4 of 692.1 设备接口RS232
5、串口RF内置天线DC5V 电源RS232 串行接口用于与上位 PC 联机通讯;装箱2.2包装盒内配有:,通讯线,5V 电源,驱动软盘。2.3 程序安装安装步骤:a. 将通讯线一端接到上,另一端接至计算机串口上;b. 接通电源;c. 打开计算机,进入 WINDOWS 98 或WINDOWS2000/ME/XP;d. 将驱动软盘e. 执行安装程序;驱动器 A ;注:安装结束后,在 Program files 下创建一个 rfreader 的子目录,所有均在此目录下。2.4包括:演示程序、函数库和应用范例RFa. 演示程序提供 Windows 版演示程序: Demo RF.exe。b. 函数库C 语
6、言接口函数库WINDOWS32 位动态库c. 应用范例EXLES 目录下提供各种开发的应用范例,包括 VB、DELPHI、C 等。2.5 技术指标操作距离:35mm(Mifare 标准卡读写距离)支持卡型:支持 ISO1443-TypeA 标准, 支持 Mifare 标准卡(1K、4K、ML)、Mifare Utral Light卡(358bit/512bit)、复旦筹码卡 FM005 和华虹卡 SHC1102;数据在卡和之间传输时可进行数据加密和双向验证。(此项功能需要卡片的支持)多张射频卡(此项功能需要卡片的支持)防,可同时Page 5 of 69RF卡功能操作:读、写、初始化值、加值、减
7、值、读值和装载控制蜂鸣器鸣响功能数码管显示:有 8 位数码管显示通讯接口:RS232 和 RS485 接口波特率:9600115200bit/s ,自动侦测工作频率 13.56MHZ以 106kbit/s 速率高速射频卡工作电源:DC 5V5%最大功耗:200mW环境温度:0 50相对湿度:30%95%重量: 约 200 克等(此项功能需要卡片的支持)提供丰富的二次开发和应用范例API 函数指南33.1 驱动程序主要目录和文件驱动程序安装后 rfreader 下的目录和文件:Install.log Unwise.exe安装程序日志卸载程序DemoWINDOWS 下演示WINDOWS 32 位动
8、态库FOXPRO FOR DOS 驱动程序Linux 驱动程序 Unix 驱动程序 Windows 驱动程序VC,VB,DELPHI,Linux,Pb5,Unix,Vfp 等各种DemoRF.exemwrf32.dllDriverFoxpro.dos DriverLinux DriverUnix DriverWindows Exles的范例3.2函数使用说明函数调用应遵循如下规则:程序开始,首先要调用 rf_init( ) 函数初始化串口。(1)(2)(3)用 rf_load_key()将卡中某一扇区输入到中。调用 rf_card()函数(相当连续调用 rf_request()、oll()、s
9、elect()三个函数),成功可返回卡的序列号。(4)(5)用 rf_anthetication() 函数验证设备和卡中,一次只能验证一个扇区。对已验证过的扇区可进行读、写、初始化值、加值、减值等功能操作。对其它扇区的读、写操作必须重复上述(4)过程。(6)(7)(8)由于高级函数集成了若干低级函数,所以调用前可不必运行(3)、(4)过程。对某操作完成后,应用 rf_halt()函数中止对该卡的操作。程序正常退出或因错误退出之前,要用 rf_exit()函数关闭串口;否则,因为串口被占用,再次执行初始化串口时将出错。(9)ML 卡有的三个函数 rf_init_ml()、rf_decrement
10、_ml()和 rf_readval_ml;减值以后,再Page 6 of 69次对卡操作(包括读值)时须重新寻卡。(10) 有关调用各种函数库的具体方法,请参考:Exles目录下的使用范例。4库函数简介本手册主要描述了 RF 系列的 API 函数,包括通用函数、设备操作函数和卡片操作函数。对于不同的操作系统,函数的参数和返回值的数据类型是不同的,并且有些函数是没有的。Flow Diagram of the Operations on RF series4.1 通用函数简介通用函数用来实现打开/关闭串口、加密/换等。Windows 函数:usb_init();以及16进制字符串和 ASCII 字
11、符串间的相互转rf_init(rf_exit(port,long baud);icdev);rf_decrypt(char *key,unsigned char *ptrSource,unsigned rf_encrypt(char *key,unsigned char *ptrSource, unsigned*ptrDest);hex_a(unsigned char *hex,char *a,unsigned char length); a_hex(char *a,unsigned char *hex,unsigned char len);msglen, char *ptrDest);msg
12、Len,unsigned charUnix 函数:Page 7 of 69关闭通讯口rf_exit()操作卡片操作设备选择协议初始化通讯口rf_init()上电,复位rf_init(char *FileName,long baud);short rf_exit(icdev);short rf_encrypt( char *key,char *ptrSource, unsigned short msgLen, char *ptrDest);short rf_decrypt( char *key,char *ptrSource, unsigned short msgLen, char *ptrDe
13、st);Linux 函数:rf_init(char *filename,unsigned long baud);rf_exit(icdev);rf_encrypt( char *key,char *ptrSource, unsigned long msgLen, char *ptrDest);rf_decrypt( char *key,char *ptrSource, unsigned long msgLen, char *ptrDest);4.2 设备操作函数设备操作函数可以复位硬件版本号及产品系列号等。Windows 函数:控制蜂鸣器:、控制蜂鸣器、EEPROM器、获取版本号、获取rf_b
14、eep(HANDLE icdev,unsigned short _Msec);获取硬件版本号:rf_get_sus(HANDLE icdev,unsigned char *_Sus);获取产品系列号:rf_srd_snr(HANDLE icdev, 16 lent版本号:lib_ver(unsigned char *str_ver);signed char *rec_buffer);获取LED 显示:rf_setbrighNDLE icdev,unsigned char bright);rf_ctl_mode(HANDLE icdev,unsigned char mode); rf_disp_
15、mode(HANDLE icdev,unsigned char mode); rf_disp8(HANDLE icdev, 16 disp_len,unsigned char* disp_str); rf_disp(HANDLE icdev,unsigned char pt_mode,unsigned short digit); rf_gettime(HANDLE icdev,unsigned char *time); rf_settime(HANDLE icdev,unsigned char *time); rf_gettimehex(HANDLE icdev,char *time);rf_
16、settimehex(HANDLE icdev,char *time);向的 EEPROM器读/写数据:rf_srd_eeprom(HANDLE icdev, 16 offset, 16 lent*rec_buffer);rf_swr_eeprom(HANDLE icdev, 16 offset, 16 lent send_buffer);signed charsigned char*Unix 函数:short rf_reset( short rf_beicdev,unsigned short _Msec);nt icdev,unsigned short _Msec);short rf_get
17、_sus(short rf_srd_snr(icdev,unsigned char *_Sus);icdev,short lentsigned char *rec_buffer);Page 8 of 69short lib_ver(unsigned char *str_ver);short rf_setbright(icdev,unsigned char bright); short rf_ctl_mode(icdev,unsigned char mode);short rf_disp_mode(icdev,unsigned char mode);short rf_disp8(icdev,sh
18、ort disp_len,unsigned char* disp_str);short rf_disp(icdev,unsigned char pt_mode,unsigned short digit);short rf_gettime(icdev,unsigned char *time);short rf_gettimehex(icdev,char *time);short rf_settime(icdev,unsigned char *time);short rf_settimehex(short rf_srd_eeprom( short rf_swr_eeprom(icdev,char
19、*time);icdev,short offset,short lent icdev,short offset,short lentsigned char *rec_buffer);signed char* send_buffer);Linux 函数:rf_reset(icdev,unsigned_Msec);rf_bent icdev,unsigned short _Msec);rf_get_sus(rf_srd_snr(icdev,unsigned char *_Sus);icdev,lentsigned char *rec_buffer);lib_ver(unsigned char *s
20、tr_ver);rf_setbright(icdev,unsigned char bright); rf_ctl_mode(icdev,unsigned char mode);rf_disp_mode(icdev,unsigned char mode);rf_disp8(icdev,disp_len,unsigned char* disp_str);rf_disp(icdev,unsigned char pt_mode,unsigned short digit);rf_gettime(icdev,unsigned char *time);rf_gettimehex(icdev,char *ti
21、me);rf_settime(icdev,unsigned char *time);rf_settimehex( rf_srd_eeprom(rf_swr_eeprom(icdev,char *time);icdev,offset,lentsigned char *rec_buffer);signed char* send_buffer);icdev,offset,lent4.3 显示控制函数Windows 函数:LED 显示:rf_setbrighNDLE icdev,unsigned char bright);rf_ctl_mode(HANDLE icdev,unsigned char m
22、ode); rf_disp_mode(HANDLE icdev,unsigned char mode); rf_disp8(HANDLE icdev, 16 disp_len,unsigned char* disp_str); rf_disp(HANDLE icdev,unsigned char pt_mode,unsigned short digit); rf_gettime(HANDLE icdev,unsigned char *time); rf_settime(HANDLE icdev,unsigned char *time); rf_gettimehex(HANDLE icdev,c
23、har *time);rf_settimehex(HANDLE icdev,char *time);Page 9 of 69Unix 函数:short rf_setbright(icdev,unsigned char bright); short rf_ctl_mode(icdev,unsigned char mode);short rf_disp_mode(icdev,unsigned char mode);short rf_disp8(icdev,short disp_len,unsigned char* disp_str);short rf_disp(icdev,unsigned cha
24、r pt_mode,unsigned short digit);short rf_gettime(icdev,unsigned char *time);short rf_gettimehex(icdev,char *time);short rf_settime(icdev,unsigned char *time);short rf_settimehex(icdev,char *time);Linux 函数:rf_setbright(icdev,unsigned char bright); rf_ctl_mode(icdev,unsigned char mode);rf_disp_mode(ic
25、dev,unsigned char mode);rf_disp8(icdev,disp_len,unsigned char* disp_str);rf_disp(icdev,unsigned char pt_mode,unsigned short digit);rf_gettime(icdev,unsigned char *time);rf_gettimehex(icdev,char *time);rf_settime(icdev,unsigned char *time);rf_settimehex(icdev,char *time);4.4 复位 RF(射频)模块复位射频模块函数将给射频模块
26、断电几毫秒。射频模块复位后,所有在天线区域的卡片都回到上电复位状态。rf_reset (HANDLE icdev,unsigned 16 _Msec);功能:参数:将 RF(射频)模块的能量几毫秒icdev: rf_init()返回的设备描述符_Msec: 复位时间 ( 0 500ms)=0:成功0:出错返回:例:st=rf_reset (icdev,60);4.5 卡片操作卡片的应用程序接口(API)函数是根据卡片的标准来分类的:4.5.1 Mifare 标准非接触卡操作函数Windows 函数:装载:Page 10 of 69rf_load_key (icdev,unsigned char
27、 _Mode,unsigned charr,unsigned char *_NKey);r,char *_NKey);rf_load_key_hex (icdev,unsigned char _Mode,unsigned char低级和高级函数都可对 Mifare 卡进行同一操作。每一条高级函数都集成了一系列低级函数。这样用户使用起来会更方便。但是,如果对卡片进行多扇区或多块操作,速度将会变慢,因为在高级函数中许多低级函数的执行是重复的。在这种情况下,建议用户调用低级函数。低级函数:rf_requesNDLE icdev,unsigned char _Mode,unsigned 16 *Tag
28、Type);rf_oll(HANDLE icdev,unsigned chart,unsigned long *_Snr);rf_selecNDLE icdev,unsigned long _Snr,unsigned char *_Size);rf_authentication(HANDLE icdev,unsigned char _Mode,unsigned charr);rf_authentication_2(HANDLE icdev,unsigned char _Mode,unsigned char KeyNr,unsigned Adr);rf_read(HANDLE icdev,uns
29、igned char _Adr,unsigned char *_Data); rf_read_hex(HANDLE icdev,unsigned char _Adr, char *_Data); rf_write(HANDLE icdev,unsigned char _Adr,unsigned char *_Data);rf_write_hex(HANDLE icdev,unsigned char _Adr,char *_Data);charrf_incremenrf_decremenNDLE icdev,unsigned char _Adr,unsigned long _Value);NDL
30、E icdev,unsigned char _Adr,unsigned long _Value);rf_restore(HANDLE icdev,unsigned char _Adr); rf_transfer(HANDLE icdev,unsigned char _Adr); rf_initval(HANDLE icdev,unsigned char _Adr,unsigned long _Value);rf_readval(HANDLE icdev,unsigned char _Adr,unsigned long *_Value);rf_decrement_transfer(HANDLE
31、icdev,unsigned char Adr, unsigned long _Value);rf_halNDLE icdev);高级函数:rf_card(HANDLE icdev,unsigned char _Mode,unsigned long *_Snr);rf_changeb3(HANDLE icdev,unsigned char_B0,unsigned char _B1,unsigned char _B2,unsigned*_KeyB);rf_check_write(HANDLE icdev,unsigned long Adr,unsigned char * _data);r,uns
32、igned char *_KeyA,unsignedchar _B3,unsigned char _Bk,unsignedcharcharSnr,unsigned char authmode,unsignedcharrf_check_writehex(HANDLE icdev,unsigned long Snr,unsigned char authmode,unsigned char Adr,char * _data);rf_HL_authentication(HANDLE icdev,unsigned char reqmode,unsigned longauthmode,unsigned c
33、harr);snr,unsignedcharrf_HL_decremenNDLE icdev,unsigned char _Mode,unsigned charr,unsignedlong_Value,unsigned long _Snr,unsigned long *_NValue,unsigned long *_NSnr);rf_HL_incremenNDLE icdev,unsigned char _Mode,unsigned charr,unsignedlong_Value,unsigned long _Snr,unsigned long *_NValue,unsigned long
34、*_NSnr); rf_HL_write(HANDLEicdev,unsignedchar_Mode,unsignedchar*_Snr,unsigned char *_Data);_Adr,unsignedlongrf_HL_writehex(HANDLE icdev,unsigned char _Mode,unsigned char _Adr,unsigned long *_Snr,char *_Data);Page 11 of 69rf_HL_read(HANDLE icdev,unsigned char _Mode,unsigned char _Adr,unsigned long _S
35、nr,unsigned char *_Data,unsigned long *_NSnr);rf_HL_readhex(HANDLE icdev,unsigned char _Mode,unsigned char _Adr,unsigned long _Snr, char*_Data,unsigned long *_NSnr);rf_HL_initval(HANDLE icdev,unsigned char _Mode,unsigned char_Value,unsigned long *_Snr);r,unsigned long函数:rf_request(Unix short short s
36、hort short short short short short short short short short short short short shortshorticdev,unsigned char _Mode,unsigned short *TagType);rf_oll(icdev,unsigned chart,unsigned long *_Snr);rf_select(icdev,unsigned long _Snr,unsigned char *_Size);rf_authentication(rf_authentication_2(icdev,unsigned cha
37、r _Mode,unsigned charr);icdev,unsigned char _Mode,unsigned char KeyNr,unsigned char Adr);rf_read(icdev,unsigned char _Adr,unsigned char *_Data);rf_read_hex(icdev,unsigned char _Adr,char *_Data);rf_write(icdev,unsigned char _Adr,unsigned char *_Data);rf_write_hex(icdev,unsigned char _Adr,char *_Data)
38、;rf_initval(icdev,unsigned char _Adr,unsigned long _Value);rf_increment(icdev,unsigned char _Adr,unsigned long _Value);rf_decrement(rf_readval(icdev,unsigned char _Adr,unsigned long _Value);icdev,unsigned char _Adr,unsigned long *_Value);rf_decrement_transfer(icdev,unsigned char Adr,unsigned long _V
39、alue);rf_transfer(icdev,unsigned char _Adr);rf_restore(icdev,unsigned char _Adr);rf_halt(icdev);shortshortrf_card(icdev,unsigned char _Mode,unsigned long *_Snr);rf_check_write(icdev,unsigned long Snr,unsigned char authmode,unsigned char Adr,unsignedchar * _data);shortrf_check_writehex(icdev,unsigned
40、 long Snr,unsigned char authmode,unsigned charAdr,unsigned char * _data);shortrf_changeb3(icdev,unsigned charr,unsigned char *_KeyA,unsigned char _B0,unsignedchar _B1,unsigned char _B2,unsigned char _B3,unsigned char _Bk,unsigned char *_KeyB);shortrf_HL_authentication(icdev,unsigned char reqmode,uns
41、igned long snr,unsigned charauthmode,unsigned charshortrf_HL_decrement(r);icdev,unsigned char _Mode,unsigned charr,unsigned long _Value,unsigned long _Snr,unsignedlong *_NValue, unsigned long *_NSnr);shortrf_HL_increment(icdev,unsigned char _Mode,unsigned charr,unsigned long_Value,unsigned long _Snr
42、,unsigned long *_NValue, unsigned long *_NSnr);shortrf_HL_write(char *_Data);icdev,unsigned char _Mode,unsigned char _Adr,unsigned long *_Snr,unsignedshortrf_HL_writehex(icdev,unsignedchar_Mode,unsignedchar_Adr,unsignedlong*_Snr,unsigned char *_Data);shortrf_HL_read(icdev,unsigned char _Mode,unsigne
43、d char _Adr,unsigned long _Snr,unsignedPage 12 of 69char *_Data,unsigned long *_NSnr);shortrf_HL_readhex(icdev,unsigned char _Mode,unsigned char _Adr,unsigned long _Snr,unsignedchar *_Data,unsigned long *_NSnr);shortrf_HL_initval(icdev,unsignedchar_Mode,unsignedcharr,unsignedlong_Value,unsigned long
44、 *_Snr);shortrf_get_snr(icdev,unsigned char *_Snr);Linux 函数:rf_request(icdev,unsigned char _Mode,unsigned*TagType);rf_oll(icdev,unsigned chart,unsigned long *_Snr);rf_select(icdev,unsigned long _Snr,unsigned char *_Size);rf_authentication( rf_authentication_2(unsigned char Adr);icdev,unsigned char _
45、Mode,unsigned charr);icdev,unsigned char _Mode,unsigned char KeyNr,rf_read(icdev,unsigned char _Adr,unsigned char *_Data);rf_read_hex(icdev,unsigned char _Adr,char *_Data);rf_write(icdev,unsigned char _Adr,unsigned char *_Data);rf_write_hex(icdev,unsigned char _Adr,char *_Data);rf_initval(icdev,unsi
46、gned char _Adr,unsigned long _Value);rf_increment(icdev,unsigned char _Adr,unsigned long _Value);rf_decrement( rf_readval(rf_transfer(icdev,unsigned char _Adr,unsigned long _Value);icdev,unsigned char _Adr,unsigned long *_Value);icdev,unsigned char _Adr);rf_restore(icdev,unsigned char _Adr);rf_decre
47、ment_transfer(rf_halt(icdev);icdev,unsigned char Adr,unsigned long _Value);rf_card(icdev,unsigned char _Mode,unsigned long *_Snr);rf_check_write(* _data);icdev,unsigned long Snr,unsigned char authmode,unsigned char Adr,unsigned charrf_check_writehex(char * _data);icdev,unsigned long Snr,unsigned cha
48、r authmode,unsigned char Adr,unsignedrf_changeb3(icdev,unsigned charr,unsigned char *_KeyA,unsignedchar _B0,unsigned char _B1,unsigned char _B2,unsigned char _B3,unsigned char _Bk,unsigned char *_KeyB);rf_HL_authentication( authmode,unsigned charrf_HL_decrement(icdev,unsignedcharreqmode,unsignedlong
49、snr,unsignedcharr);icdev,unsignedchar_Mode,unsignedcharr,unsignedlong_Value,unsigned long _Snr,unsigned long *_NValue,unsigned long *_NSnr);rf_HL_increment(icdev,unsignedchar_Mode,unsignedcharr,unsignedlong_Value,unsigned long _Snr,unsigned long *_NValue,unsigned long *_NSnr);rf_HL_write(*_Data);icd
50、ev,unsigned char _Mode,unsigned char _Adr,unsigned long *_Snr,unsigned charrf_HL_writehex(char *_Data);icdev,unsigned char _Mode,unsigned char _Adr,unsigned long *_Snr,unsignedPage 13 of 69rf_HL_read(icdev,unsigned char _Mode,unsigned char _Adr,unsigned long _Snr,unsigned char*_Data,unsigned long *_
51、NSnr);rf_HL_readhex(icdev,unsigned char _Mode,unsigned char_Adr,unsigned long _Snr,unsignedchar *_Data,unsigned long *_NSnr);rf_HL_initval(long *_Snr);icdev,unsigned char _Mode,unsigned charr,unsigned long _Value,unsignedrf_get_snr(icdev,unsigned char *_Snr);Page 14 of 695通用函数下面将详细描述通用函数。1)功参返usb_in
52、it();能:初始化 USB 通讯数:无回:成功则返回设备描述符(0)例:HANDLE icdev;icdev=usb_init();2)rf_init(port,long baud);功 能: 用选定的与 PC 机通讯的串口和波特率初始化这样可以获得通讯口 ID 号供以后使用。,这是操作的第一步,参 数:port:通讯(03)Baud: baudrate 通讯波特率(9600115200)返 回:0:0:成功则返回设备描述符(0)失败例:icdev;icdev=rf_init(1,115200);/ 波特率端口23)功参rf_exit(icdev);能:数:关闭串口并保存 PC 机上的设置。
53、icdev: rf_init()返回的设备描述符= 0:成功0: 失败返回:例:st;st=rf_exit(icdev);4)rf_encrypt(char *key,unsigned char *ptrSource, unsigned unsigned char *ptrDest);能: DES 算法加密。数:msgLen,功参密钥,长度为 8个字节Key:ptrsource: 准备加密的明文,长度必须是8的倍数明文的长度,必须是8的倍数密文msglen:ptrdest:返回:= 0:成功0:失败/用 “12345678”加密“abcdefghabcdefgh” st=rf_encrypt(
54、“1234567”,”abcdefghabcdefgh”,16,ptrdest);例:5)rf_decrypt(char *key,unsigned char *ptrSource,unsignedmsglen, charPage 15 of 69*ptrDest);。功参能: DES 算法数:key:密钥(必须和加密时的相同),长度为 8个字节密文密文的长度,必须是8的倍数明文成功失败ptrsource: msglen: ptrdest:=0:0:返回:例:/用 “12345678”来“abcdefghabcdefgh”st=rf_decrypt(“1234567”,”abcdefghabc
55、defgh”,16,ptrdest);6)功参hex_a(unsigned char *hex,char *a,unsigned char length);将 16 进制数转换为 ASCII 字符。能:数:hex:16 进制数a:输出的 ASCII 字符length: 16 进制数的长度返回:成功失败=007)功参a_hex(char *a,unsigned char *hex,unsigned char len);将 ASCII 字符转换为 16 进制数。能:数:a : hex: length:=00ASCII 字符输出的 16 进制数 ASCII 字符的长度成功失败返回:6设备操作函数1)
56、功参rf_reseNDLE icdev,unsigned 16 _Msec);能:数:射频头复位(射频头掉电几毫秒)。icdev:rf_init()返回的设备描述符_Msec: 复位时间,0500毫秒有效=0:成功0:失败st=rf_reset(icdev,60);返回:例:2)功参rf_beep(HANDLE icdev,unsigned short _Msec);蜂鸣几毫秒。能:数:Page 16 of 69icdev:rf_init()返回的设备描述符_Msec: 蜂鸣时间,:毫秒返回:成功失败= 0:0:例:st=rf_becdev,10); /鸣叫10毫秒3)功参rf_get_sus
57、(HANDLE icdev,unsigned char *_Sus);能:数:获取的版本号。icdev:rf_init()返回的设备描述符_Sus: 返回=0:成功0:失败st;版本信息,长度为18字节返回:例:unsigned char sus19;st=rf_get_sus(icdev,sus);4)功参rf_srd_snr(HANDLE icdev, 16 lentsigned char *rec_buffer);能:数:获取的产品序列号。icdev: rf_init()返回的设备描述符 length: 产品序列号的长度为16字节 receive_buffer: 返回的产品序列号=0:成
58、功0:失败unsigned char receive_buffer17; st=rf_srd_snr(icdev,16,receive_buffer);返回:例:5)功参lib_ver(unsigned char *str_ver);获取 API 函数库版本号。能:数:返回 API 函数库版本号,长度为18个字节成功失败strver:=0:0:返回:例:unsigned char str_ver19;st=lib_ver(str_ver);6)rf_srd_eeprom(HANDLE icdev, 16 offset, *rec_buffer);16length, unsignedchar功参
59、能:数:eeprom 的内容。icdev:rf_init()返回的设备描述符 offset:位移地址 (0-383)length:数据长度(1-384) recv_buffer:接收数据的缓冲区Page 17 of 69返 回:= 0:0:成功失败例:unsigned char Send_buffer385;st=rf_srd_eeprom(icdev,0,384,send_buffer);7)rf_swr_eeprom(HANDLE icdev, *send_buffer);能: 向 eeprom 中写入数据。数:icdev: rf_init()返回的设备描述符 offset: 位移地址(0
60、-383)length: 数据长度(1-384)16 offset, 16lengtsignedchar功参send_buffer:将写入 eeprom 中的数据= 0:成功0:失败unsigned char Send_buffer384; st=rf_srd_eeprom(icdev,0,384,send_buffer);返 回:例:7显示控制操作函数1)功参rf_setbrighNDLE icdev,unsigned char bright);设置数码管 LED 的亮度能:数:icdev: rf_init()返回的设备描述符 bright: 亮度等级 0-15=0:成功0:失败bright
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
评论
0/150
提交评论