rw_api.h revision 561d1d71ebebb36743b793e99dbdaf7d52993f42
1/****************************************************************************** 2 * 3 * Copyright (C) 2009-2014 Broadcom Corporation 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at: 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 * 17 ******************************************************************************/ 18 19/****************************************************************************** 20 * 21 * This file contains the Near Field Communication (NFC) Reader/Writer mode 22 * related API function external definitions. 23 * 24 ******************************************************************************/ 25 26#ifndef RW_API_H 27#define RW_API_H 28#include "nfc_api.h" 29#include "tags_defs.h" 30 31#define RW_T1T_BLD_ADD(a, k, y) (a) = (((k) & 0xF) << 3) | ((y) & 0x7); 32#define RW_T1T_BLD_ADDS(a, s) (a) = (((s) & 0xF) << 4); 33 34#define RW_T1T_FIRST_EVT 0x20 35#define RW_T2T_FIRST_EVT 0x40 36#define RW_T3T_FIRST_EVT 0x60 37#define RW_T4T_FIRST_EVT 0x80 38#define RW_I93_FIRST_EVT 0xA0 39 40enum { 41 /* Note: the order of these events can not be changed */ 42 /* Type 1 tag events for tRW_CBACK */ 43 RW_T1T_RID_EVT = RW_T1T_FIRST_EVT, /* Read ID command completd */ 44 RW_T1T_RALL_CPLT_EVT, /* Read All command completed */ 45 RW_T1T_READ_CPLT_EVT, /* Read byte completed */ 46 RW_T1T_WRITE_E_CPLT_EVT, /* Write byte after erase completed */ 47 RW_T1T_WRITE_NE_CPLT_EVT, /* Write byte with no erase completed */ 48 RW_T1T_RSEG_CPLT_EVT, /* Read segment completed */ 49 RW_T1T_READ8_CPLT_EVT, /* Read block completed */ 50 RW_T1T_WRITE_E8_CPLT_EVT, /* Write block after erase completed */ 51 RW_T1T_WRITE_NE8_CPLT_EVT, /* Write block with no erase completed */ 52 RW_T1T_TLV_DETECT_EVT, /* Lock/Mem/Prop tlv detection complete */ 53 RW_T1T_NDEF_DETECT_EVT, /* NDEF detection complete */ 54 RW_T1T_NDEF_READ_EVT, /* NDEF read completed */ 55 RW_T1T_NDEF_WRITE_EVT, /* NDEF write complete */ 56 RW_T1T_SET_TAG_RO_EVT, /* Tag is set as read only */ 57 RW_T1T_RAW_FRAME_EVT, /* Response of raw frame sent */ 58 RW_T1T_PRESENCE_CHECK_EVT, /* Response to RW_T1tPresenceCheck */ 59 RW_T1T_FORMAT_CPLT_EVT, /* Tag Formated */ 60 RW_T1T_INTF_ERROR_EVT, /* RF Interface error event */ 61 RW_T1T_MAX_EVT, 62 63 /* Type 2 tag events */ 64 RW_T2T_READ_CPLT_EVT = RW_T2T_FIRST_EVT, /* Read completed */ 65 RW_T2T_WRITE_CPLT_EVT, /* Write completed */ 66 RW_T2T_SELECT_CPLT_EVT, /* Sector select completed */ 67 RW_T2T_NDEF_DETECT_EVT, /* NDEF detection complete */ 68 RW_T2T_TLV_DETECT_EVT, /* Lock/Mem/Prop tlv detection complete */ 69 RW_T2T_NDEF_READ_EVT, /* NDEF read completed */ 70 RW_T2T_NDEF_WRITE_EVT, /* NDEF write complete */ 71 RW_T2T_SET_TAG_RO_EVT, /* Tag is set as read only */ 72 RW_T2T_RAW_FRAME_EVT, /* Response of raw frame sent */ 73 RW_T2T_PRESENCE_CHECK_EVT, /* Response to RW_T2tPresenceCheck */ 74 RW_T2T_FORMAT_CPLT_EVT, /* Tag Formated */ 75 RW_T2T_INTF_ERROR_EVT, /* RF Interface error event */ 76 RW_T2T_MAX_EVT, 77 78 /* Type 3 tag events for tRW_CBACK */ 79 RW_T3T_CHECK_CPLT_EVT = RW_T3T_FIRST_EVT, /* Read completed */ 80 RW_T3T_UPDATE_CPLT_EVT, /* Write completed */ 81 RW_T3T_CHECK_EVT, /* Segment of data received from type 3 tag */ 82 RW_T3T_RAW_FRAME_EVT, /* SendRawFrame response */ 83 RW_T3T_NDEF_DETECT_EVT, /* NDEF detection complete */ 84 RW_T3T_PRESENCE_CHECK_EVT, /* Response to RW_T3tPresenceCheck */ 85 RW_T3T_POLL_EVT, /* Response to RW_T3tPoll */ 86 RW_T3T_GET_SYSTEM_CODES_EVT, /* Response to RW_T3tGetSystemCodes */ 87 RW_T3T_FORMAT_CPLT_EVT, /* Tag Formated (Felica-Lite only) */ 88 RW_T3T_SET_READ_ONLY_CPLT_EVT, /* Tag is set as Read only */ 89 RW_T3T_INTF_ERROR_EVT, /* RF Interface error event */ 90 RW_T3T_MAX_EVT, 91 92 /* Type 4 tag events for tRW_CBACK */ 93 RW_T4T_NDEF_DETECT_EVT = 94 RW_T4T_FIRST_EVT, /* Result of NDEF detection procedure */ 95 /* Mandatory NDEF file is selected */ 96 RW_T4T_NDEF_READ_EVT, /* Segment of data received from type 4 tag */ 97 RW_T4T_NDEF_READ_CPLT_EVT, /* Read operation completed */ 98 RW_T4T_NDEF_READ_FAIL_EVT, /* Read operation failed */ 99 RW_T4T_NDEF_UPDATE_CPLT_EVT, /* Update operation completed */ 100 RW_T4T_NDEF_UPDATE_FAIL_EVT, /* Update operation failed */ 101 RW_T4T_SET_TO_RO_EVT, /* Tag is set as read only */ 102 RW_T4T_PRESENCE_CHECK_EVT, /* Response to RW_T4tPresenceCheck */ 103 RW_T4T_RAW_FRAME_EVT, /* Response of raw frame sent */ 104 RW_T4T_INTF_ERROR_EVT, /* RF Interface error event */ 105 RW_T4T_NDEF_FORMAT_CPLT_EVT, /* Format operation completed */ 106 RW_T4T_MAX_EVT, 107 108 /* ISO 15693 tag events for tRW_CBACK */ 109 RW_I93_NDEF_DETECT_EVT = 110 RW_I93_FIRST_EVT, /* Result of NDEF detection procedure */ 111 RW_I93_NDEF_READ_EVT, /* Segment of data received from tag */ 112 RW_I93_NDEF_READ_CPLT_EVT, /* Read operation completed */ 113 RW_I93_NDEF_READ_FAIL_EVT, /* Read operation failed */ 114 RW_I93_NDEF_UPDATE_CPLT_EVT, /* Update operation completed */ 115 RW_I93_NDEF_UPDATE_FAIL_EVT, /* Update operation failed */ 116 RW_I93_FORMAT_CPLT_EVT, /* Format procedure complete */ 117 RW_I93_SET_TAG_RO_EVT, /* Set read-only procedure complete */ 118 RW_I93_INVENTORY_EVT, /* Response of Inventory */ 119 RW_I93_DATA_EVT, /* Response of Read, Get Multi Security */ 120 RW_I93_SYS_INFO_EVT, /* Response of System Information */ 121 RW_I93_CMD_CMPL_EVT, /* Command complete */ 122 RW_I93_PRESENCE_CHECK_EVT, /* Response to RW_I93PresenceCheck */ 123 RW_I93_RAW_FRAME_EVT, /* Response of raw frame sent */ 124 RW_I93_INTF_ERROR_EVT, /* RF Interface error event */ 125 RW_I93_MAX_EVT 126}; 127 128#define RW_RAW_FRAME_EVT 0xFF 129 130typedef uint8_t tRW_EVENT; 131 132/* Tag is read only */ 133#define RW_NDEF_FL_READ_ONLY 0x01 134/* Tag formated for NDEF */ 135#define RW_NDEF_FL_FORMATED 0x02 136/* NDEF supported by the tag */ 137#define RW_NDEF_FL_SUPPORTED 0x04 138/* Unable to find if tag is ndef capable/formated/read only */ 139#define RW_NDEF_FL_UNKNOWN 0x08 140/* Tag supports format operation */ 141#define RW_NDEF_FL_FORMATABLE 0x10 142/* Tag can be soft locked */ 143#define RW_NDEF_FL_SOFT_LOCKABLE 0x20 144/* Tag can be hard locked */ 145#define RW_NDEF_FL_HARD_LOCKABLE 0x40 146/* Tag is one time programmable */ 147#define RW_NDEF_FL_OTP 0x80 148 149typedef uint8_t tRW_NDEF_FLAG; 150 151/* options for RW_T4tPresenceCheck */ 152#define RW_T4T_CHK_READ_BINARY_CH0 0 153#define RW_T4T_CHK_READ_BINARY_CH3 3 154#define RW_T4T_CHK_EMPTY_I_BLOCK 4 155#define RW_T4T_CHK_ISO_DEP_NAK_PRES_CHK 5 156typedef struct { 157 tNFC_STATUS status; 158 uint8_t hr[T1T_HR_LEN]; 159 uint8_t uid[T1T_CMD_UID_LEN]; 160} tRW_T1T_RID_EVT; 161 162typedef struct { 163 tNFC_STATUS status; 164 uint16_t msg_len; /* Length of the NDEF message */ 165} tRW_T2T_DETECT; 166 167typedef struct { 168 tNFC_STATUS status; /* Status of the POLL request */ 169 uint8_t rc; /* RC (request code) used in the POLL request */ 170 uint8_t response_num; /* Number of SENSF_RES responses */ 171 uint8_t response_bufsize; /* Size of SENSF_RES responses */ 172 uint8_t* response_buf; /* Buffer of responses (length + SENSF_RES) see 173 $8.1.2.2 of NCI specs */ 174} tRW_T3T_POLL; 175 176typedef struct { 177 tNFC_STATUS status; /* Status of the Get System Codes request */ 178 uint8_t num_system_codes; /* Number of system codes */ 179 uint16_t* p_system_codes; /* Table of system codes */ 180} tRW_T3T_SYSTEM_CODES; 181 182typedef struct { 183 tNFC_STATUS status; /* status of NDEF detection */ 184 tNFC_PROTOCOL protocol; /* protocol used to detect NDEF */ 185 uint32_t max_size; /* max number of bytes available for NDEF data */ 186 uint32_t cur_size; /* current size of stored NDEF data (in bytes) */ 187 tRW_NDEF_FLAG 188 flags; /* Flags to indicate NDEF capability,formated,formatable and read 189 only */ 190} tRW_DETECT_NDEF_DATA; 191 192typedef struct { 193 tNFC_STATUS status; /* status of NDEF detection */ 194 tNFC_PROTOCOL protocol; /* protocol used to detect TLV */ 195 uint8_t 196 num_bytes; /* number of reserved/lock bytes based on the type of tlv */ 197} tRW_DETECT_TLV_DATA; 198 199typedef struct { 200 tNFC_STATUS status; 201 NFC_HDR* p_data; 202} tRW_READ_DATA; 203 204typedef struct { 205 tNFC_STATUS status; 206 uint8_t sw1; 207 uint8_t sw2; 208} tRW_T4T_SW; 209 210typedef struct /* RW_I93_INVENTORY_EVT */ 211{ 212 tNFC_STATUS status; /* status of Inventory command */ 213 uint8_t dsfid; /* DSFID */ 214 uint8_t uid[I93_UID_BYTE_LEN]; /* UID[0]:MSB, ... UID[7]:LSB */ 215} tRW_I93_INVENTORY; 216 217typedef struct /* RW_I93_DATA_EVT */ 218{ 219 tNFC_STATUS status; /* status of Read/Get security status command */ 220 uint8_t command; /* sent command */ 221 NFC_HDR* p_data; /* block data of security status */ 222} tRW_I93_DATA; 223 224typedef struct /* RW_I93_SYS_INFO_EVT */ 225{ 226 tNFC_STATUS status; /* status of Get Sys Info command */ 227 uint8_t info_flags; /* information flags */ 228 uint8_t uid[I93_UID_BYTE_LEN]; /* UID[0]:MSB, ... UID[7]:LSB */ 229 uint8_t dsfid; /* DSFID if I93_INFO_FLAG_DSFID */ 230 uint8_t afi; /* AFI if I93_INFO_FLAG_AFI */ 231 uint16_t num_block; /* number of blocks if I93_INFO_FLAG_MEM_SIZE */ 232 uint8_t block_size; /* block size in byte if I93_INFO_FLAG_MEM_SIZE */ 233 uint8_t IC_reference; /* IC Reference if I93_INFO_FLAG_IC_REF */ 234} tRW_I93_SYS_INFO; 235 236typedef struct /* RW_I93_CMD_CMPL_EVT */ 237{ 238 tNFC_STATUS status; /* status of sent command */ 239 uint8_t command; /* sent command */ 240 uint8_t error_code; /* error code; I93_ERROR_CODE_XXX */ 241} tRW_I93_CMD_CMPL; 242 243typedef struct { 244 tNFC_STATUS status; 245 NFC_HDR* p_data; 246} tRW_RAW_FRAME; 247 248typedef union { 249 tNFC_STATUS status; 250 tRW_T3T_POLL t3t_poll; /* Response to t3t poll command */ 251 tRW_T3T_SYSTEM_CODES t3t_sc; /* Received system codes from t3 tag */ 252 tRW_DETECT_TLV_DATA tlv; /* The information of detected TLV data */ 253 tRW_DETECT_NDEF_DATA ndef; /* The information of detected NDEF data */ 254 tRW_READ_DATA data; /* The received data from a tag */ 255 tRW_RAW_FRAME raw_frame; /* Response of raw frame sent */ 256 tRW_T4T_SW t4t_sw; /* Received status words from a tag */ 257 tRW_I93_INVENTORY i93_inventory; /* ISO 15693 Inventory response */ 258 tRW_I93_DATA i93_data; /* ISO 15693 Data response */ 259 tRW_I93_SYS_INFO i93_sys_info; /* ISO 15693 System Information */ 260 tRW_I93_CMD_CMPL i93_cmd_cmpl; /* ISO 15693 Command complete */ 261} tRW_DATA; 262 263typedef void(tRW_CBACK)(tRW_EVENT event, tRW_DATA* p_data); 264 265/******************************************************************************* 266** 267** Function RW_T1tRid 268** 269** Description This function send a RID command for Reader/Writer mode. 270** 271** Returns tNFC_STATUS 272** 273*******************************************************************************/ 274extern tNFC_STATUS RW_T1tRid(void); 275 276/******************************************************************************* 277** 278** Function RW_T1tReadAll 279** 280** Description This function send a RALL command for Reader/Writer mode. 281** 282** Returns tNFC_STATUS 283** 284*******************************************************************************/ 285extern tNFC_STATUS RW_T1tReadAll(void); 286 287/******************************************************************************* 288** 289** Function RW_T1tRead 290** 291** Description This function send a READ command for Reader/Writer mode. 292** 293** Returns tNFC_STATUS 294** 295*******************************************************************************/ 296extern tNFC_STATUS RW_T1tRead(uint8_t block, uint8_t byte); 297 298/******************************************************************************* 299** 300** Function RW_T1tWriteErase 301** 302** Description This function send a WRITE-E command for Reader/Writer mode. 303** 304** Returns tNFC_STATUS 305** 306*******************************************************************************/ 307extern tNFC_STATUS RW_T1tWriteErase(uint8_t block, uint8_t byte, 308 uint8_t new_byte); 309 310/******************************************************************************* 311** 312** Function RW_T1tWriteNoErase 313** 314** Description This function send a WRITE-NE command for Reader/Writer 315** mode. 316** 317** Returns tNFC_STATUS 318** 319*******************************************************************************/ 320extern tNFC_STATUS RW_T1tWriteNoErase(uint8_t block, uint8_t byte, 321 uint8_t new_byte); 322 323/******************************************************************************* 324** 325** Function RW_T1tReadSeg 326** 327** Description This function send a RSEG command for Reader/Writer mode. 328** 329** Returns tNFC_STATUS 330** 331*******************************************************************************/ 332extern tNFC_STATUS RW_T1tReadSeg(uint8_t segment); 333 334/******************************************************************************* 335** 336** Function RW_T1tRead8 337** 338** Description This function send a READ8 command for Reader/Writer mode. 339** 340** Returns tNFC_STATUS 341** 342*******************************************************************************/ 343extern tNFC_STATUS RW_T1tRead8(uint8_t block); 344 345/******************************************************************************* 346** 347** Function RW_T1tWriteErase8 348** 349** Description This function send a WRITE-E8 command for Reader/Writer 350** mode. 351** 352** Returns tNFC_STATUS 353** 354*******************************************************************************/ 355extern tNFC_STATUS RW_T1tWriteErase8(uint8_t block, uint8_t* p_new_dat); 356 357/******************************************************************************* 358** 359** Function RW_T1tWriteNoErase8 360** 361** Description This function send a WRITE-NE8 command for Reader/Writer 362** mode. 363** 364** Returns tNFC_STATUS 365** 366*******************************************************************************/ 367extern tNFC_STATUS RW_T1tWriteNoErase8(uint8_t block, uint8_t* p_new_dat); 368 369/******************************************************************************* 370** 371** Function RW_T1tLocateTlv 372** 373** Description This function is called to find the start of the given TLV 374** 375** Parameters: void 376** 377** Returns NCI_STATUS_OK, if detection was started. Otherwise, error 378** status. 379** 380*******************************************************************************/ 381extern tNFC_STATUS RW_T1tLocateTlv(uint8_t tlv_type); 382 383/******************************************************************************* 384** 385** Function RW_T1tDetectNDef 386** 387** Description This function can be called to detect if there is an NDEF 388** message on the tag. 389** 390** Parameters: void 391** 392** Returns NCI_STATUS_OK, if detection was started. Otherwise, error 393** status. 394** 395*******************************************************************************/ 396extern tNFC_STATUS RW_T1tDetectNDef(void); 397 398/******************************************************************************* 399** 400** Function RW_T1tReadNDef 401** 402** Description This function can be called to read the NDEF message on the 403** tag. 404** 405** Parameters: p_buffer: The buffer into which to read the NDEF message 406** buf_len: The length of the buffer 407** 408** Returns NCI_STATUS_OK, if read was started. Otherwise, error status. 409** 410*******************************************************************************/ 411extern tNFC_STATUS RW_T1tReadNDef(uint8_t* p_buffer, uint16_t buf_len); 412 413/******************************************************************************* 414** 415** Function RW_T1tWriteNDef 416** 417** Description This function can be called to write an NDEF message to the 418** tag. 419** 420** Parameters: msg_len: The length of the buffer 421** p_msg: The NDEF message to write 422** 423** Returns NCI_STATUS_OK, if write was started. Otherwise, error 424** status. 425** 426*******************************************************************************/ 427extern tNFC_STATUS RW_T1tWriteNDef(uint16_t msg_len, uint8_t* p_msg); 428 429/******************************************************************************* 430** 431** Function RW_T1tSetTagReadOnly 432** 433** Description This function can be called to set the tag in to read only 434** state 435** 436** Parameters: b_hard_lock: To hard lock or just soft lock the tag 437** 438** Returns NCI_STATUS_OK, if set readonly operation started. 439** Otherwise, error status. 440** 441*******************************************************************************/ 442extern tNFC_STATUS RW_T1tSetTagReadOnly(bool b_hard_lock); 443 444/***************************************************************************** 445** 446** Function RW_T1tPresenceCheck 447** 448** Description 449** Check if the tag is still in the field. 450** 451** The RW_T1T_PRESENCE_CHECK_EVT w/ status is used to indicate presence 452** or non-presence. 453** 454** Returns 455** NFC_STATUS_OK, if raw data frame sent 456** NFC_STATUS_NO_BUFFERS: unable to allocate a buffer for this operation 457** NFC_STATUS_FAILED: other error 458** 459*****************************************************************************/ 460extern tNFC_STATUS RW_T1tPresenceCheck(void); 461 462/***************************************************************************** 463** 464** Function RW_T1tFormatNDef 465** 466** Description 467** Format Tag content 468** 469** Returns 470** NFC_STATUS_OK, Command sent to format Tag 471** NFC_STATUS_REJECTED: Invalid HR0 and cannot format the tag 472** NFC_STATUS_FAILED: other error 473** 474*****************************************************************************/ 475tNFC_STATUS RW_T1tFormatNDef(void); 476 477/******************************************************************************* 478** 479** Function RW_T2tLocateTlv 480** 481** Description This function is called to find the start of the given TLV 482** 483** Returns Pointer to the TLV, if successful. Otherwise, NULL. 484** 485*******************************************************************************/ 486extern tNFC_STATUS RW_T2tLocateTlv(uint8_t tlv_type); 487 488/******************************************************************************* 489** 490** Function RW_T2tRead 491** 492** Description This function issues the Type 2 Tag READ command. When the 493** operation is complete the callback function will be called 494** with a RW_T2T_READ_EVT. 495** 496** Returns tNFC_STATUS 497** 498*******************************************************************************/ 499extern tNFC_STATUS RW_T2tRead(uint16_t block); 500 501/******************************************************************************* 502** 503** Function RW_T2tWrite 504** 505** Description This function issues the Type 2 Tag WRITE command. When the 506** operation is complete the callback function will be called 507** with a RW_T2T_WRITE_EVT. 508** 509** p_write_data points to the array of 4 bytes to be written 510** 511** Returns tNFC_STATUS 512** 513*******************************************************************************/ 514extern tNFC_STATUS RW_T2tWrite(uint16_t block, uint8_t* p_write_data); 515 516/******************************************************************************* 517** 518** Function RW_T2tSectorSelect 519** 520** Description This function issues the Type 2 Tag SECTOR-SELECT command 521** packet 1. If a NACK is received as the response, the 522** callback function will be called with a 523** RW_T2T_SECTOR_SELECT_EVT. If an ACK is received as the 524** response, the command packet 2 with the given sector number 525** is sent to the peer device. When the response for packet 2 526** is received, the callback function will be called with a 527** RW_T2T_SECTOR_SELECT_EVT. 528** 529** A sector is 256 contiguous blocks (1024 bytes). 530** 531** Returns tNFC_STATUS 532** 533*******************************************************************************/ 534extern tNFC_STATUS RW_T2tSectorSelect(uint8_t sector); 535 536/******************************************************************************* 537** 538** Function RW_T2tDetectNDef 539** 540** Description This function will find NDEF message if any in the Tag 541** 542** Returns tNFC_STATUS 543** 544*******************************************************************************/ 545extern tNFC_STATUS RW_T2tDetectNDef(bool skip_dyn_locks); 546 547/******************************************************************************* 548** 549** Function RW_T2tReadNDef 550** 551** Description This function can be called to read the NDEF message on the 552** tag. 553** 554** Parameters: p_buffer: The buffer into which to read the NDEF message 555** buf_len: The length of the buffer 556** 557** Returns NCI_STATUS_OK, if read was started. Otherwise, error status. 558** 559*******************************************************************************/ 560extern tNFC_STATUS RW_T2tReadNDef(uint8_t* p_buffer, uint16_t buf_len); 561 562/******************************************************************************* 563** 564** Function RW_T2tWriteNDef 565** 566** Description This function can be called to write an NDEF message to the 567** tag. 568** 569** Parameters: msg_len: The length of the buffer 570** p_msg: The NDEF message to write 571** 572** Returns NCI_STATUS_OK, if write was started. Otherwise, error 573** status. 574** 575*******************************************************************************/ 576extern tNFC_STATUS RW_T2tWriteNDef(uint16_t msg_len, uint8_t* p_msg); 577 578/******************************************************************************* 579** 580** Function RW_T2tSetTagReadOnly 581** 582** Description This function can be called to set the tag in to read only 583** state 584** 585** Parameters: b_hard_lock: To indicate hard lock the tag or not 586** 587** Returns NCI_STATUS_OK, if set readonly operation started. 588** Otherwise, error status. 589** 590*******************************************************************************/ 591extern tNFC_STATUS RW_T2tSetTagReadOnly(bool b_hard_lock); 592 593/***************************************************************************** 594** 595** Function RW_T2tPresenceCheck 596** 597** Description 598** Check if the tag is still in the field. 599** 600** The RW_T2T_PRESENCE_CHECK_EVT w/ status is used to indicate presence 601** or non-presence. 602** 603** Returns 604** NFC_STATUS_OK, if raw data frame sent 605** NFC_STATUS_NO_BUFFERS: unable to allocate a buffer for this operation 606** NFC_STATUS_FAILED: other error 607** 608*****************************************************************************/ 609extern tNFC_STATUS RW_T2tPresenceCheck(void); 610 611/***************************************************************************** 612** 613** Function RW_T2tFormatNDef 614** 615** Description 616** Format Tag content 617** 618** Returns 619** NFC_STATUS_OK, Command sent to format Tag 620** NFC_STATUS_FAILED: otherwise 621** 622*****************************************************************************/ 623tNFC_STATUS RW_T2tFormatNDef(void); 624 625/***************************************************************************** 626** 627** Function RW_T3tDetectNDef 628** 629** Description 630** This function is used to perform NDEF detection on a Type 3 tag, and 631** retrieve the tag's NDEF attribute information (block 0). 632** 633** Before using this API, the application must call RW_SelectTagType to 634** indicate that a Type 3 tag has been activated, and to provide the 635** tag's Manufacture ID (IDm) . 636** 637** Returns 638** NFC_STATUS_OK: ndef detection procedure started 639** NFC_STATUS_NO_BUFFERS: unable to allocate a buffer for this operation 640** NFC_STATUS_FAILED: other error 641** 642*****************************************************************************/ 643extern tNFC_STATUS RW_T3tDetectNDef(void); 644 645/***************************************************************************** 646** 647** Function RW_T3tFormatNDef 648** 649** Description 650** Format a type-3 tag for NDEF. 651** 652** Only Felica-Lite tags are supported by this API. The 653** RW_T3T_FORMAT_CPLT_EVT is used to notify the status of the operation. 654** 655** Returns 656** NFC_STATUS_OK: ndef detection procedure started 657** NFC_STATUS_NO_BUFFERS: unable to allocate a buffer for this operation 658** NFC_STATUS_FAILED: other error 659** 660*****************************************************************************/ 661extern tNFC_STATUS RW_T3tFormatNDef(void); 662 663/***************************************************************************** 664** 665** Function RW_T3tSetReadOnly 666** 667** Description 668** Set a type-3 tag to Read Only 669** 670** Only Felica-Lite tags are supported by this API. 671** RW_T3tDetectNDef() must be called before using this 672** The RW_T3T_SET_READ_ONLY_CPLT_EVT event will be returned. 673** 674** Returns 675** NFC_STATUS_OK if success 676** NFC_STATUS_FAILED if T3T is busy or other error 677** 678*****************************************************************************/ 679extern tNFC_STATUS RW_T3tSetReadOnly(bool b_hard_lock); 680 681/***************************************************************************** 682** 683** Function RW_T3tCheckNDef 684** 685** Description 686** Retrieve NDEF contents from a Type3 tag. 687** 688** The RW_T3T_CHECK_EVT event is used to notify the application for each 689** segment of NDEF data received. The RW_T3T_CHECK_CPLT_EVT event is used 690** to notify the application all segments have been received. 691** 692** Before using this API, the RW_T3tDetectNDef function must be called to 693** verify that the tag contains NDEF data, and to retrieve the NDEF 694** attributes. 695** 696** Internally, this command will be separated into multiple Tag 3 Check 697** commands (if necessary) - depending on the tag's Nbr (max number of 698** blocks per read) attribute. 699** 700** Returns 701** NFC_STATUS_OK: check command started 702** NFC_STATUS_NO_BUFFERS: unable to allocate a buffer for this operation 703** NFC_STATUS_FAILED: other error 704** 705*****************************************************************************/ 706extern tNFC_STATUS RW_T3tCheckNDef(void); 707 708/***************************************************************************** 709** 710** Function RW_T3tUpdateNDef 711** 712** Description 713** Write NDEF contents to a Type3 tag. 714** 715** The RW_T3T_UPDATE_CPLT_EVT callback event will be used to notify the 716** application of the response. 717** 718** Before using this API, the RW_T3tDetectNDef function must be called to 719** verify that the tag contains NDEF data, and to retrieve the NDEF 720** attributes. 721** 722** Internally, this command will be separated into multiple Tag 3 Update 723** commands (if necessary) - depending on the tag's Nbw (max number of 724** blocks per write) attribute. 725** 726** Returns 727** NFC_STATUS_OK: check command started 728** NFC_STATUS_NO_BUFFERS: unable to allocate a buffer for this operation 729** NFC_STATUS_REFUSED: tag is read-only 730** NFC_STATUS_BUFFER_FULL: len exceeds tag's maximum size 731** NFC_STATUS_FAILED: other error 732** 733*****************************************************************************/ 734extern tNFC_STATUS RW_T3tUpdateNDef(uint32_t len, uint8_t* p_data); 735 736/***************************************************************************** 737** 738** Function RW_T3tCheck 739** 740** Description 741** Read (non-NDEF) contents from a Type3 tag. 742** 743** The RW_READ_EVT event is used to notify the application for each 744** segment of NDEF data received. The RW_READ_CPLT_EVT event is used to 745** notify the application all segments have been received. 746** 747** Before using this API, the application must call RW_SelectTagType to 748** indicate that a Type 3 tag has been activated, and to provide the 749** tag's Manufacture ID (IDm) . 750** 751** Returns 752** NFC_STATUS_OK: check command started 753** NFC_STATUS_NO_BUFFERS: unable to allocate a buffer for this operation 754** NFC_STATUS_FAILED: other error 755** 756*****************************************************************************/ 757extern tNFC_STATUS RW_T3tCheck(uint8_t num_blocks, tT3T_BLOCK_DESC* t3t_blocks); 758 759/***************************************************************************** 760** 761** Function RW_T3tUpdate 762** 763** Description 764** Write (non-NDEF) contents to a Type3 tag. 765** 766** The RW_WRITE_CPLT_EVT event is used to notify the application all 767** segments have been received. 768** 769** Before using this API, the application must call RW_SelectTagType to 770** indicate that a Type 3 tag has been activated, and to provide the tag's 771** Manufacture ID (IDm) . 772** 773** Returns 774** NFC_STATUS_OK: check command started 775** NFC_STATUS_NO_BUFFERS: unable to allocate a buffer for this operation 776** NFC_STATUS_FAILED: other error 777** 778*****************************************************************************/ 779extern tNFC_STATUS RW_T3tUpdate(uint8_t num_blocks, tT3T_BLOCK_DESC* t3t_blocks, 780 uint8_t* p_data); 781 782/***************************************************************************** 783** 784** Function RW_T3tSendRawFrame 785** 786** Description 787** This function is called to send a raw data frame to the peer device. 788** When type 3 tag receives response from peer, the callback function 789** will be called with a RW_T3T_RAW_FRAME_EVT [Table 6]. 790** 791** Before using this API, the application must call RW_SelectTagType to 792** indicate that a Type 3 tag has been activated. 793** 794** The raw frame should be a properly formatted Type 3 tag message. 795** 796** Returns 797** NFC_STATUS_OK, if raw data frame sent 798** NFC_STATUS_NO_BUFFERS: unable to allocate a buffer for this operation 799** NFC_STATUS_FAILED: other error 800** 801*****************************************************************************/ 802extern tNFC_STATUS RW_T3tSendRawFrame(uint16_t len, uint8_t* p_data); 803 804/***************************************************************************** 805** 806** Function RW_T3tPoll 807** 808** Description 809** Send POLL command 810** 811** Returns 812** NFC_STATUS_OK, if raw data frame sent 813** NFC_STATUS_NO_BUFFERS: unable to allocate a buffer for this operation 814** NFC_STATUS_FAILED: other error 815** 816*****************************************************************************/ 817extern tNFC_STATUS RW_T3tPoll(uint16_t system_code, tT3T_POLL_RC rc, 818 uint8_t tsn); 819 820/***************************************************************************** 821** 822** Function RW_T3tPresenceCheck 823** 824** Description 825** Check if the tag is still in the field. 826** 827** The RW_T3T_PRESENCE_CHECK_EVT w/ status is used to indicate presence 828** or non-presence. 829** 830** Returns 831** NFC_STATUS_OK, if raw data frame sent 832** NFC_STATUS_NO_BUFFERS: unable to allocate a buffer for this operation 833** NFC_STATUS_FAILED: other error 834** 835*****************************************************************************/ 836extern tNFC_STATUS RW_T3tPresenceCheck(void); 837 838/***************************************************************************** 839** 840** Function RW_T3tGetSystemCodes 841** 842** Description 843** Get systems codes supported by the activated tag: 844** Poll for wildcard (FFFF): 845** - If felica-lite code then poll for ndef (12fc) 846** - Otherwise send RequestSystmCode command to get 847** system codes. 848** 849** Before using this API, the application must call RW_SelectTagType to 850** indicate that a Type 3 tag has been activated. 851** 852** Returns 853** NFC_STATUS_OK, if raw data frame sent 854** NFC_STATUS_NO_BUFFERS: unable to allocate a buffer for this operation 855** NFC_STATUS_FAILED: other error 856** 857*****************************************************************************/ 858extern tNFC_STATUS RW_T3tGetSystemCodes(void); 859 860/***************************************************************************** 861** 862** Function RW_T4tFormatNDef 863** 864** Description 865** Format a type-4 tag for NDEF. 866** 867** Only Desifire tags are supported by this API. The 868** RW_T4T_FORMAT_CPLT_EVT is used to notify the status of the operation. 869** 870** Returns 871** NFC_STATUS_OK: if success 872** NFC_STATUS_FAILED: other error 873*****************************************************************************/ 874extern tNFC_STATUS RW_T4tFormatNDef(void); 875 876/******************************************************************************* 877** 878** Function RW_T4tDetectNDef 879** 880** Description This function performs NDEF detection procedure 881** 882** RW_T4T_NDEF_DETECT_EVT will be returned 883** 884** Returns NFC_STATUS_OK if success 885** NFC_STATUS_FAILED if T4T is busy or other error 886** 887*******************************************************************************/ 888extern tNFC_STATUS RW_T4tDetectNDef(void); 889 890/******************************************************************************* 891** 892** Function RW_T4tReadNDef 893** 894** Description This function performs NDEF read procedure 895** Note: RW_T4tDetectNDef() must be called before using this 896** 897** The following event will be returned 898** RW_T4T_NDEF_READ_EVT for each segmented NDEF message 899** RW_T4T_NDEF_READ_CPLT_EVT for the last segment or 900** complete NDEF 901** RW_T4T_NDEF_READ_FAIL_EVT for failure 902** 903** Returns NFC_STATUS_OK if success 904** NFC_STATUS_FAILED if T4T is busy or other error 905** 906*******************************************************************************/ 907extern tNFC_STATUS RW_T4tReadNDef(void); 908 909/******************************************************************************* 910** 911** Function RW_T4tUpdateNDef 912** 913** Description This function performs NDEF update procedure 914** Note: RW_T4tDetectNDef() must be called before using this 915** Updating data must not be removed until returning 916** event 917** 918** The following event will be returned 919** RW_T4T_NDEF_UPDATE_CPLT_EVT for complete 920** RW_T4T_NDEF_UPDATE_FAIL_EVT for failure 921** 922** Returns NFC_STATUS_OK if success 923** NFC_STATUS_FAILED if T4T is busy or other error 924** 925*******************************************************************************/ 926extern tNFC_STATUS RW_T4tUpdateNDef(uint16_t length, uint8_t* p_data); 927 928/***************************************************************************** 929** 930** Function RW_T4tPresenceCheck 931** 932** Description 933** Check if the tag is still in the field. 934** 935** The RW_T4T_PRESENCE_CHECK_EVT w/ status is used to indicate presence 936** or non-presence. 937** 938** option is RW_T4T_CHK_EMPTY_I_BLOCK, use empty I block for presence 939** check. 940** 941** Returns 942** NFC_STATUS_OK, if raw data frame sent 943** NFC_STATUS_NO_BUFFERS: unable to allocate a buffer for this operation 944** NFC_STATUS_FAILED: other error 945** 946*****************************************************************************/ 947extern tNFC_STATUS RW_T4tPresenceCheck(uint8_t option); 948 949/***************************************************************************** 950** 951** Function RW_T4tSetNDefReadOnly 952** 953** Description This function performs NDEF read-only procedure 954** Note: RW_T4tDetectNDef() must be called before using this 955** 956** The RW_T4T_SET_TO_RO_EVT event will be returned. 957** 958** Returns NFC_STATUS_OK if success 959** NFC_STATUS_FAILED if T4T is busy or other error 960** 961*****************************************************************************/ 962extern tNFC_STATUS RW_T4tSetNDefReadOnly(void); 963 964/******************************************************************************* 965** 966** Function RW_I93Inventory 967** 968** Description This function send Inventory command with/without AFI 969** If UID is provided then set UID[0]:MSB, ... UID[7]:LSB 970** 971** RW_I93_RESPONSE_EVT will be returned 972** 973** Returns NFC_STATUS_OK if success 974** NFC_STATUS_NO_BUFFERS if out of buffer 975** NFC_STATUS_FAILED if T4T is busy or other error 976** 977*******************************************************************************/ 978extern tNFC_STATUS RW_I93Inventory(bool including_afi, uint8_t afi, 979 uint8_t* p_uid); 980 981/******************************************************************************* 982** 983** Function RW_I93StayQuiet 984** 985** Description This function send Inventory command 986** 987** RW_I93_CMD_CMPL_EVT will be returned 988** 989** Returns NFC_STATUS_OK if success 990** NFC_STATUS_NO_BUFFERS if out of buffer 991** NFC_STATUS_BUSY if busy 992** NFC_STATUS_FAILED if other error 993** 994*******************************************************************************/ 995extern tNFC_STATUS RW_I93StayQuiet(void); 996 997/******************************************************************************* 998** 999** Function RW_I93ReadSingleBlock 1000** 1001** Description This function send Read Single Block command 1002** 1003** RW_I93_RESPONSE_EVT will be returned 1004** 1005** Returns NFC_STATUS_OK if success 1006** NFC_STATUS_NO_BUFFERS if out of buffer 1007** NFC_STATUS_BUSY if busy 1008** NFC_STATUS_FAILED if other error 1009** 1010*******************************************************************************/ 1011extern tNFC_STATUS RW_I93ReadSingleBlock(uint16_t block_number); 1012 1013/******************************************************************************* 1014** 1015** Function RW_I93WriteSingleBlock 1016** 1017** Description This function send Write Single Block command 1018** Application must get block size first by calling 1019** RW_I93GetSysInfo(). 1020** 1021** RW_I93_CMD_CMPL_EVT will be returned 1022** 1023** Returns NFC_STATUS_OK if success 1024** NFC_STATUS_NO_BUFFERS if out of buffer 1025** NFC_STATUS_BUSY if busy 1026** NFC_STATUS_FAILED if other error 1027** 1028*******************************************************************************/ 1029extern tNFC_STATUS RW_I93WriteSingleBlock(uint16_t block_number, 1030 uint8_t* p_data); 1031 1032/******************************************************************************* 1033** 1034** Function RW_I93LockBlock 1035** 1036** Description This function send Lock Block command 1037** 1038** RW_I93_CMD_CMPL_EVT will be returned 1039** 1040** Returns NFC_STATUS_OK if success 1041** NFC_STATUS_NO_BUFFERS if out of buffer 1042** NFC_STATUS_BUSY if busy 1043** NFC_STATUS_FAILED if other error 1044** 1045*******************************************************************************/ 1046extern tNFC_STATUS RW_I93LockBlock(uint8_t block_number); 1047 1048/******************************************************************************* 1049** 1050** Function RW_I93ReadMultipleBlocks 1051** 1052** Description This function send Read Multiple Blocks command 1053** 1054** RW_I93_RESPONSE_EVT will be returned 1055** 1056** Returns NFC_STATUS_OK if success 1057** NFC_STATUS_NO_BUFFERS if out of buffer 1058** NFC_STATUS_BUSY if busy 1059** NFC_STATUS_FAILED if other error 1060** 1061*******************************************************************************/ 1062extern tNFC_STATUS RW_I93ReadMultipleBlocks(uint16_t first_block_number, 1063 uint16_t number_blocks); 1064 1065/******************************************************************************* 1066** 1067** Function RW_I93WriteMultipleBlocks 1068** 1069** Description This function send Write Multiple Blocks command 1070** 1071** RW_I93_CMD_CMPL_EVT will be returned 1072** 1073** Returns NFC_STATUS_OK if success 1074** NFC_STATUS_NO_BUFFERS if out of buffer 1075** NFC_STATUS_BUSY if busy 1076** NFC_STATUS_FAILED if other error 1077** 1078*******************************************************************************/ 1079extern tNFC_STATUS RW_I93WriteMultipleBlocks(uint8_t first_block_number, 1080 uint16_t number_blocks, 1081 uint8_t* p_data); 1082 1083/******************************************************************************* 1084** 1085** Function RW_I93Select 1086** 1087** Description This function send Select command 1088** 1089** UID[0]: 0xE0, MSB 1090** UID[1]: IC Mfg Code 1091** ... 1092** UID[7]: LSB 1093** 1094** RW_I93_CMD_CMPL_EVT will be returned 1095** 1096** Returns NFC_STATUS_OK if success 1097** NFC_STATUS_NO_BUFFERS if out of buffer 1098** NFC_STATUS_BUSY if busy 1099** NFC_STATUS_FAILED if other error 1100** 1101*******************************************************************************/ 1102extern tNFC_STATUS RW_I93Select(uint8_t* p_uid); 1103 1104/******************************************************************************* 1105** 1106** Function RW_I93ResetToReady 1107** 1108** Description This function send Reset To Ready command 1109** 1110** RW_I93_CMD_CMPL_EVT will be returned 1111** 1112** Returns NFC_STATUS_OK if success 1113** NFC_STATUS_NO_BUFFERS if out of buffer 1114** NFC_STATUS_BUSY if busy 1115** NFC_STATUS_FAILED if other error 1116** 1117*******************************************************************************/ 1118extern tNFC_STATUS RW_I93ResetToReady(void); 1119 1120/******************************************************************************* 1121** 1122** Function RW_I93WriteAFI 1123** 1124** Description This function send Write AFI command 1125** 1126** RW_I93_CMD_CMPL_EVT will be returned 1127** 1128** Returns NFC_STATUS_OK if success 1129** NFC_STATUS_NO_BUFFERS if out of buffer 1130** NFC_STATUS_BUSY if busy 1131** NFC_STATUS_FAILED if other error 1132** 1133*******************************************************************************/ 1134extern tNFC_STATUS RW_I93WriteAFI(uint8_t afi); 1135 1136/******************************************************************************* 1137** 1138** Function RW_I93LockAFI 1139** 1140** Description This function send Lock AFI command 1141** 1142** RW_I93_CMD_CMPL_EVT will be returned 1143** 1144** Returns NFC_STATUS_OK if success 1145** NFC_STATUS_NO_BUFFERS if out of buffer 1146** NFC_STATUS_BUSY if busy 1147** NFC_STATUS_FAILED if other error 1148** 1149*******************************************************************************/ 1150extern tNFC_STATUS RW_I93LockAFI(void); 1151 1152/******************************************************************************* 1153** 1154** Function RW_I93WriteDSFID 1155** 1156** Description This function send Write DSFID command 1157** 1158** RW_I93_CMD_CMPL_EVT will be returned 1159** 1160** Returns NFC_STATUS_OK if success 1161** NFC_STATUS_NO_BUFFERS if out of buffer 1162** NFC_STATUS_BUSY if busy 1163** NFC_STATUS_FAILED if other error 1164** 1165*******************************************************************************/ 1166extern tNFC_STATUS RW_I93WriteDSFID(uint8_t dsfid); 1167 1168/******************************************************************************* 1169** 1170** Function RW_I93LockDSFID 1171** 1172** Description This function send Lock DSFID command 1173** 1174** RW_I93_CMD_CMPL_EVT will be returned 1175** 1176** Returns NFC_STATUS_OK if success 1177** NFC_STATUS_NO_BUFFERS if out of buffer 1178** NFC_STATUS_BUSY if busy 1179** NFC_STATUS_FAILED if other error 1180** 1181*******************************************************************************/ 1182extern tNFC_STATUS RW_I93LockDSFID(void); 1183 1184/******************************************************************************* 1185** 1186** Function RW_I93GetSysInfo 1187** 1188** Description This function send Get System Information command 1189** If UID is provided then set UID[0]:MSB, ... UID[7]:LSB 1190** 1191** RW_I93_RESPONSE_EVT will be returned 1192** 1193** Returns NFC_STATUS_OK if success 1194** NFC_STATUS_NO_BUFFERS if out of buffer 1195** NFC_STATUS_BUSY if busy 1196** NFC_STATUS_FAILED if other error 1197** 1198*******************************************************************************/ 1199extern tNFC_STATUS RW_I93GetSysInfo(uint8_t* p_uid); 1200 1201/******************************************************************************* 1202** 1203** Function RW_I93GetMultiBlockSecurityStatus 1204** 1205** Description This function send Get Multiple Block Security Status 1206** command 1207** 1208** RW_I93_RESPONSE_EVT will be returned 1209** 1210** Returns NFC_STATUS_OK if success 1211** NFC_STATUS_NO_BUFFERS if out of buffer 1212** NFC_STATUS_BUSY if busy 1213** NFC_STATUS_FAILED if other error 1214** 1215*******************************************************************************/ 1216extern tNFC_STATUS RW_I93GetMultiBlockSecurityStatus( 1217 uint16_t first_block_number, uint16_t number_blocks); 1218 1219/******************************************************************************* 1220** 1221** Function RW_I93DetectNDef 1222** 1223** Description This function performs NDEF detection procedure 1224** 1225** RW_I93_NDEF_DETECT_EVT will be returned 1226** 1227** Returns NFC_STATUS_OK if success 1228** NFC_STATUS_FAILED if busy or other error 1229** 1230*******************************************************************************/ 1231extern tNFC_STATUS RW_I93DetectNDef(void); 1232 1233/******************************************************************************* 1234** 1235** Function RW_I93ReadNDef 1236** 1237** Description This function performs NDEF read procedure 1238** Note: RW_I93DetectNDef() must be called before using this 1239** 1240** The following event will be returned 1241** RW_I93_NDEF_READ_EVT for each segmented NDEF message 1242** RW_I93_NDEF_READ_CPLT_EVT for the last segment or 1243** complete NDEF 1244** RW_I93_NDEF_READ_FAIL_EVT for failure 1245** 1246** Returns NFC_STATUS_OK if success 1247** NFC_STATUS_FAILED if I93 is busy or other error 1248** 1249*******************************************************************************/ 1250extern tNFC_STATUS RW_I93ReadNDef(void); 1251 1252/******************************************************************************* 1253** 1254** Function RW_I93UpdateNDef 1255** 1256** Description This function performs NDEF update procedure 1257** Note: RW_I93DetectNDef() must be called before using this 1258** Updating data must not be removed until returning 1259** event 1260** 1261** The following event will be returned 1262** RW_I93_NDEF_UPDATE_CPLT_EVT for complete 1263** RW_I93_NDEF_UPDATE_FAIL_EVT for failure 1264** 1265** Returns NFC_STATUS_OK if success 1266** NFC_STATUS_FAILED if I93 is busy or other error 1267** 1268*******************************************************************************/ 1269extern tNFC_STATUS RW_I93UpdateNDef(uint16_t length, uint8_t* p_data); 1270 1271/******************************************************************************* 1272** 1273** Function RW_I93FormatNDef 1274** 1275** Description This function performs formatting procedure 1276** 1277** RW_I93_FORMAT_CPLT_EVT will be returned 1278** 1279** Returns NFC_STATUS_OK if success 1280** NFC_STATUS_FAILED if busy or other error 1281** 1282*******************************************************************************/ 1283extern tNFC_STATUS RW_I93FormatNDef(void); 1284 1285/******************************************************************************* 1286** 1287** Function RW_I93SetTagReadOnly 1288** 1289** Description This function performs NDEF read-only procedure 1290** Note: RW_I93DetectNDef() must be called before using this 1291** Updating data must not be removed until returning 1292** event 1293** 1294** The RW_I93_SET_TAG_RO_EVT event will be returned. 1295** 1296** Returns NFC_STATUS_OK if success 1297** NFC_STATUS_FAILED if I93 is busy or other error 1298** 1299*******************************************************************************/ 1300extern tNFC_STATUS RW_I93SetTagReadOnly(void); 1301 1302/***************************************************************************** 1303** 1304** Function RW_I93PresenceCheck 1305** 1306** Description Check if the tag is still in the field. 1307** 1308** The RW_I93_PRESENCE_CHECK_EVT w/ status is used to indicate 1309** presence or non-presence. 1310** 1311** Returns NFC_STATUS_OK, if raw data frame sent 1312** NFC_STATUS_NO_BUFFERS: unable to allocate a buffer for this 1313** operation 1314** NFC_STATUS_FAILED: other error 1315** 1316*****************************************************************************/ 1317extern tNFC_STATUS RW_I93PresenceCheck(void); 1318 1319/******************************************************************************* 1320** 1321** Function RW_SendRawFrame 1322** 1323** Description This function sends a raw frame to the peer device. 1324** 1325** Returns tNFC_STATUS 1326** 1327*******************************************************************************/ 1328extern tNFC_STATUS RW_SendRawFrame(uint8_t* p_raw_data, uint16_t data_len); 1329 1330/******************************************************************************* 1331** 1332** Function RW_SetActivatedTagType 1333** 1334** Description This function sets tag type for Reader/Writer mode. 1335** 1336** Returns tNFC_STATUS 1337** 1338*******************************************************************************/ 1339extern tNFC_STATUS RW_SetActivatedTagType(tNFC_ACTIVATE_DEVT* p_activate_params, 1340 tRW_CBACK* p_cback); 1341#endif /* RW_API_H */ 1342