Re: [web-nfc] Support TNEP (#559)

From reading source code: 

```
#define NFC_TNEP_VERSION 0x10
enum nfc_tnep_comm_mode {
 /** Single response communication mode */
 NFC_TNEP_COMM_MODE_SINGLE_RESPONSE,
 /** Service specific communication mode */
 NFC_TNEP_COMM_MODE_SERVICE_SPECYFIC = 0xFE
};
/** Maximum Service Waiting Time. */
#define NFC_TNEP_TAG_MAX_WAIT_TIME 63
/** Maximum Waiting Time extension. */
#define NFC_TNEP_TAG_MAX_N_WAIT_TIME 15
```

Service Parameters Record "Tp" payload:

byte: version (0x10)
byte: uri length in bytes
uri length bytes: uri
byte: communication_mode (0x01 single response, 0xFE service specific) 
byte: min_time (0...63 - converted to time units using protocol specified formula)
byte: max_time_ext (0...15 repetitions)
2 bytes (Big Endian): max_size in bytes

--
```
enum nfc_tnep_status_value {
 /** Success */
 NFC_TNEP_STATUS_SUCCESS,

 /** TNEP protocol error */
 NFC_TNEP_STATUS_PROTOCOL_ERROR,

 /** First service error code. */
 NFC_TNEP_STATUS_SERVICE_ERROR_BEGIN = 0x80,

 /** Last service error code. */
 NFC_TNEP_STATUS_SERVICE_ERROR_END = 0xFE,
};
```

TNEP status "Te" payload:

byte: status (0x01 success, 0x02 protocol error, 0x80...0xFE service specific errors)

--

Service Select "Ts" payload:

byte: uri length in bytes
uri length bytes: uri


-- 
GitHub Notification of comment by kenchris
Please view or discuss this issue at https://github.com/w3c/web-nfc/issues/559#issuecomment-617755361 using your GitHub account

Received on Wednesday, 22 April 2020 12:41:56 UTC