nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
ch.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
7#ifndef NFC_TNEP_CH_H_
8#define NFC_TNEP_CH_H_
9
16#include <stdint.h>
17#include <stddef.h>
18#include <nfc/ndef/ch.h>
19#include <nfc/tnep/tag.h>
20
21#ifdef _cplusplus
22extern "C" {
23#endif
24
26#define NFC_TNEP_CH_URI_LENGTH 19
27
30
34 const struct nfc_ndef_ch_ac_rec *ac;
35
38
40 size_t count;
41
43 uint8_t major_ver;
44
46 uint8_t minor_ver;
47};
48
52 const struct nfc_ndef_ch_cr_rec *cr;
53
56};
57
70 int (*request_msg_prepare)(void);
71
86 int (*request_msg_recv)(const struct nfc_tnep_ch_request *ch_req);
87
105 int (*select_msg_recv)(const struct nfc_tnep_ch_record *ch_select,
106 bool inactive);
107
108#if defined(CONFIG_NFC_TNEP_TAG)
123 int (*mediation_req_recv)(void);
124
139 int (*initial_msg_recv)(const struct nfc_tnep_ch_record *ch_initial);
140#endif /* defined(CONFIG_NFC_TNEP_TAG) */
141
148 void (*error)(int err);
149};
150
159
177 struct nfc_ndef_record_desc *carrier_rec,
178 size_t count);
179
190 const struct nfc_ndef_tnep_rec_svc_param *services,
191 size_t cnt
192);
193
194
195#ifdef _cplusplus
196}
197#endif
198
203#endif /* NFC_TNEP_CH_H_ */
#define NFC_TNEP_CH_URI_LENGTH
Definition: ch.h:26
int nfc_tnep_ch_carrier_set(struct nfc_ndef_record_desc *ac_rec, struct nfc_ndef_record_desc *carrier_rec, size_t count)
Set Connection Handover carriers.
const uint8_t nfc_tnep_ch_svc_uri[19]
NFC Connection Handover service URI.
const struct nfc_ndef_tnep_rec_svc_param * nfc_tnep_ch_svc_search(const struct nfc_ndef_tnep_rec_svc_param *services, size_t cnt)
Helper function for searching the Connection Handover service in the Initial NDEF Message.
int nfc_tnep_ch_service_init(struct nfc_tnep_ch_cb *cb)
Initialize the TNEP Connection Handover service.
Alternative Carrier record payload descriptor.
Definition: ch.h:109
Collision Resolution record payload descriptor.
Definition: ch.h:129
NDEF record descriptor.
Definition: record.h:91
Service Parameters in the TNEP's Initial NDEF message.
Definition: tnep_rec.h:51
int(* request_msg_prepare)(void)
The Connection Handover Request Message prepare callback.
Definition: ch.h:70
int(* mediation_req_recv)(void)
The Connection Handover Mediation Request Message received callback.
Definition: ch.h:123
int(* select_msg_recv)(const struct nfc_tnep_ch_record *ch_select, bool inactive)
The Connection Handover Select Message received callback.
Definition: ch.h:105
int(* request_msg_recv)(const struct nfc_tnep_ch_request *ch_req)
The Connection Handover Request Message received callback.
Definition: ch.h:86
int(* initial_msg_recv)(const struct nfc_tnep_ch_record *ch_initial)
The Connection Handover Initial Message received callback.
Definition: ch.h:139
void(* error)(int err)
Error callback.
Definition: ch.h:148
Connection Handover service callback structure.
Definition: ch.h:59
uint8_t minor_ver
Definition: ch.h:46
const struct nfc_ndef_record_desc ** carrier
Definition: ch.h:37
const struct nfc_ndef_ch_ac_rec * ac
Definition: ch.h:34
size_t count
Definition: ch.h:40
uint8_t major_ver
Definition: ch.h:43
Connection Handover Record structure.
Definition: ch.h:32
const struct nfc_ndef_ch_cr_rec * cr
Definition: ch.h:52
struct nfc_tnep_ch_record ch_record
Definition: ch.h:55
Connection Handover Request Record structure.
Definition: ch.h:50