NFC HF Tag Library Manual (Version 1.00)

CASIO Computer Co., Ltd. Copyright ©2012. All rights reserved. February 2012

Editorial Record Version 1.00

Change Date 2012.02

Page

Description Official version

Table of Contents

Chapter Chapter Chapter

Chapter

Editorial Record 1. Overview 2. System requirements 3. Functions 3.1 NFCHFTagOpen 3.2 NFCHFTagClose 3.3 NFCHFTagPolling 3.4 NFCHFTagStopPolling 3.5 NFCHFTagGetCardResponse 3.6 NFCHFTagRadioOff 3.7 NFCHFTagRead 3.8 NFCHFTagWrite 3.9 NFCHFTagLock 3.10 NFCHFTagReadMulti 3.11 NFCHFTagWriteAFI 3.12 NFCHFTagLockAFI 3.13 NFCHFTagWriteDSFID 3.14 NFCHFTagLockDSFID 3.15 NFCHFTagGetSystemInfo 3.16 NFCHFTagGetSecurityStatus 3.17 NFCHFTagSetEventNotification 3.18 NFCHFTagGetEventNotification 3.19 NFCHFTagSetAutoRadioOff 3.20 NFCHFTagGetAutoRadioOff 3.21 NFCHFTagSetPollingMode 3.22 NFCHFTagGetPollingMode 3.23 NFCHFTagGetCardResponseEx 4. Programming precautions 4.1 Auto stop notifications 4.2 Communicating with ISO 15693 cards 4.3 About search method 4.4 Communicating with Tag-itTM cards

No part of this document may be produced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without the express written permission of CASIO Computer Co., Ltd. in Tokyo Japan. Information in this document is subject to change without advance notice. CASIO Computer Co., Ltd. makes no representations or warranties with respect to the contents or use of this manual and specifically disclaims any express or implied warranties of merchantability or fitness for any particular purpose. © 2012 CASIO Computer Co., Ltd. All rights reserved.

2 1 2 4 7 8 9 11 12 14 15 17 19 21 23 25 27 29 31 34 36 37 38 39 40 42 43 45 45 52 53 56

1. Overview The Near Field Communication (NFC) HF Tag Library provides functions for communicating with ISO 15693 contactless smart cards. When accessing ISO 15693 card using NFC Library, your application needs to create ISO 15693 command by itself, and needs to transmit it to ISO 15693 card. NFC HF Tag Library creates ISO 15693 command instead of your application, and supports access to ISO 15693 card. Therefore, investigation of ISO 15693 command and programming of ISO 15693 command will be needed, and business application developer will require the load of development. NFC HF Tag Library is offered in order to reduce this development load. Since NFC HF Tag Library creates ISO 15693 command, business application can access ISO 15693 card, without creating the ISO 15693 command. When the smart card(s) in question exclusively use the ISO 15693 vicinity card standard, applications can be developed more efficiently with the NFC HF Tag Library rather than the NFC Library. Using the NFC HF Tag Library enables enhanced application source code compatibility without the need to be mindful of the handy terminal model. Regardless of the model of handy terminal being used, the NFC HF Tag Library provides all functions and behaviors of a 'virtual machine' from the perspective of the application. Each of the NFC HF Tag Library functions returns an 'unsupported error' when the subject device's features cannot be controlled in response to a request from the application. Additionally, configuring a parameter that is not available due to differences in the equipped device's features will result in a 'parameter error' being returned. Note: The NFC HF Tag Library is designed to enhance the compatibility of application source codes and is not intended to ensure compatibility of equipped device features. Please therefore be sure to identify unsupported errors and parameter errors and notify the operator that the feature is not supported or, alternatively, invalidate the process altogether.

1

2. System requirements The NFC HF Tag Library's system requirements are as follows.

Compatible models • DT-X8 • IT-9000

Operating systems • Microsoft® WindowsCE 6.0 • Microsoft® Windows Mobile® 6.5

IDE & programming language Integrated Development Environment (IDE)

Visual C++

Microsoft Visual Studio 2005 + SP1 Microsoft Visual Studio 2008 + SP1

Y Y

Visual Basic, Visual C# Y Y

Provided files File

Visual C++

NFCHFTagLib.h NFCHFTagLib.lib NFCHFTagLib.dll NFCHFTagLibNet.dll

Y Y Y -

Visual Basic, Visual C# Y Y

How to Use When using Visual C++ • Include NFCHFTagLib.h and NFCLib.h within the program source and set NFCHFTagLib.lib as the linker dependent file. • NFCHFTagLib.dll is stored in the handy terminal.

Visual Basic/ Visual C# • Add NFCHFTagLibNet.dll to the project references. • NFCHFTagLib.dll is stored in the handy terminal. • Copy NFCHFTagLibNet.dll to the same folder as the run module.

2

Name space & class The following classes are provided in the NFCHFTagLibNet.dll Class Library as a reference for functions and constants. Name Space CaLib

Class NFCHFTagLibNet.Api NFCHFTagLibNet.Def

Description Function reference class Constant reference class

For details on the class definitions, set NFCHFTagLibNet.dll as the reference setting using Microsoft Visual Studio and confirm with the object browser.

3

3. Functions

NFCHFTagOpen NFCHFTagClose NFCHFTagPolling NFCHFTagStopPolling NFCHFTagGetCardResponse NFCHFTagRadioOff NFCHFTagRead NFCHFTagWrite NFCHFTagLock NFCHFTagReadMulti NFCHFTagWriteAFI NFCHFTagLockAFI NFCHFTagWriteDSFID NFCHFTagLockDSFID NFCHFTagGetSystemInfo NFCHFTagGetSecurityStatus NFCHFTagSetEventNotification NFCHFTagGetEventNotification NFCHFTagSetAutoRadioOff NFCHFTagGetAutoRadioOff NFCHFTagSetPollingMode NFCHFTagGetPollingMode NFCHFTagGetCardResponseEx

Y -

Feature

Communication open setting Communication closed setting Searches for ISO 15693 cards within communication range and obtains their UID Terminates search for ISO 15693 cards within communication range Acquires detailed information of activated ISO 15693 cards Terminates radio wave transmission Reads assigned address data (1 block) Writes data to an assigned address (1 block) Disables writing to an assigned area (1 block) Writes data from an assigned address (multiple blocks) Writes card AFI values Disables writing of card AFI values Writes card DSFID values Disables writing of card DSFID values Ontains card system information Obtains card security status Configures timing notification method for radio wave automatic stop (auto stop) Obtains timing notification method for radio wave auto stop Configures time until radio wave auto stop Obtains time until radio wave auto stop Sets up IC card search method. Retrieves IC card search method. Retrieves detailed information of activated smart card.

Function supported Function not supported

4

IT-9000

Function Name

DT-X8

The following functions are provided by the NFC HF Tag Library.

Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y

Y Y Y Y Y

Y Y Y Y Y Y Y

Y Y Y Y Y Y Y

Y Y Y Y Y Y Y

Y Y Y Y Y

NFCHFTagWriteDSFID NFCHFTagLockDSFID NFCHFTagGetSystemInfo NFCHFTagGetSecurityStatus

Y X

Y Y

Y Y

Y Y

Y

Y

Y

Y

Y Y

Y

Y

Y Y

Y

Y

Y

Y

Y

Y

Y

Y

Y

Y

Y

Y

Y Y

Y

Y

-

-

Y

-

-

Tag-it HF-I Standard

NFCHFTagLockAFI

Y Y

Tag-it HF-I Pro

NFCHFTagWriteAFI

Y Y

Tag-it HF-I Plus

NFCHFTagReadMulti

my-d Light

NFCHFTagLock

my-d V10 Plain

NFCHFTagWrite

ICODE SLI-S

NFCHFTagRead

ICODE SLI-L

Function

ICODE SLI

Support for the following HF Tag Library APIs varies according to the ISO 15693 tag type. The following table shows which functions are supported by each tag type.

Y Y (note1) Y (note1) Y Y (note1) x (note2) Y (note1) x (note2) Y Y

Y Y (note1) Y (note1) -

Y Y (note1) Y (note1) -

-

-

-

-

-

-

-

-

supported not supported according to card specification not supported according to NFC controller specification

Note: 1. When using the Tag-itTM series, you must perform the command retry process in the application. Refer to 'Communicating with Tag-itTM cards' for details. 2. Not supported for Tag-itTM series according to NFC controller specification

5

Function call procedure 1. Upon initiating the application, execute the NFCHFTagOpen function to turn on the NFC device. See note. 2. Upon initiating communication processing, execute the NFCHFTagPolling function to search/activate ISO 15693 cards within the communicable range. 3. When you have successfully activated the ISO 15693 card and require its detailed information, execute the NFCHFTagGetCardResponse function to obtain the card response information (optional). 4. Communicate with the ISO 15693 card. See 'Communicate with card'. 5. When communication with the card is complete, execute the NFCHFTagRadioOff to terminate radio wave output. 6. When closing the application, execute the NFCHFTagClose function to turn off the NFC device.

NFCHFTagPolling

Response received from card?

No

Yes NFCHFTagGet CardResponse

Communicate with card

NFCHFTagOpen

NFCHFTagRadioOff

At application launch

When communicating with ISO 15693 card

NFCHFTagClose

At application close

Note: Since NFC device goes to standby mode while not communicating with ISO 15693 card, electric power is hardly used.

Communicate with card 1. Execute the NFCHFTagRead or NFCHFTagWrite function.

NFCHFTagRead NFCHFTagWrite

End processing?

No

Yes

6

3.1 NFCHFTagOpen This function authorizes (opens) NFC driver communication and turns on the NFC device power. This open state remains enabled until the NFCHFTagClose function is executed. In the open state, executing the NFCHFTagPolling function initiates communication. [C++] int NFCHFTagOpen( HWND hWnd ) [Visual Basic] Public Shared Function NFCHFTagOpen( ByVal hWnd As IntPtr _ ) As Int32 [C#] public static Int32 NFCHFTagOpen( IntPtr hWnd )

Parameters hWnd Sets the application window handle. A message is sent to the assigned window handle when the radio wave auto stop is enabled and the event notification method is set to 'MESSAGE'. When 'NULL' is assigned the message is sent to 'BROADCAST'. Return values The following values are returned. NFC_OK NFC_PON

: Normal termination : Opened (see note) : NFC driver error NFC_NOT_DEVICE Does not occur in the Device Emulator NFC_ERROR_INVALID_ACCESS : Device exclusion error : Module not responding error NFC_ERROR_MODULE Does not occur in the Device Emulator Note: When this function is called up twice or more in the same process, it returns a normal termination.

7

3.2 NFCHFTagClose This function prohibits (closes) NFC driver communication and turns off the NFC device's power. [C++] int NFCHFTagClose() [Visual Basic] Public Shared Function NFCHFTagClose() As Int32 [C#] public static Int32 NFCHFTagClose()

Parameters None Return Values The following values are returned. NFC_OK

: Normal termination : NFC driver error Does not occur in the Device Emulator

NFC_NOT_DEVICE

8

3.3 NFCHFTagPolling This function searches for ISO 15693 cards within the communicable range. When an ISO 15693 smart card is detected, the card or its tag is activated and data communication is enabled. The function continues to search for ISO 15693 smart cards within the communication range until it detects one, the designated timeout elapses, or the designated callback function returns a value of 'FALSE'. In the Device Emulator, only a parameter check is performed. [C++] int NFCHFTagePolling( DWORD dwTimeout, BOOL (*fpCallBack)(void), BYTE byAFI, DWORD dwParam, DWORD dwReserved ) [Visual Basic] Public Shared Function NFCHFTagPolling( _ ByVal dwTimeout As Int32, _ ByVal fpCallBack As IntPtr, _ ByVal byAFI As Byte, _ ByVal dwParam As Int32, _ ByVal dwReserved As Int32 _ ) As Int32 [C#] public static Int32 NFCHFTagPolling( Int32 dwTimeout, IntPtr fpCallBack, Byte byAFI, Int32 dwParam, Int32 dwReserved )

Parameters dwTimeout The ISO 15693 card activation timeout can be configured in the range of 100 to 60,000 (milliseconds). When a value of '0' is assigned, the function searches for ISO 15693 cards without timing out.

9

fpCallBack Sets the callback function to decide whether or not to continue searching for ISO 15693 cards. When the callback function returns 'TRUE' the search process is continued, and when it returns 'FALSE' the process is terminated. Assigning a NULL value continues the search process indefinitely. byAFI Sets the AFI of the ISO 15693 cards to be authorized for activation using the NFCPollingCard function. Assigning a value of 0x00 authorizes activation of all ISO 15693 cards (range: 0x00 – 0xFF). dwParam Sets the operating mode when searching for smart cards. When not using the following feature, assign a value of 0. : Enables reduced power consumption by searching for smart cards using a longer radio wave transmission distance. Note, however, that extending the NFC_PL_SAVE transmission distance diminishes the smart detection response. Use this function for extended continuous smart card waiting. dwReserved This parameter is not used in the current version so assign a value of '0'.

Return values The following values are returned. NFC_OK NFC_NOT_DEVICE NFC_POF NFC_PRM NFC_ERROR_TIMEOUT NFC_ERROR_CALLBACK NFC_ERROR_MODULE NFC_ERROR_STOP NFC_ERROR_DUPLICATION

: Normal termination : NFC driver error Does not occur in the Device Emulator : Unopened error : Parameter error : Timeout error : Callback function error Does not occur in the Device Emulator : Module not responding error Does not occur in the Device Emulator : Suspend error caused by the stop function Does not occur in the Device Emulator : Duplicate smart card activation

10

3.4 NFCHFTagStopPolling This function terminates the search for smart cards within the communicable range. Executing this function enables the search to be terminated when NFCHFTagPolling was executed without assigning the callback function. [C++] int NFCHFTagStopPolling() [Visual Basic] Public Shared Function NFCHFTagStopPolling() As Int32 [C#] public static Int32 NFCHFTagStopPolling()

Parameters None Return Values The following values are returned. NFC_OK : Normal termination : NFC driver error NFC_NOT_DEVICE Does not occur in the Device Emulator NFC_POF : Unopened error

11

3.5 NFCHFTagGetCardResponse Executing this function after NFCHFTagPolling has succeeded obtains the response information from the activated ISO 15693 card. The response information is stored in the driver upon successful activation of the ISO 15693 card and this function obtains this information from the driver. In the Device Emulator, only a parameter check is performed. [C++] int NFCHFTagGetCardResponse( BYTE *pDSFID, BYTE *pUid, DWORD dwReserved ) [Visual Basic] Public Shared Function NFCHFTagGetCardResponse( _ ByVal pDSFID As Byte(), _ ByVal pUid As Byte(), _ ByVal dwReserved As Int32 _ ) As Int32 [C#] public static Int32 NFCHFTagGetCardResponse( Byte[] pDSFID, Byte[] pUid, Int32 dwReserved )

Parameters pDSFID If the function succeeds, the card's DSFID is stored. Assign a 1-byte area pointer. pUid Obtains the UID from the successfully activated ISO 15693 card. Assign an 8-byte area pointer. dwReserved This parameter is not used in the current version so specify a value of '0'.

12

Return Values The following values are returned. NFC_OK NFC_NOT_DEVICE NFC_POF NFC_PRM

: Normal termination : NFC driver error Does not occur in the Device Emulator : Unopened error : Parameter error

13

3.6 NFCHFTagRadioOff This function terminates the NFC module's radio wave transmission. [C++] int NFCHFTagRadioOff() [Visual Basic] Public Shared Function NFCHFTagRadioOff() As Int32 [C#] public static Int32 NFCHFTagRadioOff()

Parameters None Return Values The following values are returned. NFC_OK : Normal termination : NFC driver error NFC_NOT_DEVICE Does not occur in the Device Emulator NFC_POF : Unopened error : Module not responding error NFC_ERROR_MODULE Does not occur in the Device Emulator

14

3.7 NFCHFTagRead This function reads the assigned block data of the activated ISO 15693 card or tag. In the Device Emulator, only a parameter check is performed. [C++] int NFCHFTagRead( DWORD dwBlockAddress, BYTE *pData, DWORD *pdwActualSize, DWORD dwTargetNo, DWORD dwOption ) [Visual Basic] Public Shared Function NFCHFTagRead( _ ByVal dwBlockAddress As Int32, _ ByVal pData As Byte(), _ ByVal pdwActualSize As Int32(), _ ByVal dwTargetNo As Int32, _ ByVal dwOption As Int32 _ ) As Int32 [C#] public static Int32 NFCHFTagRead( Int32 dwBlockAddress, Byte[] pData, Int32[] pdwActualSize, Int32 dwTargetNo, Int32 dwOption )

Parameters dwBlockAddress Assigns the top block number (range: 0 – ) in order to designate the read position. pData If the function succeeds, the read block data is stored. The size of the stored data is equivalent to the target smart card's single block size. Smart cards typically contain 4-byte data blocks so assign an area of 4 bytes. In the dwOption argument parameter, specify a 5-byte data area when setting NFC_HFTAG_SECURITY. pdwActualSize If the function succeeds, the read data size is stored.

15

dwTargetNo Assign the card number of the smart card you want to communicate with. In most cases, assign a value of '0'. Alternatively, if multiple smart cards have been successfully activated using the NFCPollingCard function, assign a value of 1 or more when communicating with the second or subsequent cards. Refer to the NFCHFTagGetCardResponseEx function's description for details. dwOption Designate whether or not to obtain the block security status. : Disables acquisition of assigned block security NFC_HFTAG_DEFAULT status : Enables acquisition of assigned block security NFC_HFTAG_SECURITY status When assigning NFC_HFTAG_SECURITY, the format of data stored in pbyData when the function succeeds is as follows. 1byte Status

4bytes ブロックデータ Block data

Status is indicated by the following values. 0x00 : Unlocked (write enabled) 0x01 : Locked (write inhibited) Return Values The following values are returned. NFC_OK

: Normal termination : NFC driver error NFC_NOT_DEVICE Does not occur in the Device Emulator NFC_POF : Unopened error NFC_PRM : Parameter error NFC_ERROR_TIMEOUT : Timeout error : Card inactivation error NFC_NOT_ACTIVATION Does not occur in the Device Emulator : Module not responding error NFC_ERROR_MODULE Does not occur in the Device Emulator : Terminal OFF error NFC_ERROR_SUSPEND Does not occur in the Device Emulator : Radio wave auto stop error NFC_ERROR_AUTOOFF Does not occur in the Device Emulator NFC_ERROR_INVALID_ACCESS : Run error during card polling

16

3.8 NFCHFTagWrite This function writes the assigned block number data of the activated ISO 15693 card or tag. In the Device Emulator, only a parameter check is performed. [C++] int NFCHFTagWrite( DWORD dwBlockAddress, BYTE *pData, DWORD dwWriteSize, DWORD dwTargetNo, DWORD dwReserved ) [Visual Basic] Public Shared Function NFCHFTagWrite( _ ByVal dwBlockAddress As Int32, _ ByVal pData As Byte(), _ ByVal dwWriteSize As Int32, _ ByVal dwTargetNo As Int32, _ ByVal dwReserved As Int32 _ ) As Int32 [C#] public static Int32 NFCHFTagWrite( Int32 dwBlockAddress, Byte[] pData, Int32 dwWriteSize, Int32 dwTargetNo, Int32 dwReserved )

Parameters dwBlockAddress To assign the read position, specify the top block number (range: 0 – ). pData Assign the block data to be written. You must specify the number of bytes of a single data block.* The size of a single block differs according to the smart card's specification but most smart cards contain 4-byte data blocks. dwWriteSize Assign the size of data to be written.

17

dwTargetNo Assign the card number of the smart card you want to communicate with. In most cases you should assign a value of '0'. Alternatively, if multiple smart cards have been successfully activated using the NFCPollingCard function, assign a value of 1 or more when communicating with the second or subsequent cards. Refer to the NFCHFTagGetCardResponseEx function description for details. dwReserved This parameter is not used in the current version so specify a value of '0'. Return Values The following values are returned. NFC_OK NFC_NOT_DEVICE NFC_POF NFC_PRM NFC_ERROR_TIMEOUT NFC_NOT_ACTIVATION NFC_ERROR_MODULE NFC_ERROR_SUSPEND NFC_ERROR_AUTOOFF NFC_ERROR_INVALID_ACCESS

: Normal termination : NFC driver error Does not occur in the Device Emulator : Unopened error : Parameter error : Timeout Error Does not occur in the Device Emulator : Card inactivation error Does not occur in the Device Emulator : Module not responding error Does not occur in the Device Emulator : Terminal OFF error Does not occur in the Device Emulator : Radio wave auto stop error Does not occur in the Device Emulator : Run error during card polling

18

3.9 NFCHFTagLock This function disables writing of the data area in the activated ISO 15693 card or tag's assigned block number. In the Device Emulator, only a parameter check is performed. [C++] int NFCHFTagLock( DWORD dwBlockAddress, DWORD dwTargetNo, DWORD dwReserved ) [Visual Basic] Public Shared Function NFCHFTagLock ( _ ByVal dwBlockAddress As Int32, _ ByVal dwTargetNo As Int32, _ ByVal dwReserved As Int32 _ ) As Int32 [C#] public static Int32 NFCHFTagLock ( Int32 dwBlockAddress, Int32 dwTargetNo, Int32 dwReserved )

Parameters dwBlockAddress Set the block number for which writing is to be disabled (range: 0 – ). dwTargetNo Assign the card number of the smart card you want to communicate with. In most cases you should assign a value of '0'. Alternatively, if multiple smart cards have been successfully activated using the NFCPollingCard function, assign a value of 1 or more when communicating with the second or subsequent cards. Refer to the NFCHFTagGetCardResponseEx function description for details. dwReserved This parameter is not used in the current version so specify a value of '0'. Return Values The following values are returned. NFC_OK

: Normal termination

19

NFC_NOT_DEVICE NFC_POF NFC_PRM NFC_ERROR_TIMEOUT NFC_NOT_ACTIVATION NFC_ERROR_MODULE NFC_ERROR_SUSPEND NFC_ERROR_AUTOOFF NFC_ERROR_INVALID_ACCESS

: NFC driver error Does not occur in the Device Emulator : Unopened error : Parameter error : Timeout Error Does not occur in the Device Emulator : Card inactivation error Does not occur in the Device Emulator : Module not responding error Does not occur in the Device Emulator : Terminal OFF error Does not occur in the Device Emulator : Radio wave auto stop error Does not occur in the Device Emulator : Run error during card polling

20

3.10 NFCHFTagReadMulti This function reads all consecutive block data of the activated ISO 15693 card or tag starting from the designated block number. In the Device Emulator, only a parameter check is performed. [C++] int NFCHFTagReadMulti( DWORD dwBlockAddress, DWORD dwBlockNumber, BYTE *pData, DWORD dwActualSize, DWORD dwTargetNo, DWORD dwReserved ) [Visual Basic] Public Shared Function NFCHFTagReadMulti( _ ByVal dwBlockAddress As Int32, _ ByVal dwBlockNumber As Int32, _ ByVal pData As Byte(), _ ByVal dwActualSize As Int32, _ ByVal dwTargetNo As Int32, _ ByVal dwReserved As Int32 _ ) As Int32 [C#] public static Int32 NFCHFTagReadMulti( Int32 dwBlockAddress, Int32 dwBlockNumber, Byte[] pData, Int32 dwActualSize, Int32 dwTargetNo, Int32 dwReserved )

Parameters dwBlockAddress To assign the read position, specify the top block number (range: 0 – ). dwBlockNumber Set the number of blocks to be read (range: 1 – 27).

21

pData If the function succeeds, the read block data is stored. The size of stored data is 4 bytes (single block size) × dwBlockNumber. Furthermore, the maximum size of stored data is NFC_MAXSIZE_DATA.*1 dwActualSize If the function succeeds, the size of read data is stored. dwTargetNo Assign the card number of the smart card you want to communicate with. In most cases you should assign a value of '0'. Alternatively, if multiple smart cards have been successfully activated using the NFCPollingCard function, assign a value of 1 or more when communicating with the second or subsequent cards. Refer to the NFCHFTagGetCardResponseEx function description for details. dwReserved This parameter is not used in the current version so specify a value of '0'. Return values The following values are returned. NFC_OK

: Normal termination : NFC driver error NFC_NOT_DEVICE Does not occur in the Device Emulator NFC_POF : Unopened error NFC_PRM : Parameter error : Timeout Error NFC_ERROR_TIMEOUT Does not occur in the Device Emulator : Card inactivation error NFC_NOT_ACTIVATION Does not occur in the Device Emulator : Module not responding error NFC_ERROR_MODULE Does not occur in the Device Emulator : Terminal OFF error NFC_ERROR_SUSPEND Does not occur in the Device Emulator : Radio wave auto stop error NFC_ERROR_AUTOOFF Does not occur in the Device Emulator NFC_ERROR_INVALID_ACCESS : Run error during card polling

22

3.11 NFCHFTagWriteAFI This function writes the AFI of the activated ISO 15693 card or tag. In the Device Emulator, only a parameter check is performed. [C++] int NFCHFTagWriteAFI( BYTE byAFI, DWORD dwTargetNo, DWORD dwReserved ) [Visual Basic] Public Shared Function NFCHFTagWriteAFI( _ ByVal byAFI As Byte, _ ByVal dwTargetNo As Int32, _ ByVal dwReserved As Int32 _ ) As Int32 [C#] public static Int32 NFCHFTagWriteAFI( Byte byAFI, Int32 dwTargetNo, Int32 dwReserved )

Parameters byAFI Set the ISO 15693 card or tag's AFI to be written. AFI Coding AFI most AFI least significant significant Card application fields 4 bytes 4 bytes '0' '0' All fields X '0' Field X X Y Yth sub-field of field X '0' Y Only Yth sub-field '1' '0', Y Transport '2' '0', Y Financial '3' '0', Y Identification '4' '0', Y Telecommunication '5' '0', Y Medical '6' '0', Y Multimedia '7' '0', Y Gaming '8' '0', Y Data storage '9' '0', Y Item management 'A' '0', Y Express parcels 'B' '0', Y Postal services 'C' '0', Y Airline baggage

23

Example/Note No applicative preselection Wide applicative preselection

Mass transit, bus, airline Banking Access control Public telephony, GSM Internet services Portable files

'D' 'E' 'F'

'0', Y '0', Y '0', Y

RFU RFU RFU

Note: X = '1' to 'F', Y = '1' to 'F' Smart card support for AFI is optional. dwTargetNo Assign the card number of the smart card you want to communicate with. In most cases you should assign a value of '0'. Alternatively, if multiple smart cards have been successfully activated using the NFCPollingCard function, assign a value of 1 or more when communicating with the second or subsequent cards. Refer to the NFCHFTagGetCardResponseEx function description for details. dwReserved This parameter is not used in the current version so specify a value of '0'. Return values The following values are returned. NFC_OK

: Normal termination : NFC driver error NFC_NOT_DEVICE Does not occur in the Device Emulator NFC_POF : Unopened error NFC_PRM : Parameter error : Timeout Error NFC_ERROR_TIMEOUT Does not occur in the Device Emulator : Card inactivation error NFC_NOT_ACTIVATION Does not occur in the Device Emulator : Module not responding error NFC_ERROR_MODULE Does not occur in the Device Emulator : Terminal OFF error NFC_ERROR_SUSPEND Does not occur in the Device Emulator : Radio wave auto stop error NFC_ERROR_AUTOOFF Does not occur in the Device Emulator NFC_ERROR_INVALID_ACCESS : Run error during card polling

24

3.12 NFCHFTagLockAFI This function disables writing of the activated ISO 15693 card or tag's AFI. In the Device Emulator, only a parameter check is performed. [C++] int NFCHFTagLockAFI( DWORD dwTargetNo, DWORD dwReserved ) [Visual Basic] Public Shared Function NFCHFTagLockAFI( _ ByVal dwTargetNo As Int32, _ ByVal dwReserved As Int32 _ ) As Int32 [C#] public static Int32 NFCHFTagLockAFI( Int32 dwTargetNo, Int32 dwReserved )

Parameters dwTargetNo Assign the card number of the smart card you want to communicate with. In most cases you should set a value of '0'. Alternatively, if multiple smart cards have been successfully activated using the NFCPollingCard function, assign a value of 1 or more when communicating with the second or subsequent cards. Refer to the NFCHFTagGetCardResponseEx function description for details. dwReserved This parameter is not used in the current version so specify a value of '0'. Return values The following values are returned. NFC_OK NFC_NOT_DEVICE NFC_POF NFC_PRM NFC_ERROR_TIMEOUT NFC_NOT_ACTIVATION NFC_ERROR_MODULE

: Normal termination : NFC driver error Does not occur in the Device Emulator : Unopened error : Parameter error : Timeout Error Does not occur in the Device Emulator : Card inactivation error Does not occur in the Device Emulator : Module not responding error Does not occur in the Device Emulator

25

: Terminal OFF error Does not occur in the Device Emulator : Radio wave auto stop error NFC_ERROR_AUTOOFF Does not occur in the Device Emulator NFC_ERROR_INVALID_ACCESS : Run error during card polling

NFC_ERROR_SUSPEND

26

3.13 NFCHFTagWriteDSFID This function writes the assigned DSFID of the activated ISO 15693 card or tag. In the Device Emulator, only a parameter check is performed. [C++] int NFCHFTagWriteDSFID( BYTE byDSFID, DWORD dwTargetNo, DWORD dwReserved ) [Visual Basic] Public Shared Function NFCHFTagWriteDSFID( _ ByVal byDSFID As Byte, _ ByVal dwTargetNo As Int32, _ ByVal dwReserved As Int32 _ ) As Int32 [C#] public static Int32 NFCHFTagWriteDSFID( Byte byDSFID, Int32 dwTargetNo, Int32 dwReserved )

Parameters byDSFID Set the ISO 15693 card or tag's DSFID to be written. Refer to ISO 15961 for details on DSFID. dwTargetNo Assign the card number of the smart card you want to communicate with. In most cases you should set a value of '0'. Alternatively, if multiple smart cards have been successfully activated using the NFCPollingCard function, assign a value of 1 or more when communicating with the second or subsequent cards. Refer to the NFCHFTagGetCardResponseEx function description for details. dwReserved This parameter is not used in the current version so specify a value of '0'. Return values The following values are returned. NFC_OK

: Normal termination

27

: NFC driver error Does not occur in the Device Emulator NFC_POF : Unopened error NFC_PRM : Parameter error : Timeout Error NFC_ERROR_TIMEOUT Does not occur in the Device Emulator : Card inactivation error NFC_NOT_ACTIVATION Does not occur in the Device Emulator : Module not responding error NFC_ERROR_MODULE Does not occur in the Device Emulator : Terminal OFF error NFC_ERROR_SUSPEND Does not occur in the Device Emulator : Radio wave auto stop error NFC_ERROR_AUTOOFF Does not occur in the Device Emulator NFC_ERROR_INVALID_ACCESS : Run error during card polling

NFC_NOT_DEVICE

28

3.14 NFCHFTagLockDSFID This function disables writing of the activated ISO 15693 card or tag's DSFID. In the Device Emulator, only a parameter check is performed. [C++] int NFCHFTagLockDSFID( DWORD dwTargetNo, DWORD dwReserved ) [Visual Basic] Public Shared Function NFCHFTagLockDSFID( _ ByVal dwTargetNo As Int32, _ ByVal dwReserved As Int32 _ ) As Int32 [C#] public static Int32 NFCHFTagLockDSFID( Int32 dwTargetNo, Int32 dwReserved )

Parameters dwTargetNo Assign the card number of the smart card you want to communicate with. In most cases you should set a value of '0'. Alternatively, if multiple smart cards have been successfully activated using the NFCPollingCard function, assign a value of 1 or more when communicating with the second or subsequent cards. Refer to the NFCHFTagGetCardResponseEx function description for details. dwReserved This parameter is not used in the current version so specify a value of '0'. Return values The following values are returned. NFC_OK NFC_NOT_DEVICE NFC_POF NFC_PRM NFC_ERROR_TIMEOUT NFC_NOT_ACTIVATION NFC_ERROR_MODULE

: Normal termination : NFC driver error Does not occur in the Device Emulator : Unopened error : Parameter error : Timeout Error Does not occur in the Device Emulator : Card inactivation error Does not occur in the Device Emulator : Module not responding error Does not occur in the Device Emulator

29

: Terminal OFF error Does not occur in the Device Emulator : Radio wave auto stop error NFC_ERROR_AUTOOFF Does not occur in the Device Emulator NFC_ERROR_INVALID_ACCESS : Run error during card polling

NFC_ERROR_SUSPEND

30

3.15 NFCHFTagGetSystemInfo This function obtains card system information of the activated ISO 15693 card or tag. In the Device Emulator, only a parameter check is performed. [C++] int NFCHFTagGetSystemInfo( BYTE *pInfo, BYTE *pUID, BYTE *pDSFID, BYTE *pAFI, BYTE *pMemSize, BYTE *pICRef, DWORD dwTargetNo, DWORD dwReserved ) [Visual Basic] Public Shared Function ByVal pInfo ByVal pUID ByVal pDSFID ByVal pAFI ByVal pMemSize ByVal pICRef ByVal dwTargetNo ByVal dwReserved ) As Int32

NFCHFTagGetSystemInfo( _ As Byte(), _ As Byte(), _ As Byte(), _ As Byte(), _ As Byte(), _ As Byte(), _ As Int32 _ As Int32 _

[C#] public static Int32 NFCHFTagGetSystemInfo( Byte[] pInfo, Byte[] pUID, Byte[] pDSFID, Byte[] pAFI, Byte[] pMemSize, Byte[] pICRef, Int32 dwTargetNo, Int32 dwReserved )

Parameters pInfo If the function succeeds, the card's information flag is stored. Assign a 1-byte area pointer. • Information flag definitions Bit Flag name Value Description 0 DSFID 0 DSFID is not supported/not present

31

1

AFI

2

Memory size

3

IC reference

4 5 6 7

RFU RFU RFU RFU

1 0 1 0 1 0 1 0 0 0 0

DSFID is supported/is present AFI is not supported/not present AFI is supported/is present Information on memory size is not supported/not present Information on memory size is supported/is present Information on IC reference is not supported/not present Information on IC reference is supported/is present Future extension reserve Future extension reserve Future extension reserve Future extension reserve

pUid If the function succeeds, the card's UID is stored. Assign a 8-byte area pointer. pDSFID If the function succeeds, the card's DSFID is stored. Assign a 1-byte area pointer. pAFI If the function succeeds, the card's AFI is stored. Assign a 1-byte area pointer. pMemSize If the function succeeds, the card's DSFID is stored. Assign a 2-byte area pointer. • Memory size information definitions MSB 16 14 13 9 RFU Block size (no. of bytes of each block)

LSB 8 No. of user area blocks

ICRef If the function succeeds, the card's IC reference is stored. Assign a 1-byte area pointer. dwTargetNo Assign the card number of the smart card you want to communicate with. In most cases you should set a value of '0'. Alternatively, if multiple smart cards have been successfully activated using the NFCPollingCard function, assign a value of 1 or more when communicating with the second or subsequent cards. Refer to the NFCHFTagGetCardResponseEx function description for details. dwReserved This parameter is not used in the current version so specify a value of '0'.

32

1

Return values The following values are returned. NFC_OK

: Normal termination : NFC driver error NFC_NOT_DEVICE Does not occur in the Device Emulator NFC_POF : Unopened error NFC_PRM : Parameter error : Timeout Error NFC_ERROR_TIMEOUT Does not occur in the Device Emulator : Card inactivation error NFC_NOT_ACTIVATION Does not occur in the Device Emulator : Module not responding error NFC_ERROR_MODULE Does not occur in the Device Emulator : Terminal OFF error NFC_ERROR_SUSPEND Does not occur in the Device Emulator : Radio wave auto stop error NFC_ERROR_AUTOOFF Does not occur in the Device Emulator NFC_ERROR_INVALID_ACCESS : Run error during card polling

33

3.16 NFCHFTagGetSecurityStatus This function obtains security information for the activated ISO 15693 card or tag corresponding to the assigned block number range. In the Device Emulator, only a parameter check is performed. [C++] int NFCHFTagGetSecurityStatus( DWORD dwBlockAddress, DWORD dwBlockNumber, BYTE *pStatus, DWORD *pdwActualSize, DWORD dwTargetNo, DWORD dwReserved ) [Visual Basic] Public Shared Function NFCHFTagGetSecurityStatus( _ ByVal dwBlockAddress As Int32, _ ByVal dwBlockNumber As Int32, _ ByVal pStatus As Byte(), _ ByVal pdwActualSize As Int32(), _ ByVal dwTargetNo As Int32, _ ByVal dwReserved As Int32 _ ) As Int32 [C#] public static Int32 NFCHFTagGetSecurityStatus( Int32 dwBlockAddress, Int32 dwBlockNumber, Byte[] pStatus, Int32[] pdwActualSize, Int32 dwTargetNo, Int32 dwReserved )

Parameters dwBlockAddress To set the target block position, specify the top block number (range: 0 – ). dwBlockNumber To set the target block range, specify the number of blocks (range: 1 – 256). pStatus If the function succeeds, the card's security information is stored. Set the area pointer for the value specified using dwBlockNumber.

34

For example, if you selected a value of 4 in dwBlockNumber, set a 4-byte area pointer. pdwActualSize If the function succeeds, the size of security information obtained from the card is stored. dwTargetNo Assign the card number of the smart card you want to communicate with. In most cases you should set a value of '0'. Alternatively, if multiple smart cards have been successfully activated using the NFCPollingCard function, assign a value of 1 or more when communicating with the second or subsequent cards. Refer to the NFCHFTagGetCardResponseEx function description for details. dwReserved This parameter is not used in the current version so specify a value of '0'. Return values The following values are returned. NFC_OK

: Normal termination : NFC driver error NFC_NOT_DEVICE Does not occur in the Device Emulator NFC_POF : Unopened error NFC_PRM : Parameter error : Timeout Error NFC_ERROR_TIMEOUT Does not occur in the Device Emulator : Card inactivation error NFC_NOT_ACTIVATION Does not occur in the Device Emulator : Module not responding error NFC_ERROR_MODULE Does not occur in the Device Emulator : Terminal OFF error NFC_ERROR_SUSPEND Does not occur in the Device Emulator : Radio wave auto stop error NFC_ERROR_AUTOOFF Does not occur in the Device Emulator NFC_ERROR_INVALID_ACCESS : Run error during card polling

35

3.17 NFCHFTagSetEventNotification This function configures the timing notification method for radio wave auto stop. • Notification window Sent to the window handle assigning the window message 'WM_NFC_AUTORADIOOFF ( WM_USER + 0x580 )'. • Event notification The event issued when the radio wave is automatically stopped is 'NFCEventAutoRadioOff'. In Windows CE, names are in Unicode so they are assigned as text ('NFCEventAutoRadioOff') in the program. [C++] int NFCHFTagSetEventNotification( DWORD dwMode ) [Visual Basic] Public Shared Function NFCHFTagSetEventNotification( ByVal dwMode As Int32 _ ) As Int32 [C#] public static Int32 NFCHFTagSetEventNotification( Int32 dwMode )

Parameters dwMode Sets the timing notification method for radio wave auto stop. NFC_DISABLE : Notification disabled (default) NFC_MESSAGE : Window message notification NFC_EVENT : Event notification Return values The following values are returned. NFC_OK

: Normal termination : NFC driver error Does not occur in the Device Emulator : Unopened error : Parameter error : Run error during card polling

NFC_NOT_DEVICE NFC_POF NFC_PRM NFC_ERROR_INVALID_ACCESS

36

3.18 NFCHFTagGetEventNotification This function obtains the timing notification method for radio wave auto stop. [C++] int NFCHFTagGetEventNotification( DWORD *pMode ) [Visual Basic] Public Shared Function NFCHFTagGetEventNotification( ByRef pMode As Int32 _ ) As Int32 [C#] public static Int32 NFCHFTagGetEventNotification( ref Int32 pMode )

Parameters pMode Obtains the timing notification method for radio wave auto stop. Refer to the NFCHFTagSetEventNotification function for details on the obtained values. Return values The following values are returned. NFC_OK

: Normal termination : NFC driver error Does not occur in the Device Emulator : Unopened error : Parameter error

NFC_NOT_DEVICE NFC_POF NFC_PRM

37

3.19 NFCHFTagSetAutoRadioOff This function configures the time until radio wave auto stop. [C++] int NFCHFTagSetAutoRadioOff( DWORD dwTimeout ) [Visual Basic] Public Shared Function NFCHFTagSetAutoRadioOff( ByVal dwTimeout As Int32 _ ) As Int32 [C#] public static Int32 NFCHFTagSetAutoRadioOff( Int32 dwTimeout )

Parameters Timeout Assigns the radio wave auto stop timeout in the range of 100 – 60,000 milliseconds (default: 1,000). Assigning a value of '0' disables the radio wave auto stop. Return values The following values are returned. NFC_OK

: Normal termination : NFC driver error Does not occur in the Device Emulator : Unopened error : Parameter error : Run error during card polling

NFC_NOT_DEVICE NFC_POF NFC_PRM NFC_ERROR_INVALID_ACCESS

38

3.20 NFCHFTagGetAutoRadioOff This function obtains the time until radio wave auto stop. [C++] int NFCHFTagGetAutoRadioOff( DWORD *pTimeout ) [Visual Basic] Public Shared Function NFCHFTagGetAutoRadioOff( ByRef pTimeout As Int32 _ ) As Int32 [C#] public static Int32 NFCHFTagGetAutoRadioOff( ref Int32 pTimeout )

Parameters Timeout Obtains the time until radio wave auto stop. Refer to the NFCHFTagSetAutoRadioOff function for details on the acquired values. Return values The following values are returned. NFC_OK

: Normal termination : NFC driver error Does not occur in the Device Emulator : Unopened error : Parameter error

NFC_NOT_DEVICE NFC_POF NFC_PRM

39

3.21 NFCHFTagSetPollingMode This function sets up IC card search method. [C++] int NFCHFTagSetPollingMode( DWORD dwMode, DWORD dwNum, DWORD dwReserved ) [Visual Basic] Public Shared Function NFCHFTagSetPollingMode( ByRef dwMode As Int32, _ ByRef dwNum As Int32, _ ByRef dwReserved As Int32 _ ) As Int32 [C#] public static Int32 NFCHFTagSetPollingMode( Int32 dwMode, Int32 dwNum, Int32 dwReserved )

Parameters dwMode Set up IC card search method. NFC_PLMODE_NORMAL NFC_PLMODE_MULTISTEP NFC_PLMODE_MULTISTEP2 NFC_PLMODE_PACKAGE

: : : :

Normal (Default) Multistep Multistep 2 Package

dwNum Set up number of multistep scanning. Setting range is different by search method. Case of NFC_PLMODE_NORMAL : Specify 0 Case of NFC_PLMODE_MULTISTEP : 2 to 100 Case of NFC_PLMODE_MULTISTEP2 : 2 to 100 Case of NFC_PLMODE_PACKAGE : Specify 2 dwReserved This parameter is not supported in the current version. Specify '0'. Return values The following values are returned. NFC_OK

: Normal termination

40

: NFC driver error Does not occur in the Device Emulator : Unopened error : Parameter error

NFC_NOT_DEVICE NFC_POF NFC_PRM

Notes IC card search method Normal One IC card will be started by one search operation. Different IC cards will be started continuously until specified Multistep / number.(see note) Multistep 2 (Only one IC card will be started by one search operation.) Same type several pieces IC card will be started by one search Package operation. Search operation will be continued until specified number. Note: Started card's Uid will be recorded in driver history at each IC card started. Double starting will be prevent by compared this history and started IC card. This history record will be clear by started specified IC card, passed timeout period, call back function return FALSE, execute NFCHFTagStopPolling function.

41

3.22 NFCHFTagGetPollingMode This function retrieves IC card search method [C++] int NFCHFTagGetPollingMode( DWORD *pdwMode, DWORD *pdwNum, DWORD *pdwReserved ) [Visual Basic] Public Shared Function NFCHFTagGetPollingMode( ByRef pdwMode As Int32, _ ByRef pdwNum As Int32, _ ByRef pdwReserved As Int32 _ ) As Int32 [C#] public ref ref ref )

static Int32 NFCHFTagGetPollingMode( Int32 pdwMode, Int32 pdwNum, Int32 pdwReserved

Parameters pdwMode Retrieves IC card search method. About retrieved detail value, refer NFCHFTagSetPollingMode function. pdwMode Retrieves number of multistep operation. About retrieved detail value, refer NFCHFTagSetPollingMode function. pdwReserved This parameter is not supported in the current version. Specify NULL. Return values The following values are returned. NFC_OK

: Normal termination : NFC driver error Does not occur in the Device Emulator : Unopened error : Parameter error

NFC_NOT_DEVICE NFC_POF NFC_PRM

42

3.23 NFCHFTagGetCardResponseEx This function retrieves response information of activated smart cards When you execute this function after scceed NFCHFTagPolling function by set up package mode by NFCHFTagSetPollingMode, retrieved response information of started several pieces IC cards. Response information will be recorded in driver at IC card start sccess timing, and retrieve response information in driver by this function. In the Device Emulator, the function checks parameters only. [C++] int NFCHFTagGetCardResponseEx( BYTE *pbyDSFID, BYTE *pbyUid, DWORD *pdwDiscoveredNum, DWORD *pdwReserved ) [Visual Basic] Public Shared Function NFCHFTagGetCardResponseEx( ByVal pbyDSFID As Byte(), _ ByVal pbyUid As Byte(), _ ByRef pdwDiscoveredNum As Int32, _ ByRef pdwReserved As Int32 _ ) As Int32 [C#] public static Int32 NFCHFTagGetCardResponseEx( Byte[] pbyDSFID, Byte[] pbyUid, ref Int32 pdwDiscoveredNum, ref Int32 pdwReserved )

Parameters pbyDSFID Retrieves DSFID from smart card. Secure (1 x dwNum in NFCHFTagSetPollingMode) bytes of the buffer size or more to retrieve. Data format 1 byte First card DSFID

1 byte Second card DSFID

pbyUid Retrieves Uid from smart card. Secure (8 x dwNum in NFCHFTagSetPollingMode) bytes of the buffer size or more to retrieve. 43

Data format 8 bytes First card Uid

8 bytes Second card Uid

pdwDiscoveredNum Retrieves number of IC card which was scceed to start by NFCHFTagPolling function. Maximum value which is available to set in dwTargetNo of NFCHFTagRead function and NFCHFTagWrite function, etc is value which is retrieved in this parameter. Ex) Case of retrieve 2 by this parameter Specified available value in dwTargetNo of NFCHFTagRead function is 0 to 1. pdwReserved This parameter is not supported in the current version. Specify NULL. Return values The following values are returned. NFC_OK

: Normal termination : NFC driver error Does not occur in the Device Emulator : Unopened error : Parameter error : Card inactivation error Does not occur in the Device Emulator : Run error during card polling

NFC_NOT_DEVICE NFC_POF NFC_PRM NFC_NOT_ACTIVATION NFC_ERROR_INVALID_ACCESS

44

4. Programming precautions 4.1 Auto stop notifications Using window message notification Terminating radio wave transmission manually 1. If you receive a WM_CREATE message, execute the NFCHFTagOpen function to go to queue-read mode. 2. If you receive a WM_COMMAND or WM_KEYDOWN message, execute the NFCHFTagPolling function to search for/activate ISO 15693 cards within the communicable range. 3. When you have successfully activated the ISO 15693 card and require its detailed information, execute the NFCHFTagGetCardResponse function to obtain the card response information (optional). 4. Communicate with the ISO 15693 card.(see note) 5. When communication with the card is complete, execute the NFCHFTagRadioOff function to terminate radio wave output. 6. If you receive a WM_CLOSE message, execute the NFCHFTagClose function to go to read close mode. WndProc

WM_CREATE

No

Yes NFCHFTagOpen

No

WM_COMMAND WM_MESSAGE

Yes WM_CLOSE

NFCHFTagPolling

Yes No

Card activated? Yes NFCHFTagGet CardResponse

Communicatewith card

NFCHFTagRadioOff

END

45

NFCHFTagClose

Note: Refer to 'Communicating with ISO 15693 cards' for details.

46

Radio wave auto stop & stop timing notification 1. If you receive a WM_CREATE message, execute the NFCHFTagOpen function to go to queue-read mode. 2. Execute the NFCHFTagSetEventNotification function to enable window message notification. 3. Execute the NFCHFTagSetAutoRadioOff function to enable the radio wave auto stop. 4. If you receive a WM_COMMAND or WM_KEYDOWN message, execute the NFCHFTagPolling function to search for/activate ISO 15693 cards within the communicable range. 5. When you have successfully activated the ISO 15693 card and require its detailed information, execute the NFCHFTagGetCardResponse function to obtain the card response information (optional). 6. Communicate with the ISO 15693 card.* 7. When communication with the card is complete, execute the NFCHFTagRadioOff function to terminate radio wave output. (even if radio wave output does not stop instantly, it will stop automatically once communication has not been performed for a certain period). 8. You can receive a WM_NFC_AUTORADIOOFF( WM_USER + 0x580 ) at the instant that automatic termination of radio wave output. In this case, it is possible to notify the user that radio wave output has stopped automatically. 9. If you receive a WM_CLOSE message, execute the NFCHFTagClose function to go to read close mode.

47

WndProc

WM_CREATE

No

Yes NFCHFTagOpen

No

WM_COMMAND WM_MESSAGE

Yes NFCHFTagSet EventNotification

WM_NFC_ AUTORADIOOFF

NFCHFTagPolling

No

Yes NFCHFTagSet AutoRadioOff

No

Card activated?

Notification of radio Wave output auto stop

WM_CLOSE Yes

Yes

NFCHFTagClose

NFCHFTagGet CardResponse

Communicate with card

NFCHFTagRadioOff

END

Note: Refer to 'Communicating with ISO 15693 cards 'Communicating with ISO 15693 cards' for details.

48

Using event notification Terminating radio wave transmission manually 1. Upon initiating the application, execute the NFCHFTagOpen function to go to queue-read mode. 2. Upon initiating communication processing, execute the NFCHFTagPolling function to search/activate ISO 15693 cards within the communicable range. 3. When you have successfully activated the ISO 15693 card and require its detailed information, execute the NFCHFTagGetCardResponse function to obtain the card response information (optional). 4. Communicate with the ISO 15693 card.* 5. When communication with the card is complete, execute the NFCHFTagRadioOff function to terminate radio wave output. 6. When closing the application, execute the NFCHFTagClose function to go to read close mode.

NFCHFTagPolling

Card activated?

No

Yes NFCHFTagGet CardResponse

Communicate with card

NFCHFTagOpen

At application launch

NFCHFTagClose

At application close

NFCHFTagRadioOff

When communicating with ISO 15693 card

Note: Refer to 'Communicating with ISO 15693 cards' for further details.

49

Radio wave auto stop & stop timing notification • Main thread 1. When launching the application, execute the CreateEvent function to generate a radio wave auto stop timing notification event handle. 2. Execute the CreateThread function to create a thread to monitor the radio wave auto stop. 3. Execute the NFCHFTagOpen function to go to queue-read mode. 4. Execute the NFCHFTagSetEventNotification function to enable event notification. 5. Execute the NFCHFTagSetAutoRadioOff function to enable the radio wave auto stop. 6. Upon initiating communication processing, execute the NFCHFTagPolling function to search for/activate ISO 15693 cards within the communication range. 7. When you have successfully activated the ISO 15693 card and require its detailed information, execute the NFCHFTagGetCardResponse function to obtain the card response information (optional). 8. Communicate with the ISO 15693 card.* 9. When communication with the card is complete, execute the NFCHFTagRadioOff function to terminate radio wave output. (even if radio wave output does not stop instantly, it will stop automatically once communication has not been performed for a certain period). 10. When closing the application, execute the SetEvent function to send a notification to the thread monitoring the radio wave auto stop. 11. Close the event handle and thread handle. 12. Execute the NFCHFTagClose function to go to read-locked state.

NFCHFTagPolling CreateEvent

CreateThread

Card activated?

SetEvent

No

Yes NFCHFTagOpen

CloseHandle ( Event handle )

NFCHFTagGet CardResponse

NFCHFTagSet EventNotification

CloseHandle (Thread handle )

Communicate with card

NFCHFTagSet AutoRadioOff

NFCHFTagClose

NFCHFTagRadioOff

At application launch

At application close

When communicating with ISO 15693 card

Note: Refer to 'Communicating with ISO 15693 cards' for details.

50

• NFC HF Tag thread 1. Execute the WaitForSingleObject function to queue the radio wave auto stop notification timing event handle. 2. When you receive a notification event upon closing the application, close the radio wave auto stop monitoring. 3. When you receive a notification event on any other occasions, it is possible to send a notification that the radio wave output has stopped automatically.

WaitForSingleObject

End application?

Yes

No Notify radio wave output auto stop

51

4.2 Communicating with ISO 15693 cards Below is the procedure for card communication described in the 'Auto stop notifications' section. 1. Execute the NFCHFTagRead or NFCHFTagWrite function.

NFCHFTagRead NFCHFTagWrite

End processing?

No

Yes

52

4.3

About search method Use of Multi Step mode Communicate with ISO15693 card 1. By using NFCHFTagSetPollingMode function, you should specify Multi Step mode(NFC_PLMODE_MULTISTEP) as search method and you should specify continuous scanning card number (CARD_NUM) as number of card. 2. Set iCount=0 3. If iCount