//---------------------------------------------------------------------------- // LXERFID.h - definitions for RFID wedge for MX3-RFID // // Copyright (c) 2001-2004 LXE //---------------------------------------------------------------------------- #ifndef __LXERFID_H #define __LXERFID_H //---------------------------------------------------------------------------- // DeviceIOControl control codes // note that these must be sent to WDG0: - codes may overlap other drivers //---------------------------------------------------------------------------- #define RFID_DEVICE L"RFI0:" #define RFID_IOCTL_BASE 0x900 #define RFID_IOCTL(n) (RFID_IOCTL_BASE+(n<<2)) // No change (the system mode is not changed). Used to retrieve firware version #define RFID_SYSTEM_NO_CHG RFID_IOCTL(0) // Kill Class 0 tag #define RFID_TAG_0_KILL RFID_IOCTL(1) // Set read parameters (RF power level and Modulation depth) #define RFID_TAG_0_SET RFID_IOCTL(2) // Read Class 0 tag IDs using parameters set by TAG_0_SET #define RFID_TAG_0_READ RFID_IOCTL(3) // Kill Class 1 tag #define RFID_TAG_1_KILL RFID_IOCTL(4) // Set read parameters (RF power level and Modulation depth) #define RFID_TAG_1_SET RFID_IOCTL(5) // Read Class 1 tag IDs using parameters set by TAG_1_SET #define RFID_TAG_1_READ RFID_IOCTL(6) // All Class 1 tags receiving this command will program specified tag ID in memory #define RFID_TAG_1_PROGRAM_ID RFID_IOCTL(7) // All tags receiving this command will reply with their CRC, followed by their // entire ID code, followed by their Password. A tag that has successfully executed // the LOCK_ID command ignores the VERIFY_ID command #define RFID_TAG_1_VERIFY_ID RFID_IOCTL(8) // This command prevents any further modification of the tag ID, CRC, and Password #define RFID_TAG_1_LOCK_ID RFID_IOCTL(9) // This command sets all bits of the tag ID, CRC, and Password to '0'. A tag that has // successfully executed the LOCK_ID command ignores the ERASE_ID command #define RFID_TAG_1_ERASE_ID RFID_IOCTL(10) // Performs Program_ID and Lock_ID #define RFID_TAG_1_WRITE RFID_IOCTL(11) // Allows definition of a set of six masks, each containing a Field Name, Offset, // Length, and Mask Value #define RFID_MASK_DEFINE RFID_IOCTL(12) // Reads Class 0 tags, Class 1 tags, or both classes of tags depending on the value // passed in for TAG_TYPE parameter. Allows a maximum of six masks as an input #define RFID_MASK_READ RFID_IOCTL(13) // Sets preamble for the output of all read commands // (TAG_0_READ, TAG_1_READ, and MASK_READ) #define RFID_SET_PREAMBLE RFID_IOCTL(14) // Sets postamble for the output of all read commands // (TAG_0_READ, TAG_1_READ, and MASK_READ) #define RFID_SET_POSTAMBLE RFID_IOCTL(15) // Sets tag separator for the output of all read commands // (TAG_0_READ, TAG_1_READ, and MASK_READ) #define RFID_SET_SEPARATOR RFID_IOCTL(16) // Turn ON/OFF beep on a read operation that results in one or more tags read #define RFID_NOTIFY_READ_SUCCESS RFID_IOCTL(17) // Turn ON/OFF buzz on a read opeartion that does not produce a beep #define RFID_NOTIFY_READER_ON RFID_IOCTL(18) //Sets the timeout for the Reader Power Management to kick in. When the driver //is inactive for the specified time, it puts the reader into “Disabled” mode //to conserve power. #define RFID_READER_POWER_TIMEOUT RFID_IOCTL(19) //Data from a read available #define RFID_GET_DATA RFID_IOCTL(20) //RF_ON command for NEMKO test only #define RFID_RF_ON RFID_IOCTL(21) //RF_ON command for NEMKO test only #define RFID_SYSTEM RFID_IOCTL(22) //Reboots Reader #define RFID_DOWNLOAD_REBOOT RFID_IOCTL(23) //Reboots Reader #define RFID_FIRMWARE_UPGRADE RFID_IOCTL(24) //--------------------------------------------------------------------------- // registry keys and defaults //--------------------------------------------------------------------------- #define REGRFIDROOT HKEY_LOCAL_MACHINE #define REGRFIDKEY L"Software\\LXE\\RFID" // Tags tab key values // subkey of REGRFIDROOT #define REG_TAGS L"Tags" // setting for "Tag Types to Read": 0 = Class0, 1 = Class1, 2 = Class0 and Class1 //#define KEY_TAGTYPES L"TagTypesToRead" //#define DEF_TAGTYPES 2 #define KEY_TAGCLASS0 L"Class0ToRead" #define DEF_TAGCLASS0 1 #define KEY_TAGCLASS1 L"Class1ToRead" #define DEF_TAGCLASS1 1 // setting for "Class 0 Singulation": 0 = ID0, 1 = ID1, 2 = ID2 #define KEY_SINGULATION L"Class0Singulation" #define DEF_SINGULATION 2 // setting for "Preamble". Default is "" #define KEY_PREAMBLE L"Preamble" #define DEF_PREAMBLE L"" // setting for "Postamble". Default is "" #define KEY_POSTAMBLE L"Postamble" #define DEF_POSTAMBLE L"" // setting for "Separator". Default is "" #define KEY_SEPARATOR L"Separator" #define DEF_SEPARATOR L"^M^J" // Filters tab key values // subkey of REGRFIDROOT #define REG_FILTERS L"Filters" // setting for "Filter Select" of first mask. Default is 0 #define KEY_FILTERCHECK1 L"FilterCheck1" #define DEF_FILTERCHECK1 0 // setting for "Field Name" of first mask. Default is "" #define KEY_MASK1FIELDNAME L"Mask1FieldName" #define DEF_MASK1FIELDNAME L"" // setting for "Offset" of first mask. Default is 0 #define KEY_MASK1OFFSET L"Mask1Offset" #define DEF_MASK1OFFSET 0 // setting for "Mask Value" of first mask. Default is "" #define KEY_MASK1VALUE L"Mask1Value" #define DEF_MASK1VALUE L"" // setting for "Filter Select" of second mask. Default is 0 #define KEY_FILTERCHECK2 L"FilterCheck2" #define DEF_FILTERCHECK2 0 // setting for "Field Name" of second mask. Default is "" #define KEY_MASK2FIELDNAME L"Mask2FieldName" #define DEF_MASK2FIELDNAME L"" // setting for "Offset" of second mask. Default is 0 #define KEY_MASK2OFFSET L"Mask2Offset" #define DEF_MASK2OFFSET 0 // setting for "Mask Value" of second mask. Default is "" #define KEY_MASK2VALUE L"Mask2Value" #define DEF_MASK2VALUE L"" // setting for "Filter Select" of third mask. Default is 0 #define KEY_FILTERCHECK3 L"FilterCheck3" #define DEF_FILTERCHECK3 0 // setting for "Field Name" of third mask. Default is "" #define KEY_MASK3FIELDNAME L"Mask3FieldName" #define DEF_MASK3FIELDNAME L"" // setting for "Offset" of third mask. Default is 0 #define KEY_MASK3OFFSET L"Mask3Offset" #define DEF_MASK3OFFSET 0 // setting for "Mask Value" of third mask. Default is "" #define KEY_MASK3VALUE L"Mask3Value" #define DEF_MASK3VALUE L"" // setting for "Filter Select" of fourth mask. Default is 0 #define KEY_FILTERCHECK4 L"FilterCheck4" #define DEF_FILTERCHECK4 0 // setting for "Field Name" of fourth mask. Default is "" #define KEY_MASK4FIELDNAME L"Mask4FieldName" #define DEF_MASK4FIELDNAME L"" // setting for "Offset" of fourth mask. Default is 0 #define KEY_MASK4OFFSET L"Mask4Offset" #define DEF_MASK4OFFSET 0 // setting for "Mask Value" of fourth mask. Default is "" #define KEY_MASK4VALUE L"Mask4Value" #define DEF_MASK4VALUE L"" // setting for "Filter Select" of fifth mask. Default is 0 #define KEY_FILTERCHECK5 L"FilterCheck5" #define DEF_FILTERCHECK5 0 // setting for "Field Name" of fifth mask. Default is "" #define KEY_MASK5FIELDNAME L"Mask5FieldName" #define DEF_MASK5FIELDNAME L"" // setting for "Offset" of fifth mask. Default is 0 #define KEY_MASK5OFFSET L"Mask5Offset" #define DEF_MASK5OFFSET 0 // setting for "Mask Value" of fifth mask. Default is "" #define KEY_MASK5VALUE L"Mask5Value" #define DEF_MASK5VALUE L"" // setting for "Filter Select" of sixth mask. Default is 0 #define KEY_FILTERCHECK6 L"FilterCheck6" #define DEF_FILTERCHECK6 0 // setting for "Field Name" of sixth mask. Default is "" #define KEY_MASK6FIELDNAME L"Mask6FieldName" #define DEF_MASK6FIELDNAME L"" // setting for "Offset" of sixth mask. Default is 0 #define KEY_MASK6OFFSET L"Mask6Offset" #define DEF_MASK6OFFSET 0 // setting for "Mask Value" of sixth mask. Default is "" #define KEY_MASK6VALUE L"Mask6Value" #define DEF_MASK6VALUE L"" // Read tab key values // subkey of REGRFIDROOT #define REG_READ L"Read" // setting for "Reader Key Action". Options: // 0 = Read Once on Key Press // 1 = Read Continuous during Key Press // 2 = Toggle On/Off with Key Press //Default is 0 #define KEY_READERKEYACTION L"ReaderKeyAction" #define DEF_READERKEYACTION 0 // setting for "Beep once on Tag read": 0 = Disabled, 1 = Enabled Default is 1 #define KEY_BEEPONREAD L"BeepOnTagRead" #define DEF_BEEPONREAD 1 // setting for "Buzz during Read Cycle": 0 = Disabled, 1 = Enabled Default is 1 #define KEY_BUZZONREAD L"BuzzOnReadCycle" #define DEF_BUZZONREAD 1 // setting for "Send key messages(wedge)": 0 = Disabled, 1 = Enabled Default is 1 #define KEY_WEDGE L"SendKeyMessages" #define DEF_WEDGE 1 // Power tab key values // subkey of REGRFIDROOT #define REG_POWER L"Power" // setting for "Output Power". Range is 0x01 - 0x10 (1 - 16). Default is 16 #define KEY_OUTPUTPOWER L"OutputPower" #define DEF_OUTPUTPOWER 10 // setting for "Modulation". Range is 0x01 - 0x20 (1 - 32). Default is 32 #define KEY_MODDEPTH L"ModulationDepth" #define DEF_MODDEPTH 1 // setting for "Reader Power Timeout". Allowed values and corresponding registry value are the following: //3 sec.(0), 4 sec.(1), 5 sec.(2), 10 sec.(3), 15 sec.(4), 20 sec.(5), 30 sec.(6), 45 sec.(7), //1 min.(8), 2 min.(9), 3 min.(10), 4 min.(11), 5 min.(12), 6 min.(13), 7 min.(14), 8 min.(15), //9 min.(16), 10 min.(17), 11 min.(18), 12 min.(19), 13 min.(20), 14 min.(21), 15 min.(22). Default is 3 sec.(0) #define KEY_READERPOWERTIMEOUT L"ReaderPowerTimeout" #define DEF_READERPOWERTIMEOUT 0 // setting for "Disable Power Management": 0 = Not Checked, 1 = Checked Default is 0 #define KEY_PMDISABLE L"DisablePowerManagement" #define DEF_PMDISABLE 0 // Format tab key values // subkey of REGRFIDROOT #define REG_FORMAT L"Format" // OutputFormat for the tag data: 0 = HEX, 1 = EPC #define KEY_OUTPUTFORMAT L"OutputFormat" #define DEF_OUTPUTFORMAT 0 // setting for "FieldSeparator" controls separator between fields of the tag. Default is "" #define KEY_FIELDSEPARATOR L"FieldSeparator" #define DEF_FIELDSEPARATOR L"" // setting for "Class 0 Attempts" controls number of read attempts for Class 0 tags. // Registry entry range is 1-10 attempts. Default is 4 #define KEY_CLASS0ATTEMPTS L"Class0Attempts" #define DEF_CLASS0ATTEMPTS 4 // setting for "Class 1 Attempts" controls number of read attempts for Class 1 tags. // Registry entry range is 1-10 attempts. Default is 1 #define KEY_CLASS1ATTEMPTS L"Class1Attempts" #define DEF_CLASS1ATTEMPTS 1 //---------------------------------------------------------------------------- #define PREAMBLE_POSTAMBLE_LENGTH 10 //5 characters + 5 hats max #define SEPARATOR_LENGTH 4 //2 characters + 2 hats max #define FIELD_NAME_LENGTH 40 #define OFFSET_FIELD_LENGTH 2 #define LENGTH_FIELD_LENGTH 2 #define MASK_VALUE_LENGTH 24 //Error codes #define ERR_NONE 0x00 #define ERR_INVALID_PARAM 0xFD #define ERR_UNDEFINED 0xFF //For Masking #define MASK_FLAG 0x11 //Status codes #define STATUS_IN_PROGRESS 0x01 //Buffer Sizes #define READER_MAX_RETURN 2800 //Max(200 tags) => ((10 tags * 12 bytes) + 6 overhead) * 20 packets + 7 summary = 2527 + extra #define CLASS1_MAX_DATA 3100 //Max(200 tags) => (200 tags * 12 bytes) + (199 separators * 2) + 10 pre+post = 2808 + extra #define CLASS0_MAX_DATA 6200 //Max will be the same as for Class1, but since we do 4 reads, increase it two-fold just in case //Encoding codes #define TAGDATA_SGTIN64 1 #define TAGDATA_SGTIN96 2 #define TAGDATA_SSCC64 3 #define TAGDATA_SSCC96 4 #endif // __LXERFID_H