1. 调用 getTagInfo()接口获取 TagInfo 对象。
2. 调用 connectTag()接口连接 Tag 设备。
3. 调用 isTagConnected()接口查询 Tag 设备连接状态。
4. 调用 sendData(data)接口发送数据到 Tag。
// 连接 Tag 设备,返回值为是否连接成功
boolean connSuccess = tagNdef.connectTag();
// 查询 Tag 连接状态
boolean isConnected = tagNdef.isTagConnected();
// 发送数据到 Tag,返回值为 Tag 的响应数据
byte[] data = {0x13, 0x59, 0x22};
byte[] response = tagNdef.sendData(data);
xpanx.com
https://xpanx.com/
评论