Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #if !defined(_FEDM_XML_H_INCLUDED_)
00035 #define _FEDM_XML_H_INCLUDED_
00036
00037 #ifdef _MSC_VER
00038
00039
00040
00041 #pragma warning(disable:4786) // for MFC
00042 #endif
00043
00044
00045 #ifdef _FEDM_XML_SUPPORT
00046
00047
00048 #include <string>
00049 #include <vector>
00050 #include <map>
00051
00052
00053
00054 using namespace std;
00055
00056
00057
00058
00059
00060
00061
00062
00063 #define FEDM_MAX_NAME_SIZE 64 // maximal size of a C-string based name
00064 #define FEDM_MAX_TEXT_SIZE 512 // maximal size of a C-string based text
00065
00066
00067
00068 #define FEDM_XML_STRING_XML_VERSION_UC L"1.0" // XML version
00069 #define FEDM_XML_STRING_XML_ENCODING_UC L"utf-8" // pure ASCII chars
00070 #define FEDM_XML_STRING_XML_STANDALONE_UC L"yes" // without external DTD
00071
00072
00073 #define FEDM_XML_TAG_VENDOR_UC L"vendor"
00074 #define FEDM_XML_TAG_DOC_TYPE_UC L"document-type"
00075 #define FEDM_XML_TAG_DOC_VERSION_UC L"document-version"
00076 #define FEDM_XML_TAG_READER_FAM_UC L"reader-family"
00077 #define FEDM_XML_TAG_READER_NAME_UC L"reader-name"
00078 #define FEDM_XML_TAG_READER_TYPE_UC L"reader-type"
00079 #define FEDM_XML_TAG_HARDWARE_TYPE_UC L"hardware-type"
00080 #define FEDM_XML_TAG_COMMENT_UC L"comment"
00081 #define FEDM_XML_TAG_PRG_NAME_UC L"program-name"
00082 #define FEDM_XML_TAG_PRG_VERSION_UC L"program-version"
00083 #define FEDM_XML_TAG_FEDM_VERSION_UC L"fedm-version"
00084 #define FEDM_XML_TAG_DATE_UC L"date"
00085 #define FEDM_XML_TAG_TIME_UC L"time"
00086 #define FEDM_XML_TAG_BUSADR_UC L"bus-address"
00087 #define FEDM_XML_TAG_COMPORT_UC L"com-port"
00088 #define FEDM_XML_TAG_DEVICE_ID_UC L"device-id"
00089 #define FEDM_XML_TAG_HOSTADR_UC L"host-address"
00090 #define FEDM_XML_TAG_PORTNR_UC L"port-number"
00091 #define FEDM_XML_TAG_PORT_TYPE_UC L"port-type"
00092 #define FEDM_XML_TAG_COMM_MODE_UC L"communication-mode"
00093 #define FEDM_XML_TAG_FRAME_SUPPORT L"protocol-frame-support"
00094 #define FEDM_XML_TAG_READER_UC L"reader"
00095 #define FEDM_XML_TAG_READER_INFO_UC L"reader-info"
00096 #define FEDM_XML_TAG_CUSTOMER_ID_UC L"customer-id"
00097 #define FEDM_XML_TAG_FIRMWARE_VERSION_UC L"firmware-version"
00098 #define FEDM_XML_TAG_READER_FUNCTIONS_UC L"reader-functions"
00099 #define FEDM_XML_TAG_HF_READER_FUNCTIONS_UC L"hf-reader-functions"
00100 #define FEDM_XML_TAG_UHF_READER_FUNCTIONS_UC L"uhf-reader-functions"
00101 #define FEDM_XML_TAG_INPUT_UC L"input"
00102 #define FEDM_XML_TAG_OUTPUT_UC L"output"
00103 #define FEDM_XML_TAG_TRANSPONDER_DRIVER_UC L"transponder-driver"
00104 #define FEDM_XML_TAG_HF_TRANSPONDER_DRIVER_UC L"hf-transponder-driver"
00105 #define FEDM_XML_TAG_UHF_TRANSPONDER_DRIVER_UC L"uhf-transponder-driver"
00106 #define FEDM_XML_TAG_FREQUENCY_UC L"frequency"
00107 #define FEDM_XML_TAG_REGION_UC L"region"
00108 #define FEDM_XML_TAG_FIRMWARE_IDENTIFIER_UC L"firmware-identifier"
00109 #define FEDM_XML_TAG_FIRMWARE_UPGRADE_UC L"firmware-upgrade"
00110 #define FEDM_XML_TAG_UNLOCK_KEY_UC L"unlock-key"
00111 #define FEDM_XML_TAG_CONTROLLER_UC L"controller"
00112 #define FEDM_XML_TAG_CONTROLLER_TYPE_UC L"controller-type"
00113 #define FEDM_XML_TAG_CONTROLLER_SUB_TYPE_UC L"controller-sub-type"
00114 #define FEDM_XML_TAG_BANK_NO_UC L"bank-number"
00115 #define FEDM_XML_TAG_MANUFACTURER_ID_UC L"manufacturer-id"
00116 #define FEDM_XML_TAG_CHIP_TYPE_ID_UC L"chip-type-id"
00117 #define FEDM_XML_TAG_REV_CODE_UC L"revision-code"
00118 #define FEDM_XML_TAG_FLASHSIZE_UC L"flashsize"
00119 #define FEDM_XML_TAG_CRC_UC L"checksum"
00120 #define FEDM_XML_TAG_OPTIONAL_UC L"optional"
00121 #define FEDM_XML_TAG_OPTIONAL_INFO_UC L"optional-info"
00122 #define FEDM_XML_TAG_DECODER_INFO_UC L"decoder-info"
00123 #define FEDM_XML_TAG_SELF_TEST_UC L"self-test"
00124 #define FEDM_XML_TAG_ADD_FIRMWARE_INFO_UC L"additional-firmware-info"
00125 #define FEDM_XML_TAG_ADD_HARDWARE_INFO_UC L"additional-hardware-info"
00126 #define FEDM_XML_TAG_TEMPLATE_UC L"template"
00127 #define FEDM_XML_TAG_FUNCTION_LIST_UC L"function-list"
00128 #define FEDM_XML_TAG_IDENTIFIER_UC L"identifier"
00129 #define FEDM_XML_TAG_HW_INFO_UC L"hw-info"
00130 #define FEDM_XML_TAG_AHW_INFO_UC L"ahw-info"
00131 #define FEDM_XML_TAG_DHW_INFO_UC L"dhw-info"
00132 #define FEDM_XML_TAG_DEVICE_INFO_UC L"device-info"
00133 #define FEDM_XML_TAG_RX_BUFFER_SIZE_UC L"rx-buffer-size"
00134 #define FEDM_XML_TAG_TX_BUFFER_SIZE_UC L"tx-buffer-size"
00135 #define FEDM_XML_TAG_CFG_RESET_UC L"cfg-reset"
00136 #define FEDM_XML_TAG_RFC_RESET_UC L"rfc-reset"
00137 #define FEDM_XML_TAG_ACC_RESET_UC L"acc-reset"
00138
00139
00140
00141 #define FEDM_XML_TAG_OBID_UC L"OBID"
00142 #define FEDM_XML_TAG_FILE_HDR_UC L"file-header"
00143 #define FEDM_XML_TAG_DATA_ARRAY_UC L"data-array"
00144 #define FEDM_XML_TAG_CFG_UC L"CFG"
00145 #define FEDM_XML_TAG_PARTITION_UC L"partition"
00146 #define FEDM_XML_TAG_DATA_UC L"data"
00147 #define FEDM_XML_TAG_DATA_LENGTH_UC L"data-length"
00148
00149
00150 #define FEDM_XML_ATTRIB_NAME_UC L"name"
00151 #define FEDM_XML_ATTRIB_BLOCKS_UC L"blocks"
00152 #define FEDM_XML_ATTRIB_SIZE_UC L"size"
00153 #define FEDM_XML_ATTRIB_DEVICE_ID_UC L"device-id"
00154 #define FEDM_XML_ATTRIB_TYPE_UC L"type"
00155
00156
00157 #define FEDM_XML_STRING_EEPROM_DATA_UC L"Reader EEPROM-Parameter"
00158 #define FEDM_XML_STRING_RAM_DATA_UC L"Reader RAM-Parameter"
00159 #define FEDM_XML_STRING_ACC_EEPROM_DATA_UC L"Reader EEPROM-Parameter for ACC"
00160 #define FEDM_XML_STRING_ACC_RAM_DATA_UC L"Reader RAM-Parameter for ACC"
00161 #define FEDM_XML_STRING_TMP_DATA_UC L"Temporary Protocol Data"
00162 #define FEDM_XML_STRING_MJP_DATA_UC L"Temporary Multijob Protocol Data"
00163 #define FEDM_XML_STRING_SN_DATA_UC L"Transponder Serial-Number"
00164 #define FEDM_XML_STRING_ID_DATA_UC L"Transponder ID-Number"
00165 #define FEDM_XML_STRING_AC_DATA_UC L"Transponder Account"
00166 #define FEDM_XML_STRING_PUB_MEM_UC L"Transponder Public Memory"
00167 #define FEDM_XML_STRING_SEC_MEM_UC L"Transponder Secret Memory"
00168 #define FEDM_XML_STRING_CFG_MEM_UC L"Transponder Configuration Memory"
00169 #define FEDM_XML_STRING_DATE_MEM_UC L"Transponder Date Memory"
00170
00171
00172 #define FEDM_XML_STRING_COMM_MODE_SERIAL_UC L"Serial"
00173 #define FEDM_XML_STRING_COMM_MODE_USB_UC L"USB"
00174 #define FEDM_XML_STRING_COMM_MODE_TCP_UC L"TCP"
00175
00176
00177 #define FEDM_XML_STRING_DOC_TYPE_1_UC L"Reader Configuration File"
00178 #define FEDM_XML_STRING_DOC_TYPE_2_UC L"Reader Firmware Upgrade File"
00179 #define FEDM_XML_STRING_DOC_TYPE_3_UC L"Reader Firmware Update File"
00180 #define FEDM_XML_STRING_DOC_TYPE_4_UC L"Reader Profile File"
00181 #define FEDM_XML_STRING_DOC_VERSION_UC L"1.0" // document version
00182 #define FEDM_XML_STRING_PROFILE_DOC_VERSION_UC L"1.0" // document version
00183 #define FEDM_XML_STRING_FWUG_DOC_VERSION_UC L"2.0" // document version
00184 #define FEDM_XML_STRING_FWUPD_DOC_VERSION_UC L"1.3" // document version
00185 #define FEDM_XML_STRING_FWUPD_REQ_DOC_VERSION_UC L"1.2" // required document version
00186
00187
00188 #define FEDM_XML_STRING_DOC_TYPE_1 "Reader Configuration File"
00189 #define FEDM_XML_STRING_DOC_TYPE_2 "Reader Firmware Upgrade File"
00190 #define FEDM_XML_STRING_DOC_TYPE_3 "Reader Firmware Update File"
00191 #define FEDM_XML_STRING_DOC_TYPE_4 "Reader Profile File"
00192 #define FEDM_XML_STRING_DOC_VERSION "1.0" // document version
00193 #define FEDM_XML_STRING_PROFILE_DOC_VERSION "1.0" // document version
00194 #define FEDM_XML_STRING_FWUG_DOC_VERSION "2.0" // document version
00195 #define FEDM_XML_STRING_FWUPD_DOC_VERSION "1.3" // document version
00196 #define FEDM_XML_STRING_FWUPD_REQ_DOC_VERSION "1.2" // required document version
00197 #define FEDM_XML_STRING_COMM_MODE_SERIAL "Serial"
00198 #define FEDM_XML_STRING_COMM_MODE_USB "USB"
00199 #define FEDM_XML_STRING_COMM_MODE_TCP "TCP"
00200
00201
00202
00203
00204
00205
00206 typedef struct _FEDM_XML_ATTRIBUTE
00207 {
00208 wstring sAttribute;
00209 wstring sValue;
00210
00211 } FEDM_XML_ATTRIBUTE;
00212
00213
00214 typedef struct _FEDM_XML_TREEITEM
00215 {
00216 wstring sTag;
00217 wstring sValue;
00218 vector<_FEDM_XML_ATTRIBUTE*> aAttribList;
00219
00220 vector<_FEDM_XML_TREEITEM*> aChildList;
00221
00222
00223 bool bNewLine;
00224 bool bEmpty;
00225
00226 } FEDM_XML_TREEITEM;
00227
00228
00229
00230
00231
00232
00233
00234 typedef vector<FEDM_XML_TREEITEM*> FEDM_XML_TREE_LIST;
00235 typedef vector<FEDM_XML_TREEITEM*>::iterator FEDM_XML_TREE_LIST_ITOR;
00236 typedef vector<FEDM_XML_ATTRIBUTE*>::iterator FEDM_XML_ATTRIBUTE_LIST_ITOR;
00237
00238
00239
00240 #endif // #ifdef _FEDM_XML_SUPPORT
00241
00242 #endif // !defined(_FEDM_XML_H_INCLUDED_)