资源描述:
《拉卡拉刷卡器接口回调说明 - 深圳市艾创电子有限公司》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、eItronInterfacesDocumentV4.0ShenzhenItronDocumentRevisionHistory日期版本修改人审核人修改内容2012-8-10V1.0李欣初版2012-11-20V1.2李欣增加isDevicePresent2013-8-26V3.0WX修改回调函数增加返回MAC2014-7-25V3.1Wx增加IC卡刷卡器通信协议ClassControlCSwiper控制器类负责与刷卡器交互,刷卡器相关的功能都将在此类中进行相应的封装,所有对刷卡器的操作都通过此控制器
2、的实例进行.此类为单例模式.Thecontrollerclassisresponsibleforfunctionsrelatedtoswipecardreaderinteraction,swipecardreaderwillmaketheappropriatepackageintheclass,alloperationsonthecardarecarriedoutbywayofexampleofthiscontroller.Suchasingleton.CSwiperStateChangedListe
3、ner实现此接口的对象与CSwiperController控制器绑定,控制器会回调接口中相应的方法,实现刷卡器事件驱动机制ObjectthatimplementsthisinterfaceandCSwiperControllercontrollerbinding,thecontrollercallbackinterfaceappropriatemethodtoachieveevent-drivenmechanismcardreaderCSwiperConstructionmethodCSwiper.G
4、etInstance(Context,cSwiperListener);function:VoidstartCSwiper(intctrlmode,byte[]random,byte[]appenddata,inttime)StartCSwiperfunctionblockingmodelparameter description:Ctrlmode:Controlflagbit0=0/1Indicatesthereisequipmentgeneratesrandom/generatedbythepar
5、ties。Whenproducedbytheparties,lovebrushproducesonly4bytes.Ifthephonesideislessthan4bytes,thenlovewillbrushupbeforethe4-byteFFBit1=0/1Donotreturntheterminaldata/ReturntoterminaldataMACBit2=0/1Cardnumberisnotblocked/CardnumberisblockedRandom:maxlength4byt
6、es·Appenddata:additional data,maxlength100bytesTime:TimeOutvoidstopCSwiper()StopuseroperationvoiddeleteCDwiper()ReleaseResourceStringgetKsn()ReturnTerminalSNbooleanisDevicePresent()IntgetTerminalType()ReturnTerminaltype0smartpos03:i30+04:hsm2005:i2106:i
7、21BBooleanUpdateTerminalParameters(intindex,intpage,byte[]data)ICCardPublickey/AIDParameterloadingparameter :bit0=0/1publickey/aid。Otherretain(default0)Data:为8583协议的62域内容(不包含长度)PageNo:from0,Inascendingorder。IfpageNo=0clearBeforeRemove:VoidsecondIssuance
8、(Stringcode,byte[]data)Incardtransactionscriptwritebackparameter :Code39域8583中交易应答码Data85838协议的55域中要会写的数据。VoidstatEmvSwiper(bytemodel,byte[]flag,byte[]random,Stringmoney,byte[]appendData,inttimeOut,TransactionInfoinfo)启动IC卡与磁条卡交易