• 2.IsoDep类


    IsoDep

    类概述:

    Provides access to ISO-DEP (ISO 14443-4) properties and I/O operations on a Tag.

    Acquire an IsoDep object using get(Tag).

    The primary ISO-DEP I/O operation is transceive(byte[]). Applications must implement their own protocol stack on top of transceive(byte[]).

    Tags that enumerate the IsoDep technology in getTechList() will also enumerate NfcA or NfcB (since IsoDep builds on top of either of these).

    Note: Methods that perform I/O operations require the NFC permission.

    该类提供了访问ISO-DEP(ISO 14443 - 4)标记属性和I / O操作。

    使用 get(Tag) 函数可以获得一个IsoDep对象。

    主要的ISO-DEP I / O操作是 transceive(byte[]) 函数(核心函数)。应用程序必须他们自己的实现协议栈之上使用 transceive(byte[]) 函数。

    使用 getTechList() 函数会列举IsoDep还将列举NfcA或NfcB(因为IsoDep构建在这两种技术其中一种之上的)。

    注意:执行I / O操作的方法需要获取NFC权限。

    核心函数:public byte[] transceive (byte[] data)

    Send raw ISO-DEP data to the tag and receive the response.

    Applications must only send the INF payload, and not the start of frame and end of frame indicators. Applications do not need to fragment the payload, it will be automatically fragmented and defragmented by transceive(byte[]) if it exceeds FSD/FSC limits.

    Use getMaxTransceiveLength() to retrieve the maximum number of bytes that can be sent with transceive(byte[]).

    This is an I/O operation and will block until complete. It must not be called from the main application thread. A blocked call will be canceled with IOException if close() is called from another thread.

    向标签 tag发送原始ISO-DEP数据和接收响应。

    应用程序必须只发送the INF payload,而不是payload的开始碎片和payload的结束碎片。应用程序不需要拆分payload,使用transceive(byte[])函数将自动分散和整理payload,如果它超过FSD / FSC的限制。

    使用getMaxTransceiveLength()函数来检索transceive(byte[])能发送的最大字节数。

    这是一个I / O操作,将阻塞,直到操作完成。在主应用程序线程,它不能被调用。如果在另一个线程调用close()函数,该操作调用将被取消并抛出IOException异常。


     

  • 相关阅读:
    Spring配置通过动态工厂方法创建的bean
    Spring配置通过静态工厂方法创建的bean
    SpringMVC针对post请求乱码的处理
    SpringMVC的HelloWorld快速入门!
    SpringMVC和Spring的关系
    pageContext、request、session和application区别
    orcale 实现 sql server 里面的表值函数SPLIT
    查询语句有 or 会导致查询速度变慢问题解决
    用谷歌浏览器以及插件 测试接口
    OraCle 记录 实现 sql中的 for xml path ('')
  • 原文地址:https://www.cnblogs.com/H-BolinBlog/p/5362431.html
Copyright © 2020-2023  润新知