为实现不同近场通信(NFC)设备间的互通,以NFC设备的点对点通信(P2P)为研究对象,设计并实现基于Android平台的NFC移动终端与读卡器之间的点对点(P2P)通信方案。NFC移动终端与读卡器以NFC数据交换格式(NDEF)的数据为通信单元,在简单NDEF交换协议的基础上,一方作为客户端发送传输消息请求,另一方作为服务器对客户端的请求做出响应。通过应用协议数据单元中的命令-响应消息对使NFC移动终端与读卡器进行交互。测试结果表明,NFC移动终端与NFC读卡器均可以主动给对方发送消息,较好地实现了两者之间的P2P通信。
To achieve interconnection between different Near Field Communication(NFC)devices,Peer to Peer(P2P)communication of NFC device as the object of study,this paper designs and implements P2P communication between NFC mobile terminal and NFC reader based on Android platform. NFC mobile terminal and NFC reader takes NFC Data Exchange Format(NDEF)as the communication unit,based on the Simple NDEF Exchange Protocol(SNEP)protocol,a party is as a client to send the message transmission request,and the other is as a server to respond client request. It is to enable NFC mobile terminal interact with NFC reader through command-response message pair in Application Protocol Data Unit(APDU). Test results show that both NFC mobile terminal and NFC reader can take the initiative send messages to each other,and better achieve P2P communication between NFC mobile terminal and NFC reader