nfa_ce_api.h revision f8a4ca325ef137a94869b34d36095ba7d08816a3
1/***************************************************************************** 2** 3** Name: nfa_ce_api.h 4** 5** Description: NFA card emulation API functions 6** 7** Copyright (c) 2010-2011, Broadcom Corp., All Rights Reserved. 8** Broadcom Bluetooth Core. Proprietary and confidential. 9** 10*****************************************************************************/ 11#ifndef NFA_CE_API_H 12#define NFA_CE_API_H 13 14#include "nfc_target.h" 15#include "nfa_api.h" 16 17/***************************************************************************** 18** Constants and data types 19*****************************************************************************/ 20 21/***************************************************************************** 22** External Function Declarations 23*****************************************************************************/ 24#ifdef __cplusplus 25extern "C" 26{ 27#endif 28 29/******************************************************************************* 30** 31** Function NFA_CeConfigureLocalTag 32** 33** Description Configure local NDEF tag. 34** 35** Tag events will be notifed using the tNFA_CONN_CBACK 36** (registered during NFA_Enable) 37** 38** The NFA_CE_LOCAL_TAG_CONFIGURED reports the status of the 39** operation. 40** 41** Activation and deactivation are reported using the 42** NFA_ACTIVATED_EVT and NFA_DEACTIVATED_EVT events 43** 44** If a write-request is received to update the tag memory, 45** an NFA_CE_NDEF_WRITE_EVT will notify the application, along 46** with a buffer containing the updated contents. 47** 48** To disable the local NDEF tag, set protocol_mask=0 49** 50** The NDEF data provided by p_ndef_data must be persistent 51** as long as the local NDEF tag is enabled. 52** 53** UID of the tag can be set only for Type 1 and Type 2 tag. 54** UID Length should be 4/7 bytes in case of Type 1 tag and 55** UID Length should be 4/10 bytes in case of Type 2 tag. 56** 57** Note: If RF discovery is started, NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT 58** should happen before calling this function 59** 60** Returns: 61** NFA_STATUS_OK, if command accepted 62** NFA_STATUS_INVALID_PARAM, 63** if protocol_maks is not 0 and p_ndef_data is NULL 64** (or)if p_uid is NULL and uid_len is not 0 65** (or)if protocol mask is set for both Type 1 and Type 2 66** (or)if uid_len is not 0 and protocol mask is not set for Type 1/2 67** (or)if protocol mask is set for Type 1 and uid_len is not 4/7 68** (or)if protocol mask is set for Type 2 and uid_len is not 4/10 69** 70** NFA_STATUS_FAILED: otherwise 71** 72*******************************************************************************/ 73NFC_API extern tNFA_STATUS NFA_CeConfigureLocalTag (tNFA_PROTOCOL_MASK protocol_mask, 74 UINT8 *p_ndef_data, 75 UINT16 ndef_cur_size, 76 UINT16 ndef_max_size, 77 BOOLEAN read_only, 78 UINT8 uid_len, 79 UINT8 *p_uid); 80 81/******************************************************************************* 82** 83** Function NFA_CeConfigureUiccListenTech 84** 85** Description Configure listening for the UICC, using the specified 86** technologies. 87** 88** Events will be notifed using the tNFA_CONN_CBACK 89** (registered during NFA_Enable) 90** 91** The NFA_CE_UICC_LISTEN_CONFIGURED_EVT reports the status of the 92** operation. 93** 94** Activation and deactivation are reported using the 95** NFA_ACTIVATED_EVT and NFA_DEACTIVATED_EVT events 96** 97** Note: If RF discovery is started, NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT 98** should happen before calling this function 99** 100** Returns: 101** NFA_STATUS_OK, if command accepted 102** NFA_STATUS_FAILED: otherwise 103** 104*******************************************************************************/ 105NFC_API extern tNFA_STATUS NFA_CeConfigureUiccListenTech (tNFA_HANDLE ee_handle, 106 tNFA_TECHNOLOGY_MASK tech_mask); 107 108/******************************************************************************* 109** 110** Function NFA_CeRegisterFelicaSystemCodeOnDH 111** 112** Description Register listening callback for Felica system code 113** 114** The NFA_CE_REGISTERED_EVT reports the status of the 115** operation. 116** 117** Note: If RF discovery is started, NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT 118** should happen before calling this function 119** 120** Returns: 121** NFA_STATUS_OK, if command accepted 122** NFA_STATUS_FAILED: otherwise 123** 124*******************************************************************************/ 125NFC_API extern tNFA_STATUS NFA_CeRegisterFelicaSystemCodeOnDH (UINT16 system_code, 126 UINT8 nfcid2[NCI_RF_F_UID_LEN], 127 tNFA_CONN_CBACK *p_conn_cback); 128 129/******************************************************************************* 130** 131** Function NFA_CeDeregisterFelicaSystemCodeOnDH 132** 133** Description Deregister listening callback for Felica 134** (previously registered using NFA_CeRegisterFelicaSystemCodeOnDH) 135** 136** The NFA_CE_DEREGISTERED_EVT reports the status of the 137** operation. 138** 139** Note: If RF discovery is started, NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT 140** should happen before calling this function 141** 142** Returns NFA_STATUS_OK if successfully initiated 143** NFA_STATUS_BAD_HANDLE if invalid handle 144** NFA_STATUS_FAILED otherwise 145** 146*******************************************************************************/ 147NFC_API extern tNFA_STATUS NFA_CeDeregisterFelicaSystemCodeOnDH (tNFA_HANDLE handle); 148 149/******************************************************************************* 150** 151** Function NFA_CeRegisterAidOnDH 152** 153** Description Register listening callback for the specified ISODEP AID 154** 155** The NFA_CE_REGISTERED_EVT reports the status of the 156** operation. 157** 158** If no AID is specified (aid_len=0), then p_conn_cback will 159** will get notifications for any AIDs routed to the DH. This 160** over-rides callbacks registered for specific AIDs. 161** 162** Note: If RF discovery is started, NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT 163** should happen before calling this function 164** 165** Returns: 166** NFA_STATUS_OK, if command accepted 167** NFA_STATUS_FAILED: otherwise 168** 169*******************************************************************************/ 170NFC_API extern tNFA_STATUS NFA_CeRegisterAidOnDH (UINT8 aid[NFC_MAX_AID_LEN], 171 UINT8 aid_len, 172 tNFA_CONN_CBACK *p_conn_cback); 173 174/******************************************************************************* 175** 176** Function NFA_CeDeregisterAidOnDH 177** 178** Description Deregister listening callback for ISODEP AID 179** (previously registered using NFA_CeRegisterAidOnDH) 180** 181** The NFA_CE_DEREGISTERED_EVT reports the status of the 182** operation. 183** 184** Note: If RF discovery is started, NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT 185** should happen before calling this function 186** 187** Returns NFA_STATUS_OK if successfully initiated 188** NFA_STATUS_BAD_HANDLE if invalid handle 189** NFA_STATUS_FAILED otherwise 190** 191*******************************************************************************/ 192NFC_API extern tNFA_STATUS NFA_CeDeregisterAidOnDH (tNFA_HANDLE handle); 193 194/******************************************************************************* 195** 196** Function NFA_CeSetIsoDepListenTech 197** 198** Description Set the technologies (NFC-A and/or NFC-B) to listen for when 199** NFA_CeConfigureLocalTag or NFA_CeDeregisterAidOnDH are called. 200** 201** By default (if this API is not called), NFA will listen 202** for both NFC-A and NFC-B for ISODEP. 203** 204** Note: If listening for ISODEP on UICC, the DH listen callbacks 205** may still get activate notifications for ISODEP if the reader/ 206** writer selects an AID that is not routed to the UICC (regardless 207** of whether A or B was disabled using NFA_CeSetIsoDepListenTech) 208** 209** Note: If RF discovery is started, NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT 210** should happen before calling this function 211** 212** Returns: 213** NFA_STATUS_OK, if command accepted 214** NFA_STATUS_FAILED: otherwise 215** 216*******************************************************************************/ 217NFC_API extern tNFA_STATUS NFA_CeSetIsoDepListenTech (tNFA_TECHNOLOGY_MASK tech_mask); 218 219#ifdef __cplusplus 220} 221#endif 222 223#endif /* NFA_CE_API_H */ 224