XR Series, C API
Programmer Reference Guide
XR Series RFID Readers C API Programmer Reference Guide
72E-73028-02
Revision A
July 2006
© 2006 by Symbol Technologies, Inc. All rights reserved.
No part of this publication may be reproduced or used in any form, or by any electrical or mechanical means, without permission in writing from
Symbol. This includes electronic or mechanical means, such as photocopying, recording, or information storage and retrieval systems. The material
in this manual is subject to change without notice.
The software is provided strictly on an “as is” basis. All software, including firmware, furnished to the user is on a licensed basis. Symbol grants
to the user a non-transferable and non-exclusive license to use each software or firmware program delivered hereunder (licensed program). Except
as noted below, such license may not be assigned, sublicensed, or otherwise transferred by the user without prior written consent of Symbol. No
right to copy a licensed program in whole or in part is granted, except as permitted under copyright law. The user shall not modify, merge, or
incorporate any form or portion of a licensed program with other program material, create a derivative work from a licensed program, or use a
licensed program in a network without written permission from Symbol. The user agrees to maintain Symbol’s copyright notice on the licensed
programs delivered hereunder, and to include the same on any authorized copies it makes, in whole or in part. The user agrees not to decompile,
disassemble, decode, or reverse engineer any licensed program delivered to the user or any portion thereof.
Symbol reserves the right to make changes to any software or product to improve reliability, function, or design.
Symbol does not assume any product liability arising out of, or in connection with, the application or use of any product, circuit, or application
described herein.
No license is granted, either expressly or by implication, estoppel, or otherwise under any Symbol Technologies, Inc., intellectual property rights.
An implied license only exists for equipment, circuits, and subsystems contained in Symbol products.
Symbol, Spectrum One, and Spectrum24 are registered trademarks of Symbol Technologies, Inc. Bluetooth is a registered trademark of Bluetooth
SIG. Microsoft, Windows and ActiveSync are either registered trademarks or trademarks of Microsoft Corporation. Other product names mentioned
in this manual may be trademarks or registered trademarks of their respective companies and are hereby acknowledged.
Symbol Technologies, Inc.
One Symbol Plaza
Holtsville, New York 11742-1300
http://www.symbol.com
Patents
This product is covered by one or more of the patents listed on the webbiest: www.symbol.com/patents
Revision History
Changes to the original manual are listed below:
Change Date Description
-01 Rev A June 2005 Initial Release
-02 Rev A July 2006 Added Gen 2 update
Contents
Revision History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii
About This Guide
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
Chapter Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
Notational Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
Related Documents and Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xii
Service Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xii
Chapter 1. Getting Started
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3
Chapter 2. Structures and Definitions
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3
Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3
Chapter 3. Initialization
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3
RFID_Open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-5
RFID_Close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-8
XR400 Reader C API Programmer Reference Guide vi
Chapter 4. Device Capabilities Discovery
Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3
RFID_GetCapList. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-4
RFID_GetCapInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-5
RFID_GetCapCurrValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-7
RFID_GetCapDfltValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-10
RFID_SetCapCurrValue. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-11
RFID_SetCapDflts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-12
RFID_SetCapDfltValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-13
Chapter 5. Reading and Writing Tags
Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3
RFID_GetTagID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-4
RFID_GetTagMask . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-5
RFID_SetTagMask . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-6
RFID_KillTag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-7
RFID_LockTag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-9
RFID_ProgramTags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-11
RFID_EraseTag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-13
RFID_ReadTagInventory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-14
GPIO Support. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-15
Extended Version of Data Structures and Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-16
Error in Tag Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-18
Chapter 6. General Helper Functions
Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3
RFID_GetCommandStatusText. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-4
RFID_GetStats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-5
Appendix A. RFID API Capabilities
Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-3
RFID_INFCAP_SUPPORTEDCAPS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-4
RFID_DEVCAP_IP_NAME. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-5
RFID_DEVCAP_IP_PORT. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-6
RFID_DEVCAP_ANTENNA_SEQUENCE. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-8
RFID_READCAP_RF_ATTENUATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-10
RFID_READCAP_EVENTTAGPTR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-11
RFID_READCAP_EVENTNAME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-12
RFID_READCAP_EVENT_ALLTAGS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-16
RFID_READCAP_METHOD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-17
RFID_READCAP_OUTLOOP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-18
RFID_READCAP_INLOOP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-20
RFID_READCAP_READMODE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-21
RFID_WRITECAP_RF_ATTENUATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-22
RFID_WRITECAP_TAGTYPE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-23
RFID_TAGCAP_LOCKCODE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-24
RFID_TAGCAP_SUPPORTED_TYPES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-25
RFID_TAGCAP_ENABLED_TYPES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-26
RFID_TAGCAP_C0_SINGULATION_FIELD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-26
RFID_WRITECAP_ANTENNA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-27
RFID_TAGCAP_G2_KILL_PASSWORD. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-27
RFID_TAGCAP_G2_ACCESS_PASSWORD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-28
RFID_DEVCAP_VALID_ANTENNA_LIST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-28
RFID_DEVCAP_ANTENNA_GROUP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-29
RFID_TAGCAP_MASK_BITS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-30
RFID_TAGCAP_MASK_NUMBITS_TOMATCH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-30
RFID_TAGCAP_MASK_STARTPOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-31
RFID_TAGCAP_MASK_STARTPOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-31
Contents vii
Appendix B. Return Values
Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-3
Appendix C. Sample Application
Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-3
Index
Tell Us What You Think
XR400 Reader C API Programmer Reference Guideviii
About This Guide
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
Chapter Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
Notational Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
Related Documents and Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xii
Service Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xii
XR400 Reader C API Programmer Reference Guide x
Introduction
This guide provides information on using C API to develop applications to read and write tags on an XR Series RFID reader. The
C API provides an interface with the XR Series readers using the parameters defined in the XR Series Interface Control Guide,
p/n 72E-71803-xx .
Chapter Descriptions
Topics covered in this guide are as follows:
• Chapter 1, Getting Started provides an overview of the RFID C API.
• Chapter 3, Initialization describes commands associated with device initialization and discovery.
• Chapter 4, Device Capabilities Discovery describes how to discover and change the RFID API capabilities.
• Chapter 5, Reading and Writing Tags describes tag reading and writing functions.
• Chapter 6, General Helper Functions includes commands for retrieving API status codes and module statistics.
• Appendix A, RFID API Capabilities provides capabilities information to use for reference when calling functions.
• Appendix B, Return Values describes the return values that the C API uses when responding to function calls.
• Appendix C, Sample Application provides a sample application for finding and opening a reader, and reading and displaying
tags.
xi
Notational Conventions
The following conventions are used in this document:
• Italics are used to highlight the following:
• Chapters and sections in this and related documents
• Dialog box, window and screen names
• Drop-down list and list box names
• Check box and radio button names
• Icons on a screen.
• Bold text is used to highlight the following:
• Key names on a keypad
• Button names on a screen.
• Bullets (•) indicate:
• Action items
• Lists of alternatives
• Lists of required steps that are not necessarily sequential.
• Sequential lists (e.g., those that describe step-by-step procedures) appear as numbered lists.
XR400 Reader C API Programmer Reference Guide xii
Related Documents and Software
The following documents provide more information about the XR Series RFID readers.
• XR Series RFID Readers Integrator Guide, p/n 72E-71773-xx
• XR Series Interface Control Guide , p/n 72E-71803-xx
• TagVis User Guide , p/n 72E-71804-xx
• ReaderComm5DLL Developer Guide , p/n 72E-71805-xx
For the latest version of this guide and all guides, go to: http://www.symbol.com/manuals.
Service Information
For service information, warranty information or technical assistance contact or call the Symbol Support Center. Contact information
is provided on the Symbol contact web site go to:
If the problem cannot be solved over the phone, the equipment may need to be returned for servicing. If that is necessary, specific
directions will be provided.
Symbol Technologies is not responsible for any damages incurred during shipment if the approved shipping
container is not used. Shipping the units improperly can possibly void the warranty.
http://www.symbol.com/contactsupport
If the Symbol product was purchased from a Symbol Business Partner, contact that Business Partner for service.
Getting Started
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3
XR400 Reader C API Programmer Reference Guide1-2
Getting Started 1-3
Introduction
The C API enables programmers to write applications which run either directly on an XR Series RFID reader or on a Windows XP SP2
PC host.
This API provides access to the reader features, by utilizing the byte stream protocol as defined in the XR Series Interface Control
Guide, p/n 72E-71803-xx . The API exposes these features as a set of predefined capabilities, and carries out operations through
function calls.
The API does not save any configuration information. All of the capabilities are initialized to their default values when an instance is
created and any changes made by the user(s) is not persisted by the API. The users must manage and adjusting the parameters at
runtime. This is true for both the PC and the XR reader platforms.
XR400 Reader C API Programmer Reference Guide 1-4
Structures and Definitions
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3
Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3
XR400 Reader C API Programmer Reference Guide 2-2
Introduction
This section describes the code structures and definitions.
Definitions
Capability Data Type
// Definitions for capability data types
#define TWTY_INT8 0x0000 /* Means Item is a TW_INT8 */
#define TWTY_INT16 0x0001 /* Means Item is a TW_INT16 */
#define TWTY_INT32 0x0002 /* Means Item is a TW_INT32 */
#define TWTY_UINT8 0x0003 /* Means Item is a TW_UINT8 */
#define TWTY_UINT16 0x0004 /* Means Item is a TW_UINT16 */
#define TWTY_UINT32 0x0005 /* Means Item is a TW_UINT32 */
Structures and Definitions 2-3
Capability Container Type
// Definitions for capability container types
#define TWON_UNKNOWN 0
#define TWON_ARRAY 3
#define TWON_ENUMERATION 4
#defineTWON_ONEVALUE 5
#define TWON_RANGE 6
Maximum Tag Type Array Size
#define RFID_TAG_TYPE_MAX20 // Reserve for 20 types of tag in stats block
XR400 Reader C API Programmer Reference Guide 2-4
Tag Type Definition
enum RFID_TAG_TYPE_INDEX {
RFID_TAG_TYPE_OTHER = 0, //
RFID_TAG_TYPE_EPC_CLASS0 = 1, //
RFID_TAG_TYPE_EPC_CLASS0PLUS = 2, //
RFID_TAG_TYPE_EPC_CLASS1 = 3, //
RFID_TAG_TYPE_EPC_CLASSG2 = 4, //
RFID_TAG_TYPE_EPC_CLASS0ZUMA = 5, //
RFID_TAG_TYPE_MAXINDEX = 5, // Max used
RFID_TAG_TYPE_ERROR = 0xFFFFFFFF, // Unassigned type
};
Maximum Tag Type ID Length
#define RFID_MAX_TAG_ID_LENGTH_EX64 // max tag id length
Tag Filter Option
#define RFID_FILTER_OPTION_PASS 0 // pass tags that match the supplied filter
#define RFID_FILTER_OPTION_DROP 1 // drop tags that match the supplied filter
#define RFID_FILTER_OPTION_NOMATCH_PASS 2 // pass tags that do not match the supplied filter
#define RFID_FILTER_OPTION_NOMATCH_DROP 3 // drop tags that do not match the supplied filter
Antenna Structure Size
// RFID_CAPS defines
#define RFID_ANTENNA_SEQUENCE_LENGTH 16
#define MAX_NUMBER_ANTENNA 8
Generic Structure Information
typedef struct tagSTRUCT_INFO
{
DWORD dwAllocated; // Size of allocated structure in bytes
DWORD dwUsed; // Amount of structure actually used
} STRUCT_INFO;
CAPINFO Structure
// Capability information structure
typedef struct tagCAPINFO {
STRUCT_INFO StructInfo; // Information about this structure
DWORD dwCapId; // The capability ID
BOOLEAN bSupported; // non zero: supported
DWORD dwDataTypeId; // data type for this capability
DWORD dwDataSize; // size (# of bytes) of this data type
DWORD dwContainerId; // container type for this capability
DWORD dwContainerSize; // container size for this capability
DWORD dwNumItems; // Maximum Number of Item in this capability
TCHAR tszName[MAX_CAP_NAME]; // name of this capability
} CAPINFO, *LPCAPINFO;
Structures and Definitions 2-5
TYPE_TAG Structure
/* type storing tag data for a Tag List **************/
typedef struct
{
unsigned char status; //Status of entry - discovered, ... 1
unsigned char antennaNum; //Last antenna this tag has been read 2
unsigned char dataLength; //Tag length in bytes 3
unsigned char tagID[RFID_MAX_TAG_ID_LENGTH]; //ID code of tag 4-20
SYSTEMTIME lastSeen; //Timestamp of last time tag was seen 21-36
unsigned long readCount; //Number of reads of this tag 37-40
DWORD dwType; //Type of Tag 41-44
DWORD dwFormat; //Tag Data Format 45-48
DWORD dwOperationStatus; //RFIDAPI status code 49-52
WORD wStatusDetail; //extended status information 53-54
WORD wReserved1; // 55-56
DWORD dwReserved4; // 57-60
DWORD dwReserved5; // Reserve 5 DWORDS for future 61-64
}TYPE_TAG;
XR400 Reader C API Programmer Reference Guide 2-6
TYPE_TAG_EX structure
typedef struct
{
int nInit; // This will be initialized by macro
int nTypeTagStructureFormat;
int nTypeTagStructureSize;
} TYPE_TAG_STRUCTURE_HEADER;
typedef struct
{
TYPE_TAG_STRUCTURE_HEADER Header;
unsigned char status; //Status of entry - discovered, ...
unsigned char antennaNum; //Last antenna this tag has been read
DWORD dataLength; //number of bytes in the tagID field. SYSTEMTIME firstSeen;
//Timestamp of first time tag was seen
SYSTEMTIME lastSeen; //Timestamp of last time tag was seen
unsigned long readCount; //Number of reads of this tag
DWORD dwType; //Type of Tag
DWORD dwFormat; //Tag Data Format
int nMemoryPageNumber; //For class 0 tags, memory page 2 is EPC.
// Memory page 2 information is not stored in this
// and the following memory page variables
DWORD dwMemoryPageOffset; //starting bit Offset into tag's memory page where data was read.
DWORD dwMemoryPageLength; //length of memory page in bytes.
DWORD dwOperationStatus; //status code for the read operation
WORD wStatusDetail; //other hardware related detail
WORD wCRC; // reserved
WORD wPC; // reserved
WORD wRSSI; // reserved
DWORD dwMillisecond; // reserved
DWORD dwReserved5; // Reserve DWORDS
unsigned char tagID[RFID_MAX_TAG_ID_LENGTH_EX];//ID code of tag
}TYPE_TAG_EX;
TYPE_MASK Structure
typedef struct
{
unsigned char cBitLen;
unsigned char cBitStartOffset;
unsigned char cTagMask[RFID_MAX_TAG_ID_LENGTH];
DWORD dwReserved[20]; // Reserve 20 DWORDS for future
}TAG_MASK;
TYPE_MASK_EX structure
typedef struct
{
int nInit; // This will be initialized by macro
Structures and Definitions 2-7
int nTagMaskStructureFormat;
int nTagMaskStructureSize;
} TAG_MASK_STRUCTURE_HEADER;
typedef struct
{
TAG_MASK_STRUCTURE_HEADER Header;
unsigned int nBitLen;
unsigned int nBitStartOffset;
unsigned char cTagMask[RFID_MAX_TAG_ID_LENGTH_EX];
DWORD dwReserved[20]; // Reserve 20 DWORDS for future
}TAG_MASK_EX;
XR400 Reader C API Programmer Reference Guide 2-8
RFID_CAPS structure
typedef struct
{
TCHAR szAPIVersionString[RFID_API_VERSION_STRING_LENGTH];
TCHAR szFirmwareVersion[RFID_FIRMWARE_VERSION_STRING_LENGTH];
TCHAR szMfgDateCode[RFID_FIRMWARE_MFGDATECODE_LENGTH];
TCHAR szSerialInfo[RFID_FIRMWARE_SERIALINFO_LENGTH];
unsigned char ReaderNumber;
unsigned char Antenna;
unsigned char AntennaSequence[RFID_ANTENNA_SEQUENCE_LENGTH];
BOOL bPowerState;
BOOL bPortOpen;
DWORD dwReaderType;
DWORD dwCurrentPort;
DWORD dwCurrentBaud;
DWORD dwRFIDDeviceTable[10];
DWORD dwRFIDDeviceCount;
DWORD dwRFAttenuation; // 1
DWORD dwRFChannel; // 2
DWORD dwLastReaderCmdSeqNum; // 3
DWORD dwLastReaderCmd; // 4
DWORD dwLastReaderRsp; // 5
DWORD dwTagListSeqNum; // 6
BYTE bSupportedTagTypes[RFID_TAG_TYPE_MAX]; // 7 - 11
BYTE bEnabledTagTypes[RFID_TAG_TYPE_MAX]; // 12 - 16
DWORD dwMonitorStatus; // 17
BYTE bRFIDModuleType; // 18
DWORD dwReserved[100-18]; // Reserve 100 DWORDS for future
}RFID_CAPS;
TAG_LIST structure
typedef struct
{
DWORD dwTotalTags; // 1
DWORD dwTotalReads; // 2
DWORD dwNewTags; // 3
DWORD dwReadTimeMS; // 4
DWORD dwSeqNum; // 5
DWORD dwMaxTags; // Max tags supported. 0 means 200
DWORD dwErrorTags; // total of error tag packets appended to end of valid tags.
DWORD dwReserved[25-7]; // Use a total of 25 DWORDS
TYPE_TAG Tags[RFID_MAX_TAGS];
} TAG_LIST;
Structures and Definitions 2-9
TAG_LIST_EX structure
typedef struct
{
int nInit; // This will be initialized by macro
int nTagListStructureFormat;
int nTagListStructureSize;
} TAG_LIST_STRUCTURE_HEADER;
typedef struct
{
TAG_LIST_STRUCTURE_HEADER Header;
DWORD dwTotalTags; //
DWORD dwTotalReads; //
DWORD dwNewTags; //
DWORD dwReadTimeMS; //
DWORD dwSeqNum; //
DWORD dwMaxTags; // Max tags supported. 0 means 200
DWORD dwErrorTags; //total of error tag packets appended to end of valid tags
DWORD dwReserved[19]; // Reserve a total of 19 DWORDS
TYPE_TAG_EX Tags[RFID_MAX_TAGS];
} TAG_LIST_EX;
XR400 Reader C API Programmer Reference Guide 2-10
RFID_STATS structure
typedef struct
{
DWORD dwVersion; // 1
DWORD dwTotalTX; // 2
DWORD dwTotalRX; // 3
DWORD dwPacketsTX; // 4
DWORD dwPacketsRX; // 5
DWORD dwIncompleteTX; // 6
DWORD dwPacketsFragmented; // 7
DWORD dwPacketsCRCError; // 8
DWORD dwSessionIDError; // 9
DWORD dwTotalReads; // 10
DWORD dwTotalTagCRCError; // 11
DWORD dwTotalTagCollisions; // 12
DWORD dwTimeouts; // 13
DWORD dwTotal_10MSOnTime; // 14
DWORD dwTotalMSRFOnTime; // 15
DWORD dwNoTagErr; // 16
DWORD dwEraseFailErr; // 17
DWORD dwProgFailErr; // 18
DWORD dwTagLockErr; // 19
DWORD dwKillFailErr; // 20
DWORD dwHardwareErr; // 21
DWORD dwDataSizeErr; // 22
DWORD dwReadTime_10MS; // 23
DWORD dwReadAttempts; // 24
DWORD dwReadSuccess; // 25
DWORD dwProgramAttempts; // 26
DWORD dwProgramSuccess; // 27
DWORD dwEraseAttempts; // 28
DWORD dwEraseSuccess; // 29
DWORD dwLockAttempts; // 30
DWORD dwLockSuccess; // 31
DWORD dwKillAttempts; // 32
DWORD dwKillSuccess; // 33
DWORD dwLockFailErr; // 34
DWORD dwTagTypeReadTotal[RFID_TAG_TYPE_MAX]; // 35-54 (35+(RFID_TAG_TYPE_MAX - 1)
DWORD dwTagUnderrunErrors; // 55
DWORD dwDroppedTagEvents; //56
DWORD dwReserved[256-56];
// Total of 256 DWORDS for stats(Fixed size total of 1K)
} RFID_STATS;
Macro Used to Initialize TYPE_TAG_EX Structure
A TYPE_TAG_EX variable must be initialized by this macro before it is used.
The macro syntax is: TYPE_TAG_EX1_INIT(TypeTag)
Parameter TypeTag is a TYPE_TAG_EX variable.
Macro used to initialize TYPE_MASK_EX structure
A TYPE_MASK_EX variable must be initialized by this macro before it is used.
The macro syntax is: TAG_MASK_EX1_INIT(TagMask)
Parameter TagMask is a TYPE_MASK_EX variable.
Macro used to initialize TAG_LIST_EX structure
A TAG_LIST_EX variable must be initialized by this macro before it is used.
The macro syntax is: TAG_LIST_EX1_INIT(TagList, MaxTags)
Structures and Definitions 2-11
Parameter TagList is a TAG_LIST_EX variable.
Parameter MaxTags is either 0 or 200.
XR400 Reader C API Programmer Reference Guide 2-12