llcp-dep p2p发现和连接 [英] llcp-dep p2p discovery and connections

查看:184
本文介绍了llcp-dep p2p发现和连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在一个学校项目中,将 pn532 与nfc电话连接起来.我正在使用seeedstudio nfc控制器和它们具有的库,并添加了一些代码.我的问题与协议的连接和发现阶段有关.

I am working on a school project to connect the pn532 with a nfc phone. I am using the seeedstudio nfc controller and the library they have, with some code that I am adding. My questions are related to the connection and discovery stage of the protocol.

问题1:当启动器向DSAP = 1 发现服务"发送 CONNECT命令时,响应什么.在下面,我解释了协议的结果.

Question 1: What to respond when the initiator sends a CONNECT command to the DSAP = 1 "discovery service". Bellow I explain the results of the protocol.

用于测试的电话是(gs4,注释2):

Phones used to test were(gs4, note 2):

情况1:

  • 电话向我发送 05 20 06 ,这是到接收方设备中SAP = 1的CONNECT命令,然后我用CC命令 81 84 2 2 0 78 进行响应>.
  • 然后,他们向我发送一个IPDU,并在前台将应用程序的URI发送给我,我一直按照nfc论坛中的llcp-snep协议发送命令,一切都变得很酷. *问题是我不希望应用程序的URI出现在前台,而是需要该应用程序的 NDEF消息 数据.*
  • the phone sends me 05 20 06 this is a CONNECT command to SAP =1 in the receiver device, then I respond with the CC command 81 84 2 2 0 78.
  • then they send me an IPDU with the URI of the application in the foreground, I keep sending command as per the llcp-snep protocol in the nfc forum and everything finish cool. *The problem is that I don't want the URI of the application in the foreground, I want the NDEF message data of that application instead.*

情况2:

  • 电话发送到pn532 11 20 ,这是到接收方设备中SAP = 4的CONNECT命令,然后我用命令 CC 81 84 2 2 0 78 .
  • 此后,手机会按照预期发送给我NDEF数据.

  • the phones send to the pn532 11 20 , this is a CONNECT command to SAP =4 in the receiver device, then I respond with the command CC 81 84 2 2 0 78.
  • After this the phone send me the NDEF data as is suppose to be.

现在我的问题是:

为什么手机有时会向我发送CONNECT命令给SAP = 1,而有时给我发送CONNECT命令给SAP = 4?

Why some times the phone send me the CONNECT command to the SAP =1 and some times to SAP=4?

05 20 06 我必须响应什么命令?

What command I have to response for the 05 20 06 ?

推荐答案

将CONNECT命令发送到SAP 1时,这意味着发送方希望一步执行服务发现和连接设置.在这种情况下,CONNECT命令中的必需信息是服务名称.如果该服务存在并且可连接,则响应将是CC(连接完成)PDU到从其接收CONNECT的SAP以及从SAP接收到的 命名服务绑定到的SAP.如果不存在具有所请求名称的服务,则答案必须是带有适当原因码的Disconnected Mode(DM)PDU.

When a CONNECT command is send to SAP 1 it means that the sender wants to perform service discovery and connection setup in one step. In this situation, a required information in the CONNECT command is the service name. If that service exists and is connectable the response would be a CC (Connection Complete) PDU to the SAP from which CONNECT was received and from the SAP that the named service is bound to. If a service with the requested name does not exist the answer would have to be a Disconnected Mode (DM) PDU with the appropriate reason code.

不幸的是,您没有提供有关在SAP 1上收到的CONNECT命令的完整信息,以免丢失服务名称长度字节和名称本身.按照书面规定,CONNECT PDU只是无效的,不应被确认.

Unfortunately you have not provided full information about the CONNECT command received on SAP 1, at lest the service name length byte and the name itself are missing. As written, the CONNECT PDU is just invalid and should not be acknowledged.

这篇关于llcp-dep p2p发现和连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆