客户端 API/网页应用/小程序API/设备/NFC/NfcV/NfcV.transceive
# NfcV.transceive(Object object)

发送数据给NFCV类型的标签

## 支持说明

应用能力 | Android | iOS | PC | 预览效果
---|---|---|---|---
小程序 | V5.14.0+ | **X** | **X** | 预览
网页应用 | V5.14.0+ | **X** | **X** | 预览

## 输入
继承[标准对象输入](https://open.larksuite.com/document/uYjL24iN/ukzNy4SO3IjL5cjM)，扩展属性描述：

名称 | 数据类型 | 必填 | 默认值 | 描述
---|---|---|---|---
data | arraybuffer | &nbsp; | &nbsp; | 需要传递的二进制数据

## 输出
`success`返回对象的扩展属性：

名称 | 数据类型 | 描述
---|---|---
data | arraybuffer | 返回的二进制数据

## 示例代码

```js
let adapter = tt.getNFCAdapter();
adapter.onDiscovered(
      (res) => {
           console.log('onDiscovered res, ' + JSON.stringify(res));
           let nfcV = adapter.getNfcV();
        	//传递数据
           nfcV.transceive({
              data: new Uint8Array([0x22, 0x20, ...this.uid, 1).buffer,
              success(res) {
                  console.log('NfcV.transceive success res=', res, Array.from(new Uint8Array(res.data)));
              },
              fail(res) {
                  console.log(`NfcV.transceive fail: ${JSON.stringify(res)}`)
              }
           });
      }
);
```
`success`返回对象示例：
```json
{"errMsg":"nfcTransceive:ok","data":{}}
```

## 错误码
`fail`返回对象中会包含[errno属性](https://open.larksuite.com/document/uYjL24iN/uAjMuAjMuAjM/errno)，代表错误码。

通用错误码可参见 [NFC API 错误码](https://open.larksuite.com/document/uYjL24iN/uQzM4YjL0MDO24CNzgjN/nfc-error-codes)